[6515] in java-interest

home help back first fref pref prev next nref lref last post

Knight's Tour Applet

daemon@ATHENA.MIT.EDU (Lou Fasulo)
Tue Apr 2 01:31:15 1996

Date:         Mon, 1 Apr 1996 01:38:39 -0500
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: Lou Fasulo <fasulol@POSTOFFICE.PTD.NET>
To: Multiple recipients of list JAVA-INTEREST
              <JAVA-INTEREST@JAVASOFT.COM>

I am writting a Knight's Tour applet and I have the code so that
it makes one attempt.  However, I am having problems altering the code
so that it will make more than one attempt and then repaint only once.
The applet (running) and code are available at my website.  I think I
have left enough comments so that you can follow my logic.  Basically
there are three methods:

        the first determines the possible legal moves and stores them in
an array.
        The second sorts that array in order of that spot's
accessibility(the number of places you can move to a spot from)
        The third method randomly picks which move to make from the best
three, weighted toward the best move.

        My website:

        http://home.ptd.net/~fasulol/knight.html

        Thanks,

        Lou

home help back first fref pref prev next nref lref last post