Umm not sure what to explain... -n is used for an input loop for interaction -l is used to get implicit EOL's $, is set to space to make the bottles easier to count I like map, and with $, a single print works fine. The messages are ROT13, to make source viewing a pain, and eat char's... Most of the body is syntax checking to prevent the user from entering char's other than 1,2,3. 1, 2, and 3 shifted right twice should be 0... if true they tried to take to many bottles... bitwise shifting twice with a floor catches negative values ++, -- makes non-numerics into 0. ||=4 makes 0 (including 0 from above) and null into an invalid entry caught above... Logic The computer takes an even number(2) if an odd number of bottles remain Otherwise it takes 1 or 3. It chooses that which will let it win this turn, else it picks @ random Half the time the computergets to start first. The only cheap way to do this with -n was to have it complain and then order the user to go...