Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble with script  RSS feed

 
Brain Pedigo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all;

I am learning Ruby and I have made this simple guess the number game. However, I am getting error that I cant track down because I am new to Ruby. The error reads in greeting undefined local variable or method the_game. I would think this might be a scope problem but I am not sure. Any ideas on what is going on?

 
Junilu Lacar
Sheriff
Posts: 10949
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try removing any reference to "the_game" inside the Game class. That is, where you have written things like the_game.cls and the_game.pause anywhere on lines 15-121, just write cls and pause instead.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!