[Commit] 
	librr/src rr.h,1.7,1.8 rr_board.c,1.7,1.8 rr_client.c,1.4,1.5
    Keith Packard 
    commit at keithp.com
       
    Thu Jun 12 15:25:13 PDT 2003
    
        - Previous message: [Commit] 
	librr/src Makefile.am,1.3,1.4 rr.h,1.6,1.7 rr_client.c,1.3,1.4
 
        - Next message: [Commit] 
	RRbot Board.java,1.1.1.1,1.2 Col.java,1.1.1.1,1.2 Node.java,1.2,1.3
	RicochetRecursive.java,1.8,1.9 Robot.java,1.1.1.1,1.2
	Row.java,1.1.1.1,1.2 SolutionChecker.java,1.1,1.2
	TranspositionTable.java,1.1.1.1,1.2
 
         -  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
 
       
    
  
Committed by: keithp
Update of /local/src/CVS/librr/src
In directory evo:/local/src/librr/src
Modified Files:
	rr.h rr_board.c rr_client.c 
Log Message:
Add rr_board_position
Index: rr.h
===================================================================
RCS file: /local/src/CVS/librr/src/rr.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rr.h	12 Jun 2003 18:00:56 -0000	1.7
+++ rr.h	12 Jun 2003 19:25:10 -0000	1.8
@@ -289,12 +289,16 @@
 rr_status_t
 rr_board_move (rr_board_t *board, rr_robot_t robot, rr_direction_t dir);
 
-/* Possible errors: RR_STATUS_NOY_FOUND */
+/* Possible errors: RR_STATUS_NOT_FOUND */
 rr_status_t
 rr_board_undo (rr_board_t *board);
 
 rr_status_t
 rr_board_reset (rr_board_t *board);
+
+/* rr_board_position: Reposition a robot */
+rr_status_t
+rr_board_position (rr_board_t *board, rr_robot_t robot, int x, int y);
 
 /* rr_board_to_str:  Return a string containing a diagram of the board.
    
Index: rr_board.c
===================================================================
RCS file: /local/src/CVS/librr/src/rr_board.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rr_board.c	12 Jun 2003 07:09:09 -0000	1.7
+++ rr_board.c	12 Jun 2003 19:25:10 -0000	1.8
@@ -384,6 +384,23 @@
     }
 }
 
+rr_status_t
+rr_board_position (rr_board_t *board, rr_robot_t robot, int x, int y)
+{
+    rr_status_t	status;
+    rr_cell_t	*ocell, *cell;
+    int		ox, oy;
+
+    status = rr_board_find_robot (board, robot, &ox, &oy);
+    if (status != RR_STATUS_SUCCESS)
+	return status;
+    ocell = _rr_board_get_cell_ptr (board, ox, oy);
+    cell = _rr_board_get_cell_ptr (board, x, y);
+    RR_CELL_REMOVE_ROBOT (*ocell);
+    RR_CELL_ADD_ROBOT (*cell, robot);
+    return RR_STATUS_SUCCESS;
+}
+		    
 static rr_status_t
 _rr_board_get_robot_char (rr_board_t *board, rr_cell_t cell,
 			  char *r)
Index: rr_client.c
===================================================================
RCS file: /local/src/CVS/librr/src/rr_client.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rr_client.c	12 Jun 2003 18:00:56 -0000	1.4
+++ rr_client.c	12 Jun 2003 19:25:10 -0000	1.5
@@ -123,6 +123,8 @@
 {
     rr_status_t status;
 
+    client->ptr = client->end = 0;
+    client->notice_queue = 0;
     status = _rr_client_connect (client, host, port);
     if (status)
 	return status;
    
    
        
	- Previous message: [Commit] 
	librr/src Makefile.am,1.3,1.4 rr.h,1.6,1.7 rr_client.c,1.3,1.4
 
	- Next message: [Commit] 
	RRbot Board.java,1.1.1.1,1.2 Col.java,1.1.1.1,1.2 Node.java,1.2,1.3
	RicochetRecursive.java,1.8,1.9 Robot.java,1.1.1.1,1.2
	Row.java,1.1.1.1,1.2 SolutionChecker.java,1.1,1.2
	TranspositionTable.java,1.1.1.1,1.2
 
         -  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
 
       
More information about the Commit
mailing list