diff --git a/exercises/risk-risiko.cpp b/exercises/risk-risiko.cpp index 3166f058..952e870e 100644 --- a/exercises/risk-risiko.cpp +++ b/exercises/risk-risiko.cpp @@ -27,3 +27,46 @@ M 3 vs 3 => blue win O 2 vs 1 => red win */ +#include +#include +#include +#include +const char chs[3]= {'N', 'M', 'O'}; +using namespace std; + +void throwDices(int *v, int n); +void printThrows (int *v, int n); +void fight(int *v1, int *v2 , int n); + +int main() { + srand(time(nullptr)); + int v1[3],v2[3]; + throwDices(v1, 3); + throwDices(v2, 3); + cout << "Red dices: " << endl; + printThrows(v1, 3); + cout << "\nBlue dices: " << endl; + printThrows(v2, 3); + + fight(v1, v2, 3); + return EXIT_SUCCESS; +} + +void throwDices(int *v, int n){ + for (int i=0; i()); +} +void printThrows (int *v, int n){ + for (int i=0; i " << (v1[i]>v2[i] ? "red win" : "blue win" ) << endl; + } +} \ No newline at end of file