Conversation
…t the image according to how many wrong guesses there are
…ng in image method to print out backslash.
… starts the game. Game over method checks if user is out of guesses.
…_word_array and @game_word_array from guess method to word_gen. In the image method, we added the .join() method to game_word_array.
…nimals and diffucult by using arrays. word list is a hash with the values for each theme.
…e# variables to add space in image depending on word length and guessed letters for aesthetics.
| require "colorize" | ||
|
|
||
| class Word_guess | ||
| attr_accessor :wrong_count, :word_list, :secret_word, :game_word, :game_word_array |
There was a problem hiding this comment.
attr_accessor can be pretty dangerous. Are you sure you want me to be able to access secret_word when I'm playing your game? Or to be able to change secret_word from outside the class? You only need getter/setter methods when things (methods, other classes, users) need access to instance variables from outside the class. What would happen if you deleted this line completely? Would anything break?
@word_list, for example, is used three times in your program, none of which involve exposing the value to something/someone outside the object. Something to keep in mind in the future.
|
Hi! ^_^ Great job on this project! I've let a few comments for you to review, but, overall, everything looks great. Your code is very organized and expressive. You've solved problems in creative ways, and leveraged the collective knowledge of the internet to great effect. Keep it up! |
Nadine Curry and Yordanos Dirar worked on this project.
Depends on colorize gem.
Have fun ^_^