[Commit] RRbot RicochetRecursive.java,1.7,1.8
Christian L. Platt
commit at keithp.com
Tue Jun 10 12:56:46 PDT 2003
- Previous message: [Commit] RRbot RicochetRecursive.java,1.6,1.7
- Next message: [Commit]
RRbot game1.gm,NONE,1.1 game2.gm,NONE,1.1 game3.gm,NONE,1.1
game4.gm,NONE,1.1 game5.gm,NONE,1.1 game6.gm,NONE,1.1
solutions.txt,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: plattc
Update of /local/src/CVS/RRbot
In directory home.keithp.com:/tmp/cvs-serv1166
Modified Files:
RicochetRecursive.java
Log Message:
Fixed string board parsing error.
Index: RicochetRecursive.java
===================================================================
RCS file: /local/src/CVS/RRbot/RicochetRecursive.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- RicochetRecursive.java 10 Jun 2003 18:24:11 -0000 1.7
+++ RicochetRecursive.java 10 Jun 2003 18:56:44 -0000 1.8
@@ -57,7 +57,7 @@
}
//readInBoard();
- //System.out.println( board.toString() );
+ System.out.println( board.toString() );
//System.exit(1);
calcAllPairsShortestPath();
@@ -296,7 +296,7 @@
}
//strPos++;
- System.out.println( "X" + lineStr );
+ //System.out.println( "X" + lineStr );
for ( int colPos =0; colPos < lineStr.length(); colPos++ ) {
switch ( lineStr.charAt(colPos) ) {
@@ -309,11 +309,20 @@
case 'g':
case 'r':
case 'b':
- if ( lineStr.charAt(++colPos) == '.' ){
+ if ( lineStr.charAt(colPos+1) == '.' ){
+ robots[robotNum] = new Robot ( rowPos/2, colPos/4
+ , lineStr.charAt(colPos));
+ board.placeRobot( (rowPos/2), (colPos/4), robotNum++);
+ } else if ( lineStr.charAt(colPos+2) != '.' &&
+ lineStr.charAt(colPos+2) != '|' &&
+ lineStr.charAt(colPos+2) != ' ' ) {
robots[robotNum] = new Robot ( rowPos/2, colPos/4
, lineStr.charAt(colPos));
board.placeRobot( (rowPos/2), (colPos/4), robotNum++);
+
+
}
+ colPos++;
break;
@@ -328,11 +337,18 @@
case 'R':
case 'B':
case 'W':
- //if ( lineStr.charAt(colPos) == lineStr.charAt(colPos+1) ){
if ( lineStr.charAt(colPos+1) == '.' ){
robots[0] = new Robot ( rowPos/2, colPos/4
, lineStr.charAt(colPos));
board.placeRobot( (rowPos/2), (colPos/4), 0);
+
+ } else if ( lineStr.charAt(colPos+2) != '.' &&
+ lineStr.charAt(colPos+2) != '|' &&
+ lineStr.charAt(colPos+2) != ' ' ) {
+ robots[0] = new Robot ( rowPos/2, colPos/4
+ , lineStr.charAt(colPos));
+ board.placeRobot( (rowPos/2), (colPos/4), 0);
+
} else if ( lineStr.charAt(colPos+1) == 'S' ||
lineStr.charAt(colPos+1) == 'T' ||
lineStr.charAt(colPos+1) == 'C' ||
- Previous message: [Commit] RRbot RicochetRecursive.java,1.6,1.7
- Next message: [Commit]
RRbot game1.gm,NONE,1.1 game2.gm,NONE,1.1 game3.gm,NONE,1.1
game4.gm,NONE,1.1 game5.gm,NONE,1.1 game6.gm,NONE,1.1
solutions.txt,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list