logik/main.cpp
2024-11-02 16:22:05 +01:00

41 lines
801 B
C++

#include <iostream>
#include <string>
#include <vector>
#include "solver.hpp"
#include "gen.hpp"
using std::cout;
using std::cin;
using std::string;
using std::vector;
int main(void) {
// Take game parameters
cout << "Length of sequence : ";
int N; cin >> N;
cout << "Number of colors : ";
int M; cin >> M;
cout << "Who plays [human/bot] : ";
string player; cin >> player;
string gen = "random";
if(player == "bot") {
cout << "Who generates the sequence [random/human]: ";
cin >> gen;
}
// Generate the sequence
auto sequence = vector<int>(N, 0);
if(gen == "random")
sequence = generate(N, M);
else if(gen == "human") {
cout << "Enter " << N << " space-separated colors from 0 to " << M-1 << std::endl;
for(int n = 0; n < N; n++)
cin >> sequence[n];
}
return 0;
}