Machine Learning with Python Projects - Rock Paper Scissors

Tell us what’s happening:

Describe your issue in detail here.

Hi! I would like to know if there is a way to verify what bot I am dealing with…
I tried to introduce a variable ‘player2’ in player function in RPS.py as
player(prev_play, opponent_history=,player2)…
and tried something like " if player2 == ‘quincy’: do something…" but it didn’t work.

My point is, I already know how to beat one of the bots (the ease one
:grinning: )…So is it possible to deal with each one in different parts of my code?..or do I need a gereral solution, and use this one for all bots?

Moreover, do I need to use some specific Machine Learning method…or I could just create a clever script based on how the bots behaves, in order to beat them?

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

Machine Learning with Python Projects - Rock Paper Scissors

It seems that FCC do not have an authorative guide saying this approach is allowed and that is not for this challenge, their stance seems to be if your code can pass the test and it’s not plagiarized, then it’s OK. Of course to keep up with the spirit of the course, it would be better that the code has element of machine learning.

If you have counter-strategies for all the 4 bots, the crudest way to pass the test may be to tailor your code to the design of the test. The test module sets the player function to play 1000 games against Quincy, then Abbey, Kris and Mrugesh. So if you create a counter for the number of games played, you may set player to play anti-Quincy strategy for the first 1000 games, the next 1000 games play anti-Abbey strategy, and so on.

Of course, if the order of bot to be played against or the number of games to be played is changed in the test module, your counter-plays will be messed up. So a smarter way would be to identify pattern from the past moves and detect which bot is playing against, and apply corresponding counter-stretegy. A even more smarter approach that is not tied to specific opponent bots, is to let your bot ‘learn’ patterns from opponent plays and know which move has the best chance to win.

1 Like

Many thanks for the reply.

I solved this problem, but without machine learning…

Goodjob , on your description work.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.