Ruby back-end logic for this game