summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Judson Rosen2017-03-27 00:54:46 -0400
committerJoshua Judson Rosen2017-03-28 22:07:28 -0400
commitfbb46d9246019efe6a438971b3ed80a18da7791d (patch)
tree2d7a3069fc49ab7b7cfcca4f0e09d06056e425b3
parentUI: don't hide counters at startup (diff)
downloadgnurobots-fbb46d9246019efe6a438971b3ed80a18da7791d.tar.gz
Consistently specify directions symbolically
-rw-r--r--src/grobot.c8
-rw-r--r--src/main.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/grobot.c b/src/grobot.c
index e9dadc2..04eabe3 100644
--- a/src/grobot.c
+++ b/src/grobot.c
@@ -582,19 +582,19 @@ gboolean g_robot_look(GRobot *robot, gchar *str)
/* determine changes to x,y */
switch (robot->dir)
{
- case 0: /* N */
+ case NORTH:
dx = 0;
dy = -1;
break;
- case 1: /* E */
+ case EAST:
dx = 1;
dy = 0;
break;
- case 2: /* S */
+ case SOUTH:
dx = 0;
dy = 1;
break;
- case 3: /* W */
+ case WEST:
dx = -1;
dy = 0;
break;
diff --git a/src/main.c b/src/main.c
index 4bac374..8710ca1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -86,7 +86,7 @@ gint main(gint argc, gchar *argv[])
/* Check command line */
/* Create a robot Object */
- robot = g_robot_new(1, 1, 1, 0, DEFAULT_ENERGY, DEFAULT_SHIELDS, 0, 0,
+ robot = g_robot_new(1, 1, EAST, 0, DEFAULT_ENERGY, DEFAULT_SHIELDS, 0, 0,
NULL, NULL);
g_assert(robot != NULL);