58
16
Many people consider RPS to be a game of chance. If both players play unpredictably, the best strategy is to play randomly. However, let's introduce a bit of predictability to it.
Each bot will have a chance to tell the other bot what it's going to play simultaneously. Then there is a pause in which each bot will know what the other player announced. If it plays that weapon it announced it will score one point in addition to its points for a win loss or draw.
A win is worth two points, a draw, one point, and a loss 0 points.
Honest Bot Dishonest
Win 3 2
Draw 2 1
Loss 1 0
It is in your best interest to be honest (but also to make sure your opponent does not believe you).
The matches will be played in a round robin format, and the objective will be to maximise your own total score across the matches you play.
I/O Format:
- Your bot will be a Python 2.7 function that takes 4 arguments, and must have a unique name (which will be used to represent your submission).
- The first two arguments will always be, in order: the opponent's past moves, followed by your past moves. These will be a list in order from first to most recent round, with each index containing a list with the move the opponent claimed they would make, followed by the move they actually made.
- The next two arguments will allow your bot to determine if this is an "honest" round or a "real" round. If it is an "honest" round, they will both be None. If it is a "real" round, they will be, in order, the move your opponent declared they would make, followed by the move you declared you would make.
- All arguments or portions of arguments that represent moves will use "R", "P", and "S" to represent rock, paper, and scissors, respectively.
- Your function should return either an "R" for rock, a "P" for paper, or an "S" for scissors. Bots that have the ability to return other values will be disqualified.
- Each bot will be run against every other bot 200 times, and itself 100 times. The goal is to be the bot with the most points at the end of the competition.
- In regards to discussion in the comments, submissions may not read from or write to any file, or in any way sabotage or read opponent's code.
Examples:
These are four example bots I put together quickly. They will be joining the competition as additional bots. If you lose to the last one, you have some work to do.
def honestpaper(I,dont,care,about_these):
return "P"
def honestrock(I,dont,care,about_these):
return "R"
def honestscissors(I,dont,care,about_these):
return "S"
import random
def randombot(I,dont,care,about_these):
return random.choice(["R","P","S"])
Controller:
And here's the controller I'll be using. New submissions will be imported at the beginning and added to the bot_map dictionary.
from honestrock import honestrock
from honestpaper import honestpaper
from honestscissors import honestscissors
from randombot import randombot
bot_map = {
0:honestrock, 1:honestpaper, 2:honestscissors, 3:randombot
}
player_num=len(bot_map)
def real(history1,history2,number,honest1,honest2):
return bot_map[number](history1,history2,honest1,honest2)
def honest(history1,history2,number):
return bot_map[number](history1,history2,None,None)
def play_match(num1,num2):
history1=[]
history2=[]
score1=0
score2=0
for x in range(250):
h1=honest(history2,history1,num1)
h2=honest(history1,history2,num2)
r1=real(history2,history1,num1,h2,h1)
r2=real(history1,history2,num2,h1,h2)
if h1==r1: score1+=1
if h2==r2: score2+=1
if r1==r2: score1+=1; score2+=1
elif r1=="R":
if r2=="P": score2+=2
else: score1+=2
elif r1=="P":
if r2=="S": score2+=2
else: score1+=2
else:
if r2=="R": score2+=2
else: score1+=2
history1.append([h1,r1])
history2.append([h2,r2])
return score1,score2
scores = []
for x in range(player_num):
scores.append(0)
for _ in range(100):
for x in range(player_num):
for y in range(player_num):
scorex,scorey=play_match(x,y)
scores[x]+=scorex
scores[y]+=scorey
for score in scores:
print score
Final Scores:
csbot 3430397
thompson 3410414
rlbot 3340373
have_we_been_here_before 3270133
mason 3227817
deepthought 3019363
adaptive_bot 2957506
THEbot 2810535
dontlietome 2752984
irememberhowyoulie 2683508
learningbot4 2678388
betrayal 2635901
averager 2593368
honestrandom 2580764
twothirds 2568620
mirrorbot 2539016
tit4tat 2537981
honestscissors 2486401
trusting_bot 2466662
rotate_scissors 2456069
rotate_paper 2455038
rotate_rock 2454999
honestpaper 2412600
honestrock 2361196
rockBot 2283604
trustingRandom 2266456
user5957401bot 2250887
randombot 2065943
Dx 1622238
liarliar 1532558
everybodylies 1452785
1What's the status? – user1502040 – 2017-12-04T21:14:51.190