]> git.wh0rd.org Git - ICEs.git/blob - 321325/lgc_pg-scenarios.pre.i.1
more
[ICEs.git] / 321325 / lgc_pg-scenarios.pre.i.1
1 void scen_create_random_weather(void * dest_file, void * scen_file, int month,
2                                 int turns)
3 {
4         float month_mod[13] = {
5                 0, 8, 12, 18
6         };
7         int i;
8         int result;
9         int init_cond = 0;
10         int region = 0;
11         int weather[turns];
12         weather[0] = (init_cond == 1) ? 0 : 2;
13         if (month < 3 || month == 12) {
14                 for (i = 0; i < turns; i++)
15                         if (weather[i] == 2)
16                                 weather[i]++;
17         }
18         fprintf(dest_file, "weather»");
19         i = 0;
20         while (i < turns) {
21                 fprintf(dest_file, "%s",
22                         weather[i] == 0 ? "fair" : weather[i] ==
23                         1 ? "clouds" : weather[i] == 2 ? "rain" : "snow");
24                 if (i < turns - 1)
25                         fprintf(dest_file, "°");
26                 i++;
27         }
28 }