X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/462fca95471224f85b85be911e72faee16cd1597..5395af2c00ffe8b4a251932ea65bec2b4b185d8c:/robots/robots.h?ds=sidebyside diff --git a/robots/robots.h b/robots/robots.h index 96e9313f..edd37a92 100644 --- a/robots/robots.h +++ b/robots/robots.h @@ -1,6 +1,8 @@ +/* $NetBSD: robots.h,v 1.15 2002/01/31 17:35:52 christos 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 @@ -30,12 +32,22 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)robots.h 5.6 (Berkeley) 2/28/91 - * $Id: robots.h,v 1.3 1993/08/01 18:52:51 mycroft Exp $ + * @(#)robots.h 8.1 (Berkeley) 5/31/93 */ +# include +# include # include +# include +# include +# include +# include # include +# include +# include +# include +# include +# include /* * miscellaneous constants @@ -48,6 +60,7 @@ # 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) @@ -65,13 +78,6 @@ # define HEAP '*' # define PLAYER '@' -/* - * pseudo functions - */ - -# undef CTRL -# define CTRL(X) ((X) - 'A' + 1) - /* * type definitions */ @@ -80,24 +86,36 @@ typedef struct { 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; @@ -105,7 +123,27 @@ 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)); +char automove __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)); +void telmsg __P((int));