Skip to content

Commit

Permalink
re-align final to use @picked in same way we did in first version
Browse files Browse the repository at this point in the history
  • Loading branch information
brntbeer committed Nov 7, 2012
1 parent f2cc3be commit 2e63772
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions shoes/connect-four-final.rb
Expand Up @@ -20,20 +20,18 @@

animate do
button, x,y = self.mouse

column = x / 100
row = y / 100
over_x = x % 100
over_y = y % 100

if button == 1
if (5..105).include?(over_x)
if (5..105).include?(over_y)
@turn+=1
color = @turn % 2 == 1 ? red : black
space = (@columns[column].last*7)+column
@board[space].style(:fill => color)
@picked << space
@columns[column].pop
end
space = (@columns[column].last*7)+column
if !@picked.include?(space)
@turn+=1
color = @turn % 2 == 1 ? red : black
@board[space].style(:fill => color)
@picked << space
@columns[column].pop
end
end
end
Expand Down

0 comments on commit 2e63772

Please sign in to comment.