]> git.wh0rd.org - ICEs.git/blobdiff - 321325/lgc_pg-scenarios.pre.i.1
more
[ICEs.git] / 321325 / lgc_pg-scenarios.pre.i.1
diff --git a/321325/lgc_pg-scenarios.pre.i.1 b/321325/lgc_pg-scenarios.pre.i.1
new file mode 100644 (file)
index 0000000..81c72fd
--- /dev/null
@@ -0,0 +1,28 @@
+void scen_create_random_weather(void * dest_file, void * scen_file, int month,
+                               int turns)
+{
+       float month_mod[13] = {
+               0, 8, 12, 18
+       };
+       int i;
+       int result;
+       int init_cond = 0;
+       int region = 0;
+       int weather[turns];
+       weather[0] = (init_cond == 1) ? 0 : 2;
+       if (month < 3 || month == 12) {
+               for (i = 0; i < turns; i++)
+                       if (weather[i] == 2)
+                               weather[i]++;
+       }
+       fprintf(dest_file, "weather»");
+       i = 0;
+       while (i < turns) {
+               fprintf(dest_file, "%s",
+                       weather[i] == 0 ? "fair" : weather[i] ==
+                       1 ? "clouds" : weather[i] == 2 ? "rain" : "snow");
+               if (i < turns - 1)
+                       fprintf(dest_file, "°");
+               i++;
+       }
+}