You CAN'T beat this game. You just can't.

So there are 12 sticks. The last stick (left most one) is the special stick. If you can take that stick, then you win. But in order to take that stick, you and the computer must take turns starting from the right end and taking either 1, 2, or 3 sticks at a time.

For example, you can take 2 sticks, while the computer takes 1. And whoever ends up taking the last stick wins the game.

Easy... right?

You are viewing a single comment. View All

Btw: for portability, don't use system("clear"), use std::wcout or wprintf on L"\e[H\e[2J", that's the shortest ANSI sequence for clearing the terminal.


@StudentFires So would it be something like std::wcout << L"\e[H\e[2J"?


@DynamicSquid Yeah. If doesn't need to be wcout, especially since you weren't using it everywhere else like I do.
So more like:
std::cout << "\e[H\e[2J".