Mercurial > hg > early-roguelike
comparison arogue5/rogue.c @ 279:d3968e9cb98d
Use C stdio functions for score files and save files.
Switching from Unix file descriptor operations to C standard FILE*
functions will reduce portability problems.
author | John "Elwin" Edwards |
---|---|
date | Fri, 15 Sep 2017 19:57:54 -0400 |
parents | aac28331e71d |
children | 0250220d8cdd |
comparison
equal
deleted
inserted
replaced
278:c222f9d56776 | 279:d3968e9cb98d |
---|---|
62 int trap_tries = 0; | 62 int trap_tries = 0; |
63 int pray_time = 0; | 63 int pray_time = 0; |
64 int spell_power = 0; | 64 int spell_power = 0; |
65 int turns = 0; /* Number of turns player has taken */ | 65 int turns = 0; /* Number of turns player has taken */ |
66 int quest_item = 0; /* Item player is looking for */ | 66 int quest_item = 0; /* Item player is looking for */ |
67 int scorefd = -1; /* File descriptor for the scorefile */ | |
68 char nfloors = -1; /* Number of floors in this dungeon */ | 67 char nfloors = -1; /* Number of floors in this dungeon */ |
69 char curpurch[LINELEN*2]; /* name of item ready to buy */ | 68 char curpurch[LINELEN*2]; /* name of item ready to buy */ |
70 char PLAYER = VPLAYER; /* what the player looks like */ | 69 char PLAYER = VPLAYER; /* what the player looks like */ |
71 char take; /* Thing the rogue is taking */ | 70 char take; /* Thing the rogue is taking */ |
72 char prbuf[LINELEN*2]; /* Buffer for sprintfs */ | 71 char prbuf[LINELEN*2]; /* Buffer for sprintfs */ |
122 char *nothing = "Nothing seems to happen."; | 121 char *nothing = "Nothing seems to happen."; |
123 char *spacemsg = "--Press space to continue--"; | 122 char *spacemsg = "--Press space to continue--"; |
124 char *morestr = "-- More --"; | 123 char *morestr = "-- More --"; |
125 char *retstr = "[Press return to continue]"; | 124 char *retstr = "[Press return to continue]"; |
126 | 125 |
126 FILE *scoreboard = NULL; /* The scorefile */ | |
127 FILE *logfile = NULL; | 127 FILE *logfile = NULL; |
128 | 128 |
129 /* | 129 /* |
130 * NOTE: the ordering of the points in this array is critical. They MUST | 130 * NOTE: the ordering of the points in this array is critical. They MUST |
131 * be listed in the following sequence: | 131 * be listed in the following sequence: |