|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <kos.h>#include <conio/conio.h>Macros | |
| #define | fprintf(a, fmt, args...) |
| #define | printf(fmt, args...) |
| #define | fgets(buf, len, a) |
| #define | fflush(a) |
| #define | MAX_ARROW_SHOT_DISTANCE 6 /* +1 for '0' stopper */ |
| #define | MAX_LINKS_IN_ROOM 25 /* a complex cave */ |
| #define | MAX_ROOMS_IN_CAVE 250 |
| #define | ROOMS_IN_CAVE 20 |
| #define | MIN_ROOMS_IN_CAVE 10 |
| #define | LINKS_IN_ROOM 3 |
| #define | NUMBER_OF_ARROWS 5 |
| #define | PIT_COUNT 3 |
| #define | BAT_COUNT 3 |
| #define | EASY 1 /* levels of play */ |
| #define | HARD 2 |
| #define | plural(n) |
Functions | |
| void | blagh () |
| long | random () |
| int | bats_nearby (void) |
| void | cave_init (void) |
| void | clear_things_in_cave (void) |
| void display_room_stats | __P ((void)) |
| int getans | __P ((const char *prompt)) |
| void | initialize_things_in_cave (void) |
| void | instructions (void) |
| int int_compare | __P ((const void *va, const void *vb)) |
| void | jump (int where) |
| void | kill_wump (void) |
| int move_to | __P ((char *room_number)) |
| void | move_wump (void) |
| void | no_arrows (void) |
| void | pit_kill (void) |
| int | pit_nearby (void) |
| void | pit_survive (void) |
| int shoot | __P ((char *room_list)) |
| void | shoot_self (void) |
| int | take_action (void) |
| void | usage (void) |
| void | wump_kill (void) |
| int | wump_nearby (void) |
| int | main (int argc, char **argv) |
| void | display_room_stats () |
| int | move_to (char *room_number) |
| int | shoot (char *room_list) |
| int | getans (char *prompt) const |
| int | int_compare (void *va, void *vb) const |
Variables | |
| static const char | copyright [] |
| static const char | rcsid [] |
| struct room_record | cave [MAX_ROOMS_IN_CAVE+1] |
| int | player_loc = -1 |
| int | wumpus_loc = -1 |
| int | level = EASY |
| int | arrows_left |
| int | pit_num = PIT_COUNT |
| int | bat_num = BAT_COUNT |
| int | room_num = ROOMS_IN_CAVE |
| int | link_num = LINKS_IN_ROOM |
| int | arrow_num = NUMBER_OF_ARROWS |
| char | answer [20] |
| #define BAT_COUNT 3 |
| #define EASY 1 /* levels of play */ |
Referenced by shoot().
| #define fflush | ( | a | ) |
| #define fgets | ( | buf, | |
| len, | |||
| a ) |
| #define fprintf | ( | a, | |
| fmt, | |||
| args... ) |
| #define HARD 2 |
Referenced by initialize_things_in_cave(), and main().
| #define LINKS_IN_ROOM 3 |
| #define MAX_ARROW_SHOT_DISTANCE 6 /* +1 for '0' stopper */ |
| #define MAX_ROOMS_IN_CAVE 250 |
Referenced by main().
| #define MIN_ROOMS_IN_CAVE 10 |
Referenced by main().
| #define NUMBER_OF_ARROWS 5 |
| #define PIT_COUNT 3 |
| #define plural | ( | n | ) |
Referenced by display_room_stats(), and main().
| #define printf | ( | fmt, | |
| args... ) |
Referenced by cave_init(), display_room_stats(), getans(), initialize_things_in_cave(), instructions(), jump(), kill_wump(), main(), move_to(), no_arrows(), pit_kill(), pit_survive(), shoot(), shoot_self(), take_action(), and wump_kill().
| #define ROOMS_IN_CAVE 20 |
| int shoot __P | ( | (char *room_list) | ) |
| int move_to __P | ( | (char *room_number) | ) |
| int getans __P | ( | (const char *prompt) | ) |
| int int_compare __P | ( | (const void *va, const void *vb) | ) |
| void display_room_stats __P | ( | (void) | ) |
| int bats_nearby | ( | void | ) |
References cave, link_num, and player_loc.
Referenced by display_room_stats().
| void blagh | ( | ) |
| void cave_init | ( | void | ) |
| void display_room_stats | ( | ) |
References arrows_left, bats_nearby(), cave, link_num, pit_nearby(), player_loc, plural, printf, room_num, and wump_nearby().
Referenced by main().
| int getans | ( | char * | prompt | ) | const |
References fflush, fgets, and printf.
Referenced by instructions(), and main().
| void initialize_things_in_cave | ( | void | ) |
References bat_num, cave, HARD, level, link_num, loc, pit_num, player_loc, printf, random(), room_num, wump_nearby(), and wumpus_loc.
Referenced by main().
| int int_compare | ( | void * | va, |
| void * | vb ) const |
Referenced by cave_init().
| int main | ( | int | argc, |
| char ** | argv ) |
References answer, arrow_num, arrows_left, bat_num, cave_init(), clear_things_in_cave(), cont_btn_callback(), CONT_START, display_room_stats(), fflush, fgets, fprintf, getans(), HARD, initialize_things_in_cave(), instructions(), level, link_num, MAX_LINKS_IN_ROOM, MAX_ROOMS_IN_CAVE, MIN_ROOMS_IN_CAVE, pit_num, plural, printf, pvr_init_defaults(), random(), room_num, take_action(), and usage().
| int move_to | ( | char * | room_number | ) |
References answer, cave, fflush, fgets, jump(), link_num, move_wump(), pit_kill(), pit_survive(), player_loc, printf, random(), room_num, wump_kill(), and wumpus_loc.
Referenced by take_action().
| void move_wump | ( | void | ) |
| int pit_nearby | ( | void | ) |
References cave, link_num, and player_loc.
Referenced by display_room_stats().
| long random | ( | ) |
Referenced by cave_init(), initialize_things_in_cave(), main(), move_to(), move_wump(), shoot(), and take_action().
| int shoot | ( | char * | room_list | ) |
References arrows_left, cave, EASY, kill_wump(), level, link_num, move_wump(), next(), no_arrows(), NULL, player_loc, printf, random(), room_num, shoot_self(), wump_kill(), and wumpus_loc.
Referenced by take_action().
| int take_action | ( | void | ) |
| int wump_nearby | ( | void | ) |
References cave, link_num, player_loc, and wumpus_loc.
Referenced by display_room_stats(), and initialize_things_in_cave().
| char answer[20] |
Referenced by main(), move_to(), and take_action().
| int arrow_num = NUMBER_OF_ARROWS |
Referenced by main().
| int arrows_left |
Referenced by display_room_stats(), main(), and shoot().
| int bat_num = BAT_COUNT |
Referenced by initialize_things_in_cave(), and main().
| struct room_record cave[MAX_ROOMS_IN_CAVE + 1] |
Referenced by bats_nearby(), cave_init(), clear_things_in_cave(), display_room_stats(), initialize_things_in_cave(), move_to(), move_wump(), pit_nearby(), shoot(), and wump_nearby().
|
static |
| int level = EASY |
Referenced by initialize_things_in_cave(), main(), and shoot().
| int link_num = LINKS_IN_ROOM |
Referenced by bats_nearby(), cave_init(), display_room_stats(), initialize_things_in_cave(), main(), move_to(), move_wump(), pit_nearby(), shoot(), and wump_nearby().
| int pit_num = PIT_COUNT |
Referenced by initialize_things_in_cave(), and main().
| int player_loc = -1 |
Referenced by bats_nearby(), display_room_stats(), initialize_things_in_cave(), move_to(), pit_nearby(), shoot(), and wump_nearby().
|
static |
| int room_num = ROOMS_IN_CAVE |
Referenced by cave_init(), clear_things_in_cave(), display_room_stats(), initialize_things_in_cave(), main(), move_to(), and shoot().
| int wumpus_loc = -1 |
Referenced by initialize_things_in_cave(), move_to(), move_wump(), shoot(), and wump_nearby().