"Aloe's Gym puzzle is kinda tough if you don't read Japanese. Go the first shelf on the left, select the first option, then click the screens. Next shelf to go to is the second on the left (directly behind the first) and select the first option. After that's done go up to the girl at the last shelf on the left and she will battle you. After she will step aside and you can read the book (first option) then go to the first shelf on the right, select first option. After that go to the girl on the right and she'll battle you… beat her and she'll step aside and the shelf will slide open to reveal a staircase to Aloe!"
This is the "Code" to reach Aloe, the Second Gym Leader.