-
-
Save jashkenas/1171530 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) -> | |
for row in @rows when row[column] is null | |
row[column] = ball | |
return |
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