mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
30 lines
461 B
C++
30 lines
461 B
C++
#include <cstdlib>
|
|
#include <ctime>
|
|
#include <iostream>
|
|
|
|
#include "agent.h"
|
|
#include "map.h"
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
class map map(40, 20);
|
|
|
|
srandom(time(NULL));
|
|
|
|
class tile &agentpos = map.tile_at(random() % map.w, random() % map.h);
|
|
class agent agent(0, agentpos);
|
|
|
|
map.print_map();
|
|
std::cout << '\n';
|
|
|
|
agent.move_dir(1, 0);
|
|
map.print_map();
|
|
std::cout << '\n';
|
|
|
|
agent.move_dir(0, -1);
|
|
map.print_map();
|
|
std::cout << '\n';
|
|
|
|
return 0;
|
|
}
|