* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)move_robs.c 5.1 (Berkeley) 5/30/85";
signal(SIGALRM
, move_robots
);
for (rp
= Robots
; rp
< &Robots
[MAXROBOTS
]; rp
++) {
mvaddch(rp
->y
, rp
->x
, ' ');
rp
->y
+= sign(My_pos
.y
- rp
->y
);
rp
->x
+= sign(My_pos
.x
- rp
->x
);
else if (rp
->y
>= Y_FIELDSIZE
)
else if (rp
->x
>= X_FIELDSIZE
)
for (rp
= Robots
; rp
< &Robots
[MAXROBOTS
]; rp
++)
else if (rp
->y
== My_pos
.y
&& rp
->x
== My_pos
.x
)
else if (Field
[rp
->y
][rp
->x
] > 1) {
mvaddch(rp
->y
, rp
->x
, HEAP
);
mvaddch(rp
->y
, rp
->x
, ROBOT
);
if (Dead
|| Num_robots
<= 0)
* Add a score to the overall point total
* Return the sign of the number