This thread exists to hold information about the competition itself... not discussion about individual bots or the current standings (there will be another thread for that).
The goals are to not only provide useful examples of python code, but also to do so in a fun way, while also trying to out-think your opponent. All source for all bots will be publicly available for anyone to read, so newer bots *should* have a slight advantage over all previous bots, as they can leverage the successes of some while trying to solve shortcomings of others.
Each round, your script will receive (via command line arguments) a space-separated list of all previous rounds, in the format of your-response, other-response. In this way, there is no reason at all for your script to keep track of any state, as you should just re-calculate whatever you need each time you're run.
If it's the first round, there will be no arguments passed. For each subsequent round, the results of each previous round will be passed. For example, if it's the third round, and your first two rounds were 'R' then 'P', while your opponent's first two rounds were 'S' then 'P', the command-line arguments would look like "RS PP", and if you were to look at the command prompt, you'd see "python your_bot.py RS PP". A bot tester is included at the end of this post, so you can make sure you're receiving input and emitting responses as expected.
TERMINOLOGY:
Bot: Your entree, your program, your script. There are many bots like it, and now it's time to make your own.
Roshambo: Another name for the game. Use it if you want other people to look at you funny.
Match: All rounds between two given bots. Any two bots will only ever have a single match they share.
Round: A single game of RPS. Many rounds (specifically how many have yet to be decided, but probably an arbitrarily large number, such as 4201) are in a single match.
Standings: The overall rankings of bots, as determined by which bots have the most match wins. Tie-breakers... need to be decided later. Right now, I think it'll be opponent-match-win, with those ties decided by round-win-percent, with THOSE ties decided by opponent-round-win-percent. Ties after that indicate identical performance, and as such they'll share the spot on the leaderboard.
THE RULES:
1) When your script is called, return (to stdout) either 'R', 'P', or 'S', representing your choice for rock/paper/scissors.
2) Each new bot will face off against all previous bots, and added to overall standings (all bots face each other bot once).
3) Do not use io. You don't need it for any reason (if you have a reason to disagree, please elaborate).
4) The source for your bot will be available for anyone to see.
5) Each time a new bot is added, all bots will have their matches re-calculated. This is simply for my benefit, as I don't want to store state anywhere. I reserve the right to change my mind about this later, since it shouldn't effect your entry at all anyway. The main effect this rule has, though, is if your bot is in anyway random, it's position could change over time.
6) Do not depend on your file-name, or the order in which you're called. I might rename your script, you might be the first, you might go second, etc. (ie: naming your script "zzzzzz.py" does not mean you'll go last).
7) The point is to try to out-think many opponents at once. If you try to bypass the spirit of the event, for example by reading the matchmaker's memory addresses to find out how your opponent actually responded, your bot will be rejected from the competition.
8) Feel free to submit more than one bot.
9) Bots must be able to run using python 3.x. The future is now!
BENCHMARKS:
I'm submitting two benchmark bots, to demonstrate a) the bare minimum needed for a bot, and b) an example of how to make use of previous rounds to deterministically provide your response. Both of these bots will be listed in the rankings, but under the moniker "BENCHMARK"... I'm not going to take credit for their (under)performance, and will add my own entry later.
Benchmark Bot #1: Rocky
The following script can be used to ensure your input-output will be understood by the matchmaker. This is NOT the code that will actually perform the matchmaking, but the arguments and output of your bot will be the same.
The goals are to not only provide useful examples of python code, but also to do so in a fun way, while also trying to out-think your opponent. All source for all bots will be publicly available for anyone to read, so newer bots *should* have a slight advantage over all previous bots, as they can leverage the successes of some while trying to solve shortcomings of others.
Each round, your script will receive (via command line arguments) a space-separated list of all previous rounds, in the format of your-response, other-response. In this way, there is no reason at all for your script to keep track of any state, as you should just re-calculate whatever you need each time you're run.
If it's the first round, there will be no arguments passed. For each subsequent round, the results of each previous round will be passed. For example, if it's the third round, and your first two rounds were 'R' then 'P', while your opponent's first two rounds were 'S' then 'P', the command-line arguments would look like "RS PP", and if you were to look at the command prompt, you'd see "python your_bot.py RS PP". A bot tester is included at the end of this post, so you can make sure you're receiving input and emitting responses as expected.
TERMINOLOGY:
Bot: Your entree, your program, your script. There are many bots like it, and now it's time to make your own.
Roshambo: Another name for the game. Use it if you want other people to look at you funny.
Match: All rounds between two given bots. Any two bots will only ever have a single match they share.
Round: A single game of RPS. Many rounds (specifically how many have yet to be decided, but probably an arbitrarily large number, such as 4201) are in a single match.
Standings: The overall rankings of bots, as determined by which bots have the most match wins. Tie-breakers... need to be decided later. Right now, I think it'll be opponent-match-win, with those ties decided by round-win-percent, with THOSE ties decided by opponent-round-win-percent. Ties after that indicate identical performance, and as such they'll share the spot on the leaderboard.
THE RULES:
1) When your script is called, return (to stdout) either 'R', 'P', or 'S', representing your choice for rock/paper/scissors.
2) Each new bot will face off against all previous bots, and added to overall standings (all bots face each other bot once).
3) Do not use io. You don't need it for any reason (if you have a reason to disagree, please elaborate).
4) The source for your bot will be available for anyone to see.
5) Each time a new bot is added, all bots will have their matches re-calculated. This is simply for my benefit, as I don't want to store state anywhere. I reserve the right to change my mind about this later, since it shouldn't effect your entry at all anyway. The main effect this rule has, though, is if your bot is in anyway random, it's position could change over time.
6) Do not depend on your file-name, or the order in which you're called. I might rename your script, you might be the first, you might go second, etc. (ie: naming your script "zzzzzz.py" does not mean you'll go last).
7) The point is to try to out-think many opponents at once. If you try to bypass the spirit of the event, for example by reading the matchmaker's memory addresses to find out how your opponent actually responded, your bot will be rejected from the competition.
8) Feel free to submit more than one bot.
9) Bots must be able to run using python 3.x. The future is now!
BENCHMARKS:
I'm submitting two benchmark bots, to demonstrate a) the bare minimum needed for a bot, and b) an example of how to make use of previous rounds to deterministically provide your response. Both of these bots will be listed in the rankings, but under the moniker "BENCHMARK"... I'm not going to take credit for their (under)performance, and will add my own entry later.
Benchmark Bot #1: Rocky
print('R')Benchmark Bot #2: CounterPoint
import sys winning_match = { 'R': 'P', 'P': 'S', 'S': 'R' } responses = [other for self, other in sys.argv[1:]] if responses: last = responses[-1] print(winning_match[last]) else: print('P')BOT TESTING:
The following script can be used to ensure your input-output will be understood by the matchmaker. This is NOT the code that will actually perform the matchmaking, but the arguments and output of your bot will be the same.
bot_name = 'YOUR_SCRIPT_HERE.py' import subprocess as sp base_args = ['python', bot_name] previous_runs = [] for run in range(5): args = base_args + previous_runs bot = sp.run(args, stdout=sp.PIPE) response = bot.stdout.decode().strip() print('Round #{0}:'.format(run)) print('Response Received: {0}'.format(response)) print('Response Understood: {0}'.format(response in 'RPS')) print() # let's pretend your opponent always does Paper... previous_runs.append('{0}{1}'.format(response, 'P'))