|
|
|
|
|
by codesnik
705 days ago
|
|
I'd too probably write it in Ruby using classes basically just as modules and not much else. It's totally fine using simple arrays and hashes in Ruby for data structures. For example, unlike in many other languages, board could be just a hash of booleans addressed by "tuples", like @board = {[x1, y1] => true, [x2, y2] => true}, which makes neighbours check trivial, while board will be sufficiently compact. |
|