12
1
Contest permanently opened - Updated August 10th 2017
Even though on June 5th 2017 I declared a winner (who will be kept as the best answer) I'll be rnning new bots and updating the results.
June 5th Results
Congratulations user1502040
Since there are no ties, I only show the % of matches won.
Statistician2
- 95.7%
Fitter
- 89.1%
Nash
- 83.9%
Weigher
- 79.9%
ExpectedBayes
- 76.4%
AntiRepeater
- 72.1%
Yggdrasil
- 65.0%
AntiGreedy
- 64.1%
Reactor
- 59.9%
NotHungry
- 57.3%
NashBot
- 55.1%
Blodsocer
- 48.6%
BestOfBothWorlds
- 48.4%
GoodWinning
- 43.9%
Rockstar
- 40.5%
ArtsyChild
- 40.4%
Assassin
- 38.1%
WeightedRandom
- 37.7%
Ensemble
- 37.4%
UseOpponents
- 36.4%
GreedyPsychologist
- 36.3%
TheMessenger
- 33.9%
Copycat
- 31.4%
Greedy
- 28.3%
SomewhatHungry
- 27.6%
AntiAntiGreedy
- 21.0%
Cycler
- 20.3%
Swap
- 19.8%
RandomBot
- 16.2%
I created a Google Sheet with the grid of results of each pairing: https://docs.google.com/spreadsheets/d/1KrMvcvWMkK-h1Ee50w0gWLh_L6rCFOgLhTN_QlEXHyk/edit?usp=sharing
Thanks to the Petri Dilemma I found myself able to handle this King of the Hill.
The game
The game is a simple "Rock-Paper-Scissors" with a twist: Points gained with each victory increase during the match (your R, P or S get loaded).
- Paper wins Rock
- Scissors wins Paper
- Rock wins Scissors
The winner gets as many points as his load on his play.
The loser increases by 1 the load on his play.
In the case of a tie, each player increases the load on his play by 0.5.
After 100 plays, the one with more points is the winner.
e.g.: P1 has loads [10,11,12] (Rock, Paper, Scissors) and P2 [7,8,9]. P1 plays R, P2 plays P. P2 wins and gets 8 points. P1 loads become [11,11,12], P2 loads stay the same.
Challenge specifications
Your program must be written in Python (sorry, I don't know how to handle it otherwise). You are to create a function that take each of these variables as an argument on each execution:
my_points, opp_points, my_loaded, opp_loaded, my_history, opp_history
points
- Current points (yours and your opp)
loaded
- Array with loads (in order RPS) (yours and your opp)
history
- String with all plays, last character is the last play (yours and your opp)
You must return "R"
, "P"
or "S"
. If you would return something different, it would be an automatic lose of the match.
Rules
You cannot change built-in functions.
Testing
I'll keep a Git updated with the code and all the bots compiting: https://github.com/Masclins/LoadedRPS
Judging
The winner will be decided by selecting the person with the most win matches after 1000 full round-robin. Ties will be broken by matches tied. 1000 matches are being played rather than one because I expect a lot of randomness, and that way the randomness would be less relevant.
You can submit up to 5 bots.
The contest ends on JulyJune 4th (that will be the last day I'll accept any answer), and on JulyJune 5th I'll post the final stadings (might try to post an advancemnt before).
Since this is my first KOTH, I'm 100% opened to changing anything for improvement, such as the number of matches played against each bot.
Edited to 1000 matches, since I see there really is quite randomness involved.
with some randomised bots, you actually want to make multiple games of multiple rounds – Destructible Lemon – 2017-05-24T08:31:07.070
@DestructibleLemon I thought about making each bot play three times against each other bot rather than once. Seeing you think similarly, I'll do so. – Masclins – 2017-05-24T08:35:54.010
three might not be enough, for some pairings – Destructible Lemon – 2017-05-24T08:36:51.793
1(really you need a fair large number, since some probabilites do really extend over multiple matches. see my bot, where it could get trounced, but likely wouldn't with a fair amount of matches) – Destructible Lemon – 2017-05-24T08:39:57.963
1I'm glad my question helped you be able to run this, @AlbertMasclans! – Gryphon – 2017-05-24T12:44:01.507
It would be nice to allow any language that can take input from command-line args and can output to STDOUT. I am intrested in a node.js submission. – programmer5000 – 2017-05-24T12:48:16.550
@programmer5000 it would be indeed, but I don't know how to do so. – Masclins – 2017-05-24T13:17:16.387
@AlbertMasclans is it possible to have python execute shell code and get the printed result? – programmer5000 – 2017-05-24T13:18:46.243
@programmer5000 yes. Using
from subprocess import call
, the functioncall
does what you want. – Masclins – 2017-05-24T14:16:27.300What's
runcode
? – CalculatorFeline – 2017-05-24T18:43:03.8932@AlbertMasclans Can you post the full testscript (including
runcode
andbots
)? – CalculatorFeline – 2017-05-24T18:53:31.763Does "full round-robin" mean that each bot plays with each other bot and all results are summed? – Display Name – 2017-05-24T20:01:56.943
It would be more interesting if bots could maintain state between rounds – user1502040 – 2017-05-24T20:02:36.560
Which Python version will be used for testing? – Display Name – 2017-05-24T20:11:45.447
@CalculatorFeline Full code posted – Masclins – 2017-05-25T06:58:30.943
@SargeBorsch It means exactly what you said. I'm using Python 3. – Masclins – 2017-05-25T06:58:50.907
@AlbertMasclans code can be simplified A Lot, don't forget that python has first class functions. it will also be less error prone. – Display Name – 2017-05-25T07:00:58.407
does current testing code make bots also play with themselves? it looks like it does, and if a bot makes lots of ties when playing with itself, it reduces its chances to be first in leaderboard – Display Name – 2017-05-25T07:03:14.160
@SargeBorsch to be honest, the main reason for me to handle this KOTH is learn Python (which I just began doing), so any advice would be welcomed. And no, it doesn't make them play themselves – Masclins – 2017-05-25T07:04:06.420
oops, i looked in wrong place. yes, looks correct – Display Name – 2017-05-25T07:05:22.460
i think a time limit should be chosen otherwise someone will post a solution which practically disrupts the whole shootout – Display Name – 2017-05-25T07:15:12.013
Can you make a Github repo with all of the bots? – clismique – 2017-05-25T07:17:09.457
@Qwerp-Derp done (I think) – Masclins – 2017-05-25T07:32:27.817
How long is the script expected to take? My PC is no slouch but it's been 2 hours and the terminal still says 0%. – Neil – 2017-06-04T23:18:47.547
in my PC it took less than an hour. Still, though, in no time the first matches should be solved, since they are for quick bots. – Masclins – 2017-06-05T09:17:10.913
You said July, but you meant June, didn't you? Seems I got lucky that my bot even got accepted. Then again, I didn't realise that someone had already submitted a better Nash bot otherwise I wouldn't have bothered. And I didn't even beat NotHungry which is was my original aim... – Neil – 2017-06-09T09:49:47.817
@Neil Ooops! Yes I ment June. My deepest apologies. – Masclins – 2017-06-09T11:03:04.103