+void next_turn (struct World * world) {
+// Increment turn and move enemy.
+ world->turn++;
+ char d = rand() % 5;
+ char ty = world->monster->y;
+ char tx = world->monster->x;
+ if (1 == d)
+ ty++;
+ else if (2 == d)
+ ty--;
+ else if (3 == d)
+ tx++;
+ else if (4 == d)
+ tx--;
+ if (tx == world->player->x && ty == world->player->y)
+ update_log(world, "\nThe monster hits you.");
+ else if (is_passable(world, tx, ty)) {
+ world->monster->y = ty;
+ world->monster->x = tx; } }