Skip to content

Instantly share code, notes, and snippets.

@llopez
Last active August 8, 2018 19:00
Show Gist options
  • Select an option

  • Save llopez/35fdaef2bea71c084a21315b740f2445 to your computer and use it in GitHub Desktop.

Select an option

Save llopez/35fdaef2bea71c084a21315b740f2445 to your computer and use it in GitHub Desktop.
Chechers
# Provide the specs for a `Board` class
# This `Board` class has a `move_piece` method that expects 2 parameters,
# `from` that represents the initial position of a piece,
# 'to' that represents the end position of a piece.
# the method returns `true` if the movement was successful
# and a `false`` if it is not.
# Describe all the possible and not possible movements for a piece.
# The name of the game is `Chechers` (Damas in spanish)
# Pieces are able to move in diagonals and always forward
# Pieces are able to move one cell a time
# Pieces cannot go outside the board
class Board
def initialize
# ...
end
def move_piece(from, to)
# ...
end
end
# Specs
describe Board do
describe '#move_piece' do
# your code here...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment