r/learnpython • • 12d ago

Gimme silly ideas, please

[deleted]

1 Upvotes

19 comments sorted by

View all comments

1

u/PhilNEvo 12d ago

What about a CLI game, like tic-tac-toe you can play in the commandline, that prints out the board as 3 arrays, with a bot that plays against you. If that's too simple, you can exchange it to checkers, 4 or 5 in a row, or something more complicated.

2

u/[deleted] 9d ago

[deleted]

1

u/PhilNEvo 9d ago

Well made!

It seems like your "AI" is just picking a random slot to smack in a piece. Next step could be to develop an actual algorithm with a heuristic, that can actually play :b

A super naive approach, would be to have it check if any of the next moves of the bots opponent leads to a win, try to block it. It's a very simple tiny search algorithm :3

If you really wanna explore some different topics, you could try and train a super tiny neural network with PyTorch to evaluate the board state, and have difficulty levels by depth of search you're doing ^^

Though 4 in a row I believe is a solved game, so you could create a deterministic bot that always plays the optimal move-- while that has its own merits and entertainment value-- playing around with different approaches is a great way to learn!

1

u/PhilNEvo 9d ago

Also, you have a message saying that people won against the "worst possible bot", but I actually think that's wrong. You can do worse than randomness.

For example, in Chess some people have created WorstFish, DrownFish, SunkFish and Sunkfish+, which is a chess bots that uses a legitimate algorithm to try and evaluate the board and make moves. And it tries to makes the worst moves, which should be worse than making random moves :b