i have to write a program in java to basically determine all the possible movements of the knight piece of a chess board. I really dont have much more
than a simple algorithm lol. Do any programmers have any hints or ideas for me? or if you did it in another language can i look at it and get an
idea?thanks
Now for the moves just add (or subtract) 2 from one dimension, and then one on the other. Of course you'll have to do some boundry check, but that's
pretty much it.
To be honest I'm not the best Java programmer in the world, but if I can give my 2 cents: This site shows the source code for a Java Script Chess game. Programmers Heaven gives the complete Java project for a simple Chess game.
I know you don't want to copy and paste someone else's work - that would be beyond the point. But looking at someone else's ideas should get the
creative juices flowing.
This Site gives a complete description on the theory behind creating a chess program. Highly recommended.