-void next_turn (struct World * world) {
-// Increment turn and move enemy.
- world->turn++;
- rrand(1, world->seed * world->turn);
- struct Monster * monster;
- for (monster = world->monster; monster != 0; monster = monster->next)
- move_monster(world, monster); }
-
-void update_log (struct World * world, char * text) {
-// Update log with new text to be appended.
- char * new_text;
- uint16_t len_old = strlen(world->log);
- uint16_t len_new = strlen(text);
- uint16_t len_whole = len_old + len_new + 1;
- new_text = calloc(len_whole, sizeof(char));
- memcpy(new_text, world->log, len_old);
- memcpy(new_text + len_old, text, len_new);
- free(world->log);
- world->log = new_text; }
-