Commit ccea5a17 authored by Jan Pokorný's avatar Jan Pokorný 💬
Browse files

generating games output

parent 5ef2571a
......@@ -5,7 +5,7 @@
#include <cassert>
struct GameGenerator{
GameGenerator() = default;
GameGenerator():gen(std::random_device()()){}
template <typename Game>
Game generate(const Game & game, int moves){
for(int i = 0; i < 10; ++i){
......
#include <iostream>
#include "Qubic.hpp"
#include "ConnectFour3D.hpp"
#include "GameGenerator.hpp"
#include <string>
using namespace std;
int main(int argc, char ** argv){
if(argc != 3){
cerr << "Run this program as ./program game nomber_of_moves" << endl;
return 0;
}
string game = string(argv[1]);
int k = atoi(argv[2]);
GameGenerator gg;
if(game == "qubic"){
cout << gg.generate(Qubic(), k) << endl;
} else if(game == "cf"){
cout << gg.generate(ConnectFour3D(), k) << endl;
} else{
cerr << "expected cf or qubic" << endl;
return 1;
}
return 0;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment