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