TextTwist Solver

TextTwist

Among all kinds of time wasters out there, word games got to be my favorite. And from all those word games, there’s one game that stands out from the other, it’s called TextTwist. It is a very simple word game, and yet very addictive. I know I’m not alone, the game is consistently placed as one of the most popular game for months, maybe years, while the likes of [Dynomite](http://en.wikipedia.org/wiki/Dynomite), [Bejeweled](http://en.wikipedia.org/wiki/Bejeweled) and now [Zuma](http://en.wikipedia.org/wiki/Zuma_(computer_game\)) tend to be short lived craze.

The game presents a set of six letters and the player needs to arrange the letters to form English words from three to six letters long within the allotted time. If the player can find at least one six letter word, it advances to the next puzzle. Otherwise, the game is over. The player get extra score for every words found, and a big bonus if all words were found before the time runs out.

The love for a game time waster is not complete before you write a cheat solver for it. So, despite the [abundance of the exact same solver](http://www.google.com/search?q=texttwist+solver&ie=UTF-8&oe=UTF-8) on the net, I wrote mine below. It is in Perl, so you will need (obviously) a [Perl](http://perl.org) interpreter. You also need [Aspell](http://aspell.sourceforge.net) with English dictionary installed.


#!/usr/bin/perl

open(ASPELL, 'aspell dump master en|');
while() {
   chomp;
   $_ = lc $_;
   next unless /^[a-z]{3,6}$/;
   if (check($_, $ARGV[0])) {
      push @out, $_;
   }
}
print join("\n", sort {length $a <=> length $b || $a cmp $b} @out);
print "\n";

sub check {
   ($word, $letters) = @_;
   %letcount = ();
   foreach (split(//, $letters)) {
      $letcount{$_}++;
   }
   foreach (split(//, $word)) {
      $letcount{$_}--;
      return if $letcount{$_} < 0;
   }
   return 1;
}

Save the code as `texttwist.pl` and run it like `./texttwist.pl lorstl` where 'lorstl' is the letters presented in the game.

Needless to be said, this post also serves as a "never trust high score list unless you see the game yourself" kind of warning. However, I used to consistently score above 150000 with my Palm version, with high score between 500000 and 600000, without any cheats, honest!

Obligatory links:

* [TextTwist](http://get.games.yahoo.com/proddesc?gamekey=texttwist) in Yahoo! Games
* [TextTwist](http://www.gamehouse.com/onlinegames/playgame.jsp?navnum=9&AID=1263&game=twist&code=TextTwist) in GameHouse
* [TextTwist](http://www.bigfishgames.com/online/online_texttwist/online_texttwist.php) in BigFishGames
* [TextTwist](http://zone.msn.com/en/texttwist/) in MSN Zone

51 comments

  1. Jadi inget game Scramble waktu zaman MIRC dulu, aku bikin script ASP buat nampilin semua kemungkinannya, jadi nemu lebih banyak kombinasi.

    Kalo sekarang sih lebih suka maen Solitaire \:d/

  2. However, I used to consistently score above 150000 with my Palm version, with high score between 500000 and 600000, without any cheats, honest!

    Owh, Really? :-?

  3. om pri caranya nulis source code di wordpress gimana ??, saia nulis source code di wordpress malah ancur di kacoin ama tinymce ?? :((

  4. #21: saya juga mengalami :D akhirnya setelah chat-chit-chet dengan Priyadi, kesimpulannya tanggalkan saja tinyMCE. :)

    Btw pri, skor tinggi tanpa cheat? ah yang benerrrrr.. posting malem-malem biar gak rusak puasanya karena boong ya. hihihihii

  5. wah… emang game house bisa dipake tua muda ya :d… ada ga sih text twist yang bahasa indonesia \:d/… buat dong mas pri gamenya…

  6. Pingback: Anonymous
  7. wah pengen nyontek skripnya buat di tungsten tuh. sayang project python for PalmOS gak dilanjutin lagi tuh. ada juga Lua for palmOS, tapi gak ngerti sintaksnya :((

  8. :D hieoheoheoheio.. semuanya pernah nyantel di MIRc yah :D :D heuheueh.. teteupz ga ngerti ahh.. si om pri ga pake chat soalnya jawabannya dikeep yah :d *kaburr*

  9. Saya dulu juga suka main game sejenis di kumpulan game Hoyle Words.
    Bagus u/ menambah pembendaharaan kosakata [yang saya lupakan keesokan harinya :((]

  10. Pingback: Ngoprek Web
  11. Pingback: this is adhisimon

Leave a Reply to Dedi Dwitagama Cancel reply

Your email address will not be published. Required fields are marked *