import LG Twixt board into JTwixt? TWIXT PP
6 replies. Last post: 2004-11-11
Reply to this topic Return to forumReturn to forum
You have 0 new messages
You have 0 games on move.
You have 0 invitations to game.
6 replies. Last post: 2004-11-11
Reply to this topic Return to forumHi Community!
Is there a way to import the current board setup of a LG Twixt game into JTwixt?
I wrote a Ruby script called getgame:
http://www.mindspring.com/~alanh/getgame.rb
Pass the game number in as a parameter, like this:
ruby getgame.rb 135027
and it will create a Jtwixt file called game135027.tgt. You can pass multiple numbers on the same command line, and it will get them all.
If you don't have Ruby, you can download it from
The swap rule is handled (in a kind of strange way), but link crossing is not handled at all.
Thanks a lot, Alan! This works perfectly!
Too bad, JTwixt is not open source. Otherwise we could adapt your code to Java and implement it as a tool in JTwixt..
Now you can open and replay LG games (SGF format) into the k2z win32 client.
K2Z and LG does not handle the swap the same way. K2Z does not move first peg across the diagonal, but swap side instead.
So swapped games will look rotated by 90 degres.
Enjoy
Actually, the K2z image will not be rotated 90 degrees. It will be reflected along the diagonal.
Jtwixt has “flip board” and “flip grid labels” commands, so you could view the board either way you want. Also Jtwixt can handle an entire branching tree of variations, not just the moves of the game.
The K2z Windows client is much easier to install, of course, especially if you don't want to mess with Java. My favorite K2z feature is the post game analysis. You can replay the game on your screen, make alternate moves, and discuss them with your opponent.
Wonderful tool Alan! I noticed I could use the same ruby script for getting hex games for jHex! I just had to edit the boardsize in your script.
I was wondering; Do you also have an automated way of merging multiple games in one gametree ?