From 125d0a416e8547fd6736038b4d8551a0ebd5c4af Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 26 Nov 2011 21:47:31 +0100 Subject: [PATCH] Spawn agent at random position --- main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cc b/main.cc index 12f6ddd..0673c3f 100644 --- a/main.cc +++ b/main.cc @@ -1,3 +1,5 @@ +#include +#include #include #include "agent.h" @@ -8,7 +10,9 @@ main(int argc, char *argv[]) { class map map(10, 10); - class tile &agentpos = map.tile_at(4, 4); + srandom(time(NULL)); + + class tile &agentpos = map.tile_at(random() % map.w, random() % map.h); class agent agent(0, agentpos); map.print_map();