In my school our teacher is holding a Rock, paper, scissors bot competition. I know how to program in Python, but I have no idea how to program a bot that would have a bigger chance of success than one that randomly selects its weapons. I think it is possible to store all previous moves and then look for patterns in order to defy attacks. Am I going in a right direction? Any ideas?
It is proven for rock-paper-scissors that a random bot will be at the median of each rank.
Therefore, I'd create a set of bots, each calculating one heuristic and running on the background on parallel. For each turn, each bot will virtually "draw" and check if he had won or lost - if it would have played this turn. Each bot will keep track on how many games it would have won if it played, and how many it would have lost.
One of these bots will be the random attacker.
Each time it is your turn: choose which bot won so far the most [greedy] - and use it.
Using this approach you are guaranteed to be at the top median of your class! [with enough rounds of games of course]
If you are playing against humans, you are on the right track. Storing previous moves is key. Here are two articles that will prove helpful to you. How to win at rock, paper, scissors. And wikipedia's entry on strategy and algorithms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With