diff options
-rw-r--r-- | TODO.txt | 1 | ||||
-rw-r--r-- | main.cpp | 15 |
2 files changed, 9 insertions, 7 deletions
diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index 2896735..0000000 --- a/TODO.txt +++ /dev/null @@ -1 +0,0 @@ -competition now has feature write_lines, so a referee for this game can be implemented. @@ -30,6 +30,8 @@ int main() { cout << bd << endl; + uint8_t win = 0; + uint8_t onturn = 1; while (bd.bag.totalLeft() > 0) { cout << "--- NEXT TURN: " << Stone(onturn) << " ---" << endl; @@ -44,17 +46,18 @@ int main() { } uint8_t clr = bd.bag.drawRandom(); - uint8_t win = bd.putCW(idx, clr); + win = bd.putCW(idx, clr); cout << bd << endl; - if (win != 0) { - cout << "Winner: " << Stone(clr) << endl; - break; - } + if (win != 0) break; onturn = NEXTTURN(onturn); } - cout << "TIE" << endl; + if (win == 0) { + cout << "TIE" << endl; + } else { + cout << "Winner: " << Stone(win) << endl; + } } |