clean up display
authorbdemsky <bdemsky>
Thu, 24 May 2007 18:08:17 +0000 (18:08 +0000)
committerbdemsky <bdemsky>
Thu, 24 May 2007 18:08:17 +0000 (18:08 +0000)
do string processing correctly

Robust/src/Benchmarks/TTTTag/TTTServerSocket.java

index 684269d308820792a3a7fd2fedec9b271f17501c..4d6b885272a5eb7312c099c5f34e161e56df584b 100644 (file)
@@ -42,7 +42,7 @@ public class TTTServerSocket {
                        //Get col
                        String s2 = new String(s.subString(i1+2));
                        int i2 = s2.indexOf(':');
-                       String colStr = new String(s.subString(i2+1, i2+2));
+                       String colStr = new String(s2.subString(i2+1, i2+2));
                        col = Integer.parseInt(colStr);
                        return 1;
                        
@@ -59,8 +59,8 @@ public class TTTServerSocket {
        }
        
        public void sendBoardDisplay(Board theBoard, Socket s) {
-               StringBuffer line1 = new String ("display_");
-
+               StringBuffer line1 = new StringBuffer("\n\n");
+               
                for (int i = 0; i < 3; i++) {
                        for (int j = 0; j < 3; j++) {
                                if (theBoard.board[i][j] == 1)
@@ -70,7 +70,7 @@ public class TTTServerSocket {
                                else
                                        line1.append("-");
                        }
-                       line1.append("_");
+                       line1.append("\n");
                }
                String towrite = new String(line1);
                s.write(towrite.getBytes());