garten

annotate growth.c @ 12:8db6497d6065

merged everything to only one program
author meillo@marmaro.de
date Wed, 23 Jul 2008 15:19:45 +0200
parents 176ee28e7464
children 5e6c9260913a
rev   line source
meillo@7 1 #include <stdio.h>
meillo@7 2 #include <stdlib.h>
meillo@7 3 #include "db.h"
meillo@7 4 #include "game.h"
meillo@7 5
meillo@7 6
meillo@7 7 void grow_plants() {
meillo@7 8 /* get weather and last environments to calculate the next one */
meillo@12 9 sprintf(query, "update field \
meillo@12 10 set age = age+1, size = size+1 ");
meillo@12 11 stmt = db_query(query);
meillo@12 12 if (!db_update(query)) {
meillo@12 13 printf("E: update failed ++ %s\n", sqlite3_errmsg(db));
meillo@7 14 }
meillo@11 15 sqlite3_finalize(stmt);
meillo@7 16 }
meillo@7 17
meillo@7 18
meillo@12 19 void growth(void) {
meillo@7 20 grow_plants();
meillo@7 21 }