5th Dec, 2007

Cheating for Fun

I recently checked out the Scramble application on Facebook, which is a knock-off of Boggle. It’s a fun diversion, even though I usually get my ass kicked. There’s an annoying chat window there, too, and invariably someone will accuse someone else of cheating, at which point a number of people will pipe up with “how would you cheat?”

This got me thinking…how *would* you cheat? You’d just have to write a Scramble puzzle solver that spit out all the words in on the board. That sounded like a fun problem. I hadn’t done anything with recursion in a while, so I gave it a go. Below is what I came up with. You’ll need a word list to run it. I originally used /usr/share/dict/words, but it was missing a lot of valid words (I think it only has base words, no plurals or tenses). So I stole the scrabble word list from the Debian scrabble package, which worked much better.

Anyway, here you go:

I did try this out a couple times on Scramble and won handily. There’s really not much fun in that, though.

Update: I posted this in one of the comments below, but I’ll put it here as well to make sure everyone sees it: This was really just an exercise in coming up with a fun algorithm, and is primarily intended for programmers. If you’re just looking to cheat at Boggle/Scramble, there are plenty of web sites that will help you with that, and with a lot less effort.

Responses

Brad, you’ve turned me into a winner. Thanks!

i cant get this thing run… it just shows me a txt file…

Matrix - I named the file boggler.txt because (a) WordPress wouldn’t let me upload a .rb file, and (b) I wanted people to be able to click on it and view the source, rather than have to download it first. You just have to download it to your machine and run it from there (you’ll need ruby installed, of course: http://www.ruby-lang.org/).

can this run on a mac?

Sure, that’s what I wrote it on. You just have to install ruby.

[...] http://blog.footle.org/2007/12/05/cheating-for-fun/ [...]

Sorry to be a newbie, how to change from .txt file to .rb???

help. how do i use all the stuff that i downloaded i have no idea what to do

I don’t seem to know how to get this to work after I get Ruby and then the code and words. Would anyone like to give me any help?

moon/shannyant/Andrew - This was really just an exercise in coming up with a fun algorithm, and is primarily intended for programmers. If you’re just looking to cheat at Boggle/Scramble, there are plenty of web sites that will help you with that: http://www.l.google.com/search?q=cheat+boggle

HELP!!!

I downloaded ruby, or well.. “locamotive” and i just want it to go away now. I’m a premed student and can tell you a ton about the human body but absolutely nothing about computers. Please help me get rid of this. :( Ps. I’m trying to get it off my macbook.

Ally- I’m pretty sure there’s not anything more to uninstalling than just dragging the Locomotive folder in Applications to the trash.

I think it’s gone now. goodness I’m slow…

Interesting, but I assume that Ruby is not supported on Vista?

Hi i got this running in cmd but am new to ruby.. How do i get it to output on to the board?

Leave a response

Your response:

Categories