DEV Community

Discussion on: Ruby As A Second Language

Collapse
 
rpalo profile image
Ryan Palo

This is super cool! I love Ruby, so thanks for sharing :)

BTW, if you run into any grid/matrix problems in the future that you want to use Ruby for, check out the matrix library that's part of Ruby's standard library.

require 'matrix'

grid = Matrix[[0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0]]
grid[1, 1]
# => 1
grid[2, 1]
# => 0

:)