diff options
author | christos <christos@NetBSD.org> | 2004-08-27 09:06:25 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2004-08-27 09:06:25 +0000 |
commit | 4698258a557ea1c0e01df75c4d82ad92d38068d4 (patch) | |
tree | a08e967308f9048f8bea69bb284fb46d24973a5a /robots | |
parent | cfafd82dacc60a18883e931c36c7c25fab714c8f (diff) | |
download | bsdgames-darwin-4698258a557ea1c0e01df75c4d82ad92d38068d4.tar.gz bsdgames-darwin-4698258a557ea1c0e01df75c4d82ad92d38068d4.tar.zst bsdgames-darwin-4698258a557ea1c0e01df75c4d82ad92d38068d4.zip |
describe the algorithm better.
Diffstat (limited to 'robots')
-rw-r--r-- | robots/auto.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/robots/auto.c b/robots/auto.c index c2babc45..ff80ba0d 100644 --- a/robots/auto.c +++ b/robots/auto.c @@ -1,4 +1,4 @@ -/* $NetBSD: auto.c,v 1.6 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: auto.c,v 1.7 2004/08/27 09:06:25 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -42,17 +42,15 @@ * Algo : * IF scrapheaps don't exist THEN * IF not in danger THEN - * stay at current position; - * ELSE move away from the closest robot; + * stay at current position + * ELSE + * move away from the closest robot * FI * ELSE - * find closest heap; - * find closest robot; - * IF scrapheap is adjacenHEN - * move behind the scrapheap - * ELSE - * move away from the closest robot - * FI + * find closest heap + * find closest robot + * IF scrapheap is adjacent THEN + * move behind the scrapheap * ELSE * take the move that takes you away from the * robots and closest to the heap |