Ruby implementation of the game's logic with TDD