TakeNote and JChess



I've written two blogs recently about Pussy Linux. Sickgut, the author of Pussy Linux really likes BASIC; me too. Sickgut has a link on his website to the ftp site for a clone of QBasic; the version of BASIC that Microsoft supplied with Windows 95/98. This got me to thinking about Takenote; a program I wrote back in 1992, using Microsoft QuickBASIC 4.5 (QBasic is based on QuickBASIC).

TakeNote was shareware. The idea of shareware was that a professional programmer could earn money by writing a program that people could download for free off of a bulletin board, and then pay the program's author if they kept using it. I was a professional BASIC programmer, so I thought I'd try earning some money by writing a shareware program in BASIC. ...and I'd just been talking to some chess master about how chess is studied (I was rated 1800 at the time, and the master about 2200) so TakeNote was a natural choice for shareware; a chess study utility.

The version of BASIC I had in mind when I wrote TakeNote was GWBASIC; the BASIC that came with MS/DOS. I had read a book by Tim Hartnell, called the "Giant Book of Computer Games". This great book had a simple chess program in it that incorporated some wonderful ideas, absolutely necessary because Tim Hartnell wrote all the programs in this book using GWBASIC (or something like it). I didn't write TakeNote in GWBASIC, but I wanted it to use data structures that were available in GWBASIC; just like Tim Hartnell had. The linked lists in TakeNote are implemented with an array; not necessary in QuickBASIC, but it would've been in GWBASIC.

It's 2013 now; over 20 years since I wrote TakeNote. The version of TakeNote in my program list is one I wrote in 1995. In 1996 I thought about using real linked lists (incorporating pointers) and saving the games in a relational database. I never got around to updating TakeNote. This was shareware, something I thought I'd get at least a few hundred bucks for writing; I never got a red cent. I was getting paid to write programs for mini/mid-range computers, so that's where I applied my efforts.

Over a three year period I added features to TakeNote and did some bug fixing. I used TakeNote now and then to study some lines of chess, and found bugs that way; fixed them when I had the time, after finding them during a study session. Now it's years later, and TakeNote isn't something you can just udate or upgrade. TakeNote is part of a bygone era; it really won't run on any platform anymore. ...but I still thought about the program after reading Sickgut's home page, with an eye to updating and upgrading TakeNote.

Flash forward to 2002. C was still the primary language I was writing in on the job, but I had also written in Smalltalk, C++ and some other OOP (Object Oriented Programming) languages; e.g., Java. What I had noticed in OOP was that most programmers wrote procedurally; i.e., their programs were not OO (Object Oriented) even though they wrote in OOP languages. This was also true in the case of chess programs. I had looked at the code in several chess programs, and none of them were really object oriented. So, in 2002 I wrote JChess as one of the blogs on my personal home page.

The idea behind JChess is that each square should be an object. When you move a piece to a square, the piece should be able to ask the square for all the info it needs. There isn't any need to determine where the piece is on the board, and then call a bunch of procedures to determine what to do next. JChess follows the idea that objects should be able to send each other messages, and get responses. JChess is an object oriented program written in an OOP language, Java.

I originally planned on adding features to JChess until it was a full fledged chess program. After you create a legal move generator, making your program play chess is pretty easy; you generate legal moves, sort them according to some heuristics, feed the move at the top of your list into the legal move generator, etc. After you've evaluated the endpoint moves of your lists, you play the move that gets you to the endpoint with the highest score. There are a whole lot of things you can do to make your program play better chess, but that's the basic idea.

I'm going to add a feature to JChess; the ability to branch out to and store multiple lines of play, and easily traverse them; just like TakeNote. I haven't done it yet, but click on the link to try out JChess. JChess will download as a Java web start program, so any time I modify JChess it will appear automatically in this web start.



January 12, 2013: Fixed horizontal move calculations for the legalmoves list
January 16, 2013: Fixed it correctly; that last fix was a quick hack.
January 19, 2013: Added color to move checking to the legal move generator

Launch JChess Application            Return to my blog page            My Program List