home · contact · privacy
Always load seed file if it exists. Don't provide a default one.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 29 May 2013 02:28:29 +0000 (04:28 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 29 May 2013 02:28:29 +0000 (04:28 +0200)
roguelike.c
seed [deleted file]

index 7caaec9dd194a2d6219909a1856766e04c749950..cba46ad44675453f749cf51d4a5f6acad68405fe 100644 (file)
@@ -187,15 +187,11 @@ void player_wait (struct World * world) {
   update_log (world, "\nYou wait."); }
 
 int main (int argc, char *argv[]) {
-  uint32_t seed = time(NULL);
-  int opt;
-  while ((opt = getopt(argc, argv, "l")) != -1) {
-    switch (opt) {
-      case 'l':
-       seed = load_seed();
-        break;
-      default:
-        exit(EXIT_FAILURE); } }
+  uint32_t seed;
+  if (0 == access("seed", F_OK))
+    seed = load_seed();
+  else
+    seed = time(NULL);
   rrand(1, seed);
 
   struct World world;
diff --git a/seed b/seed
deleted file mode 100644 (file)
index 717e474..0000000
--- a/seed
+++ /dev/null
@@ -1 +0,0 @@
-Q¤'\13
\ No newline at end of file