------ art_51574_18736241.1168181849425 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/7/07, Fedor Labounko <fedor.labounko / gmail.com> wrote: > > It just so happened that I was learning ruby last summer and wrote a > program to cheat for me at TextTwist. Needless to say the game got boring > really fast, but it was neat writing the program. I've modified it a bit to > instead play the game, but I'm a fairly new user and would appreciate any > feedback, both ruby related and general programming. > > To run this you'll need a dictionary file of words, each on a new line, > called wordlist.txt and you need to require 'dict' and run Dict.reduce(3,6) > before you run the program. This will create a reduced dictionary file of > only words of lengths between 3 and 6. I didn't make this part of my > program's general execution as I figured doing this once was enough and I > could do it manually. > > It's got a simple text interface that looks sort of like the TextTwist gui > layout on Yahoo. Sort of. The dictionary I use, which I did not attach > because its size (3 megs, I believe it was the full Scrabble dictionary) > makes for a much harder game than the Yahoo TextTwist as some of the words > are really obscure. > > Also, I have the problem that when running this on Windows it doesn't > allow me to manipulate files with Ruby, giving me a Permission Denied error > on File.open. Any idea why this might be? This is if I try to run > Dict.reduce(3,6) for example. E:\ruby\programs\rubyquiz\quiz108\other submissions>ruby texttwistGame.rb ./dict.rb:20:in `initialize': No such file or directory - reducedwordlist3.txt ( Errno::ENOENT) from ./dict.rb:20:in `open' from ./dict.rb:20:in `get_dict' from texttwistGame.rb:37 fixed that, but then: E:\ruby\programs\rubyquiz\quiz108\other submissions>ruby texttwistGame.rb texttwistGame.rb:17:in `pick_word': undefined method `delete_if' for nil:NilClas s (NoMethodError) from texttwistGame.rb:38 I'm too tired to go bug hunting. Check out my submission crop.rb to see how I did the windows file writing. Now that I've submitted my program I'm going back to sleep. :) ------ art_51574_18736241.1168181849425--