]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - robots/robots.h
1 /* $NetBSD: robots.h,v 1.18 2004/01/27 20:30:30 jsm Exp $ */
4 * Copyright (c) 1980, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)robots.h 8.1 (Berkeley) 5/31/93
34 # include <sys/ttydefaults.h>
35 # include <sys/endian.h>
50 * miscellaneous constants
53 # define Y_FIELDSIZE 23
54 # define X_FIELDSIZE 60
58 # define MAXROBOTS (MAXLEVELS * 10)
61 # define S_BONUS (60 * ROB_SCORE)
63 # define X_SCORE (X_FIELDSIZE + 9)
64 # define Y_PROMPT (Y_FIELDSIZE - 1)
65 # define X_PROMPT (X_FIELDSIZE + 2)
66 # define MAXSCORES (Y_SIZE - 2)
68 # define MS_NAME "Ten"
71 * characters on screen
94 typedef struct passwd PASSWD
;
100 extern bool Dead
, Full_clear
, Jump
, Newscore
, Real_time
, Running
,
101 Teleport
, Waiting
, Was_bonus
, Auto_bot
;
104 extern bool Pattern_roll
, Stand_still
;
107 extern char Cnt_move
, Field
[Y_FIELDSIZE
][X_FIELDSIZE
], Run_ch
;
108 extern const char *Next_move
, *Move_list
;
110 extern int Count
, Level
, Num_robots
, Num_scrap
, Num_scores
,
111 Start_level
, Wait_bonus
, Num_games
;
113 extern u_int32_t Score
;
115 extern COORD Max
, Min
, My_pos
, Robots
[], Scrap
[];
117 extern jmp_buf End_move
;
126 int cmp_sc(const void *, const void *);
127 bool do_move(int, int);
128 bool eaten(const COORD
*);
131 void init_field(void);
133 void make_level(void);
134 void move_robots(int);
135 bool must_telep(void);
136 void play_level(void);
137 int query(const char *);
138 void quit(int) __attribute__((__noreturn__
));
139 void reset_count(void);
141 COORD
*rnd_pos(void);
143 void set_name(SCORE
*);
144 void show_score(void);