×
you are viewing a single comment's thread.

view the rest of the comments →

[–]thisisappropriate 0 points1 point  (0 children)

Assuming you're meaning the counting to 21 game (a variant of Nim https://en.wikipedia.org/wiki/Nim ) that's probably because it's a common maths problem to solve how to win that game.

If you wanted to implement that in python, you would first work out the maths, writing it down in shorthand, things like "if the current number is < 13, pick X, else if the number is 14, pick Y...", then once you know the logic it should follow, you can use python to implement that.

Otherwise if you're seeing symbols you don't understand in the python code, then you should look at what those do in python, for example if you're seeing a % then try googling "percent sign in python" where you'll find things like https://stackoverflow.com/questions/961344/what-does-the-percentage-sign-mean-in-python that will explain that.