[Commit] rrserver protocol,1.12,1.13 show.5c,1.2,1.3

Carl Worth commit@keithp.com
Thu, 29 May 2003 05:12:59 -0700


Committed by: cworth

Update of /local/src/CVS/rrserver
In directory home.keithp.com:/tmp/cvs-serv19784

Modified Files:
	protocol show.5c 
Log Message:
Shrink board representation vertically

Index: protocol
===================================================================
RCS file: /local/src/CVS/rrserver/protocol,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- protocol	29 May 2003 08:32:19 -0000	1.12
+++ protocol	29 May 2003 12:12:57 -0000	1.13
@@ -114,16 +114,15 @@
 	diagram of the game contents, (an array of cells). A single
 	cell and its surrounding are indicated as:
 
-	 HH 
-	VcsV
-	VrrV
-	 HH
+	 HHH 
+	VrcsV
+	 HHH
 
 	H = ' ' or '='
 	V = ' ' or '|'
+	r = '.' or <robot-color>  (one of 'r', 'g', 'b', or 'y')
 	c = '.' or <target-color> (one of 'r', 'g', 'b', or 'y')
 	s = '.' or <target-shape> (one of 'c', 's', 'o', or 't')
-	r = '.' or <robot-color>  (one of 'r', 'g', 'b', or 'y')
 
 	The goal robot and target (color and shape) are indicated with
 	capital letters.
@@ -131,18 +130,16 @@
 	For example:
 
 	SHOW "
-	 ==
-	|.. .. gs
-	|RR .. ..
+	 ===
+	|R.. ... .gs
 	
-	 ..|.. RT|
-	 gg|.. ..|
-	 ==    =="
+	 byc|... .RT|
+	 ===    ==="
 
-	RR = 	Red robot (goal robot)
-	gs = 	Green square (non-goal target)
-	gg = 	Green robot (non-goal target)
-	RT =	Red triangle (goal target)
+	R.. = 	Red robot (goal robot)
+	.gs = 	Green square target
+	byc = 	Blue robot on yellow circle target
+	.RT =	Red triangle (goal target)
 
 	Possible errors: NOTINGAME
 
@@ -181,6 +178,8 @@
 
 	Possible errors: NOTINGAME, NOTACTIVE
 
+	XXX: Do we add another error code for no further undo?
+
 1.13. Reset
 
 	RESET
@@ -386,4 +385,9 @@
 solutions, failed attempts, etc. Shall we provide a way for the ACTIVE
 user to pass control to another, (only when a turn is over)? Or maybe
 since the turn is over we just let any user move the pieces?
+
+--
+
+We should add PART and UNWATCH commands to leave the current game,
+(while still staying connected to perhaps join other games).
 

Index: show.5c
===================================================================
RCS file: /local/src/CVS/rrserver/show.5c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- show.5c	29 May 2003 08:15:44 -0000	1.2
+++ show.5c	29 May 2003 12:12:57 -0000	1.3
@@ -28,9 +28,9 @@
     public namespace Show {
 	void show_first_object (file f, &Object o) {
 	    if (o.walls.above)
-		File::fprintf (f, " ==");
+		File::fprintf (f, " ===");
 	    else
-		File::fprintf (f, "   ");
+		File::fprintf (f, "    ");
 	}
 	
 	void show_color (file f, Color c, bool active) {
@@ -68,20 +68,12 @@
 		File::fprintf (f, " ");
 	    union switch (o.robot) {
 	    case none:
-		File::fprintf (f, "..");
+		File::fprintf (f, ".");
 		break;
 	    case robot r:
 		show_color (f, r.color, r.active);
-		show_color (f, r.color, r.active);
 		break;
 	    }
-	}
-	
-	void show_third_object (file f, &Object o) {
-	    if (o.walls.left)
-		File::fprintf (f, "|");
-	    else
-		File::fprintf (f, " ");
 	    union switch (o.target) {
 	    case none:
 		File::fprintf (f, "..");
@@ -92,7 +84,7 @@
 		break;
 	    }
 	}
-
+	
 	void show_last_col (file f, &Object o) {
 	    if (o.walls.right)
 		File::fprintf (f, "|");
@@ -111,23 +103,17 @@
 		show_second_object (f, &b[col,row]);
 	    show_last_col (f, &b[Width-1,row]);
 	}
-	void show_third_row (file f, &Board b, int row) {
-	    for (int col = 0; col < Width; col++)
-		show_third_object (f, &b[col,row]);
-	    show_last_col (f, &b[Width-1,row]);
-	}
 	void show_row (file f, &Board b, int row) {
 	    show_first_row (f, &b, row);
 	    show_second_row (f, &b, row);
-	    show_third_row (f, &b, row);
 	}
 	void show_last_row (file f, &Board b) {
 	    for (int col = 0; col < Width; col++)
 	    {
 		if (b[col,Height-1].walls.below)
-		    File::fprintf (f, " ==");
+		    File::fprintf (f, " ===");
 		else
-		    File::fprintf (f, "   ");
+		    File::fprintf (f, "    ");
 	    }
 	}