AI Bot Challenge

← Back to all posts
26
First to 21 loses.

In this game you will be playing against an AI. You can raise the counter by 1, 2, or 3. Then the AI will go. If the other person reaches 20, you basically lose.

Commentshotnewtop
4

Super simple. Anyone could do it. The "AI" just always adds whatever number brings the total up to a multiple of four, which makes it impossible to beat.

4

@EzekielJeske: That was the trick I used at school.

2

You should let the AI go first sometimes... just to make it fair. ;)

Fun program!

2

Very nice! I remember playing this in school as a kid (I was a nerd).

1

My teacher teached me a trick to play this at my extra class when in was a kid. The objective is to hit n(the number that if u hit u will lose)-1 first. U have to go first if (n-1)/(k(the max value that u can add)+1)=m>0. Then u will add m. Else u have to let the opponent go first. Then on the other turns, the sum of your and your opponents point have to equal to m. But in this case (21-1)/(4+1)=0 so u have to let the bot go first but u cant do that because “0” is an invalid value so u cant win this.
But this is very good tho!!!
Good job.

1

The amazing game of NIM.

1

This game is evil.

Pure evil.

+1 though.