a classic small game implemented by Ruby