X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=321325%2Flgc_pg-scenarios.pre.i;fp=321325%2Flgc_pg-scenarios.pre.i;h=3c9ba0b74ef8e53c47632d0fd15fdf1f0ce9dbd3;hp=0000000000000000000000000000000000000000;hb=bd3239d2bbe0de3a200b266503e3330b1e391489;hpb=dbff64cb4b7530861c2309c794efdd4e0cf47a23 diff --git a/321325/lgc_pg-scenarios.pre.i b/321325/lgc_pg-scenarios.pre.i new file mode 100644 index 0000000..3c9ba0b --- /dev/null +++ b/321325/lgc_pg-scenarios.pre.i @@ -0,0 +1,23 @@ +void scen_create_random_weather(void *dest_file, void *scen_file, int month, + int turns) +{ + int i; + int init_cond = 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++; + } +}