+/* $NetBSD: robots.h,v 1.14 1999/09/30 18:01:33 jsm Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)robots.h 5.6 (Berkeley) 2/28/91
+ * @(#)robots.h 8.1 (Berkeley) 5/31/93
*/
+# include <sys/ttydefaults.h>
+# include <ctype.h>
# include <curses.h>
+# include <err.h>
+# include <errno.h>
+# include <fcntl.h>
+# include <pwd.h>
# include <setjmp.h>
+# include <signal.h>
+# include <stdlib.h>
+# include <string.h>
+# include <termios.h>
+# include <unistd.h>
/*
* miscellaneous constants
# define MAXLEVELS 4
# define MAXROBOTS (MAXLEVELS * 10)
# define ROB_SCORE 10
+# undef S_BONUS
# define S_BONUS (60 * ROB_SCORE)
# define Y_SCORE 21
# define X_SCORE (X_FIELDSIZE + 9)
# define HEAP '*'
# define PLAYER '@'
-/*
- * pseudo functions
- */
-
-# undef CTRL
-# define CTRL(X) ((X) - 'A' + 1)
-
/*
* type definitions
*/
int y, x;
} COORD;
+typedef struct {
+ u_int32_t s_uid;
+ u_int32_t s_score;
+ u_int32_t s_auto;
+ u_int32_t s_level;
+ char s_name[MAXNAME];
+} SCORE;
+
+typedef struct passwd PASSWD;
+
/*
* global variables
*/
extern bool Dead, Full_clear, Jump, Newscore, Real_time, Running,
- Teleport, Waiting, Was_bonus;
+ Teleport, Waiting, Was_bonus, Auto_bot;
#ifdef FANCY
extern bool Pattern_roll, Stand_still;
#endif
-extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], *Next_move,
- *Move_list, Run_ch;
+extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], Run_ch;
+extern const char *Next_move, *Move_list;
-extern int Count, Level, Num_robots, Num_scores, Score,
- Start_level, Wait_bonus;
+extern int Count, Level, Num_robots, Num_scrap, Num_scores,
+ Start_level, Wait_bonus, Num_games;
-extern COORD Max, Min, My_pos, Robots[];
+extern u_int32_t Score;
+
+extern COORD Max, Min, My_pos, Robots[], Scrap[];
extern jmp_buf End_move;
* functions types
*/
-int cmp_sc();
-void move_robots();
-
-COORD *rnd_pos();
+void add_score __P((int));
+bool another __P((void));
+int cmp_sc __P((const void *, const void *));
+bool do_move __P((int, int));
+bool eaten __P((const COORD *));
+void flush_in __P((void));
+void get_move __P((void));
+void init_field __P((void));
+bool jumping __P((void));
+void make_level __P((void));
+void move_robots __P((int));
+bool must_telep __P((void));
+void play_level __P((void));
+int query __P((const char *));
+void quit __P((int)) __attribute__((__noreturn__));
+void reset_count __P((void));
+int rnd __P((int));
+COORD *rnd_pos __P((void));
+void score __P((int));
+void set_name __P((SCORE *));
+void show_score __P((void));
+int sign __P((int));
+char automove __P((void));