home · contact · privacy
Corrected comments.
[plomrogue] / roguelike.c
index c68e983705466eac6a3f920127070b3ca51486bb..3b92c11c6fa8efd35d0c19a9f669589c2f3e1e7c 100644 (file)
@@ -54,8 +54,8 @@ void write_uint32_bigendian(uint32_t x, FILE * file) {
   fputc(c, file);
   fputc(d, file); }
 
-void load_seed(struct World * world) {
-// Load seed integer from seed file.
+void load_game(struct World * world) {
+// Load game data from game file.
   FILE * file = fopen("savefile", "r");
   world->seed = read_uint32_bigendian(file);
   world->turn = read_uint32_bigendian(file);
@@ -65,8 +65,8 @@ void load_seed(struct World * world) {
   world->monster->x = read_uint16_bigendian(file);
   fclose(file); }
 
-void save_seed(struct World * world) {
-// Save seed integer to seed file.
+void save_game(struct World * world) {
+// Save game data to game file.
   FILE * file = fopen("savefile", "w");
   write_uint32_bigendian(world->seed, file);
   write_uint32_bigendian(world->turn, file);
@@ -225,7 +225,7 @@ int main (int argc, char *argv[]) {
   struct Monster monster;
   world.monster = &monster;
   if (0 == access("savefile", F_OK))
-    load_seed(&world);
+    load_game(&world);
   else {
     player.y = 8;
     player.x = 8;
@@ -256,7 +256,7 @@ int main (int argc, char *argv[]) {
   uint32_t last_turn = 0;
   while (1) {
     if (last_turn != world.turn) {
-      save_seed(&world);
+      save_game(&world);
       last_turn = world.turn; }
     draw_all_windows (&win_meta);
     key = getch();