-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (32 loc) · 1.21 KB
/
main.cpp
File metadata and controls
41 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "GameFactory.h"
#include "Game.h"
#include "Misc.h"
#include "CLI/App.hpp"
#include "CLI/Formatter.hpp"
#include "CLI/Config.hpp"
#include <iostream>
int main(int argc, char **argv)
{
CLI::App app{"CHAGAPY - A Chaos Game Implementation"};
std::string rule_name = "default";
int num_vertices = 3;
double jump_size = 0.5f;
unsigned int num_rounds = 100000;
std::string out_file = "test.csv";
app.add_option("-g,--game", rule_name, "Rules for the game.");
app.add_option("-r,--rounds", num_rounds, "Number of rounds to play");
app.add_option("-v,--vertices", num_vertices, "Number of vertices for polygon base.");
app.add_option("-j,--jump-size", jump_size, "Jump size factor.");
app.add_option("-o,--out", out_file, "Output file");
CLI11_PARSE(app, argc, argv);
print_welcome(rule_name, num_vertices, jump_size, num_rounds, out_file);
GameFactory factory;
Game game = factory.create(num_rounds, rule_name, num_vertices, jump_size);
std::cout << " Running game...";
game.run();
std::cout << "DONE!" << std::endl;
std::cout << " Exporting results...";
export_csv(out_file, game);
std::cout << "DONE!" << std::endl;
print_string("");
}