Hangman dictionary

When I try to run/play the game in the terminal with PRY, as soon as I start the new game, it displays my @dictionary. Which is an array of every line in the dictionary.txt file. But it only loads like 20 at a time or something and I have to press a key to make it continue. It’s gonna take me 10 minutes just to get past it so I can start testing the game. Is there a way to make it NOT display my @dictionary or something?

I figured out a way around it. In my initialize method I set @dictionary to an empty array. And then added this method to the class.

def read_dictionary
  File.foreach("lib/dictionary.txt") { |word| @dictionary << word.chomp }
end

Which returns nil. So terminal doesn’t try to display the whole thing.
I just make this method the first thing that runs in the game

Hi Trevor,

Nice workaround. If you push your code up to bitbucket I can take a look as well. Also for future reference, if the terminal is ever in the display mode allowing you to scroll through long content you can press ‘q’ to quit out. Also the ‘d’ and ‘w’ keys are for page down/up respectively.

You mention Bitbucket here, but is that how we can ask questions without posting in this forum? I did not see any instruction about signing up for Bitbucket until now.

Tamae, this thread is out of date. We’re no longer asking students to sign up for BitBucket. You should continue to post questions to this forum as well as to the live chat.