annotate growth.c @ 17:5e6c9260913a

lots of cleanups and small fixes
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:14:38 +0200
parents 8db6497d6065
children 5937504619f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
1 #include <stdio.h>
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
2 #include <stdlib.h>
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
3 #include "db.h"
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
4 #include "game.h"
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
5
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
6
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
7 void grow_plants() {
17
5e6c9260913a lots of cleanups and small fixes
meillo@marmaro.de
parents: 12
diff changeset
8 sprintf(query,
5e6c9260913a lots of cleanups and small fixes
meillo@marmaro.de
parents: 12
diff changeset
9 "update field "
5e6c9260913a lots of cleanups and small fixes
meillo@marmaro.de
parents: 12
diff changeset
10 "set age = age+1, size = size+1 "
5e6c9260913a lots of cleanups and small fixes
meillo@marmaro.de
parents: 12
diff changeset
11 );
12
8db6497d6065 merged everything to only one program
meillo@marmaro.de
parents: 11
diff changeset
12 if (!db_update(query)) {
17
5e6c9260913a lots of cleanups and small fixes
meillo@marmaro.de
parents: 12
diff changeset
13 db_error("grow plants");
7
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
14 }
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
15 }
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
16
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
17
12
8db6497d6065 merged everything to only one program
meillo@marmaro.de
parents: 11
diff changeset
18 void growth(void) {
7
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
19 grow_plants();
b1e309dc0b98 added growth module (quite static and limited implementation)
meillo@marmaro.de
parents:
diff changeset
20 }