Page 1 of 1

Chess question

Posted: Mon Apr 05, 2004 1:35 pm
by cto1mac
Ok, so I know it is a completely selfish pursuit: building a mysql/php chess game. I have gotten a few different things to work to create the table: for loops and such. But, I cannot help but feel that an array would be the way to create the table and allow me to track movement. So I created an array.

Code: Select all

$arr = array('x','y'....);
So now I have this array that is 63 (starting with 0) long. How do I get a looping structure to continue reading all of the array but start a new output row when it hits the end of the 8 block row?

Thanks for the help.
And anyone who wants to help on this project is more than welcome to contact me. I just think that chess is about the best game on the planet and want to create my own training, gaming site for fun. I also have my mind set to try some other baseline games, othello, checkers, battleship and such.

Posted: Mon Apr 05, 2004 1:37 pm
by magicrobotmonkey
if(index+1%8 == 0 )
start new row

Posted: Mon Apr 05, 2004 1:46 pm
by Roja

Posted: Mon Apr 05, 2004 2:03 pm
by cto1mac
Thanks for the quick responses. I will look into the sourceforge project.