Class Game
In: lib/libttc.rb
Parent: Object

A game of Trap the Cap. It keeps a history of all previous states.

Methods

Attributes

board  [R] 
current_player  [R] 
history  [R] 
pieces  [R] 
players  [R] 

Public Class methods

Given a set of lines from an input file, turn them into a Game object and a set of Move objects. Note the multiple return values. Class method

Public Instance methods

Apply a single move to a game.

Apply a list of moves in order

Set the current player to be the next player

Return an array of all possible moves from this state, given the die roll and the active player

Show the state of the board

Undo a move

[Validate]