Created
August 25, 2011 19:06
-
-
Save gilesbowkett/1171508 to your computer and use it in GitHub Desktop.
why does this CoffeeScript not accurately translate this Ruby?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert: (ball, column) -> | |
inserted = false | |
for row in @rows | |
if null == row[column] | |
row[column] = ball unless inserted | |
inserted = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def insert(ball, column) | |
@grid.each do |row| | |
next unless row[column].nil? | |
row[column] = ball | |
return | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment