Skip to content
zmontesd edited this page Jan 30, 2013 · 4 revisions

Game Models

Commands

$ game = Game.new $ game.board


Calling on board (an array of arrays)

$ game.board[0][0] = 'red'

[0][0] is the default position for bottom left

1st is column

2nd is the row

$ puts game.pretty_print $ game.current $ game.current_player $ game.status # Responses => in progress => red # player 1 => blue # player 2

saving your game

$ game.save!

prompt line to display all the connect four method

$ ls

command to run rspec

$ rspec spec # running all specifications $ rspec spec/filename # running specific file $ rspec spec/filename line # running specific line in file

Clone this wiki locally