Share your repls and programming experiences

← Back to all posts
15
Node.js Impossible Nims AI

This is a very simple and short AI, in total the AI is one line long.

  else nimstot -= nimstot % 4 == 0 ? Math.ceil(Math.random() * 3) : nimstot % 4

A tutorial and explanation for the rest of the code can be found here: https://repl.it/talk/learn/How-To-Make-A-1-Player-Nims-Game-Nodejs/7610
Good luck.

Commentshotnewtop
1

I've made my own version of this game.

2

@nithilan4 that's the point, you can't beat it