Trouble with array of dictionaries, ruby
- by user299450
I am getting the following error.
game.rb:46:in `play': undefined method `[]' for nil:NilClass (NoMethodError)
from game.rb:45:in each'
from game.rb:45:inplay'
from game.rb:56
with this code,
def play()
currentTile = nil
@tiles.each do |tile|
if(tile['Name'] == 'Starting Square')
…