
-----------------------------------
Jessica359
Mon Apr 21, 2008 8:03 am

Chessboard
-----------------------------------
Ok so here we have to output a chessboard using arrays and that if the user give box 1,3 for example it has to output the colour of the box (black or white)
how would I write my array? 
thnxs  :!:  :D

-----------------------------------
Tallguy
Mon Apr 21, 2008 9:53 am

RE:Chessboard
-----------------------------------
r u doinfg a chess game 4 ur final?

-----------------------------------
[Gandalf]
Mon Apr 21, 2008 12:38 pm

Re: Chessboard
-----------------------------------
You could have an 8x8 two dimensional array where the value of each element represents the colour of the corresponding square.  A simple way to set the colour in the checkerboard pattern is to use mod on the array index (ie. if the index is odd the colour is white, otherwise it's black).  Once you've done that all you need is simple user input and conditional statements.

-----------------------------------
Jessica359
Mon Apr 21, 2008 1:10 pm

RE:Chessboard
-----------------------------------
awesome thanks
