Skip to content

Commit

Permalink
Enhancement #3
Browse files Browse the repository at this point in the history
  • Loading branch information
roca committed Mar 11, 2013
1 parent 2c9de52 commit 1aee1f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ruby/hw6assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class MyPiece < Piece
# class method to choose the next piece
def self.next_piece (board,cheat=nil)
square = [[[0, 0], [0, 0], [0, 0], [0,0]]]
cheat ? MyPiece.new(square, board) : MyPiece.new(All_Pieces.sample, board)
cheat ? MyPiece.new(square, board) : MyPiece.new(All_My_Pieces.sample, board)
end



# class array holding all the pieces and their rotations
All_Pieces = [
All_My_Pieces = [

[[[0, 0], [1, 0], [0, 1], [1, 1]]], # square (only needs one)
rotations([[0, 0], [-1, 0], [1, 0], [0, -1]]), # T
Expand All @@ -84,7 +84,7 @@ def self.next_piece (board,cheat=nil)
]
# your enhancements here
def self.piecies
All_Pieces
All_My_Pieces
end
end

Expand Down

0 comments on commit 1aee1f5

Please sign in to comment.