Results 1 to 1 of 1
Thread: Checkers in Java
- 02-14-2012, 05:43 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 1
- Rep Power
- 0
Checkers in Java
I'm making a checkers game that will run on the command line. so far this is what i've done. This only the board. and my problem is how to move the pieces. this program must allow teo players to play this game on an 8X8 board.
//Printing of Board
//Red or white
class Checkers{
public static void main(String args[]){
String[][] checkers = new String[8][8];
System.out.println("------------------");
for(int rowcount = 0; rowcount<8; rowcount++){
System.out.print("|");
for(int colcount = 0; colcount<8; colcount++){
if ( rowcount % 2 == colcount % 2 ) {
if (rowcount < 3){
checkers[rowcount][colcount] = "w";
System.out.printf("%s ", checkers[rowcount][colcount]);
}
else if (rowcount > 4){
checkers[rowcount][colcount] = "r";
System.out.printf("%s ", checkers[rowcount][colcount]);
}
else{
checkers[rowcount][colcount]= ".";
System.out.printf("%s ",checkers[rowcount][colcount]);
}
}
else {
checkers[rowcount][colcount]= ".";
System.out.printf("%s ",checkers[rowcount][colcount]);
}
}
System.out.println("|");
}
System.out.println("------------------");
}
}
Guys i'm new in java about 3 months and i need your help BADLY! THANK YOU! :D
Similar Threads
-
My First Java Game: Checkers
By Heartbeat in forum New To JavaReplies: 5Last Post: 01-24-2012, 04:44 AM -
Checkers Movement
By Hollowsoul in forum Advanced JavaReplies: 14Last Post: 08-28-2011, 08:12 PM -
Our Checkers Game
By Doefat in forum Java AppletsReplies: 2Last Post: 01-21-2011, 11:30 AM -
need advice for checkers game
By javanoob73 in forum New To JavaReplies: 13Last Post: 12-02-2009, 01:10 AM -
Checkers
By evan42781 in forum New To JavaReplies: 8Last Post: 05-08-2009, 04:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks