Chopsticks mutated with points KoTH
CodingAndAlgorithms
This answer actually uses coding and algorithms, unlike the others so far!reference: imgur(also beats all of the answers posted before this)
def play(A, B):
if sum(A) == 1:
return [A.index(1), B.index(max(B))]
elif max(A) + max(B) > 1000:
return [A.index(max(A)), B.index(max(B))]
elif 0 in A:
return 1
elif 0 in B:
return [A.index(min(A)), 1-B.index(0)]
else:
return [A.index(min(A)), B.index(min(B))]
Aggressor
def play(s, o):
return [s.index(max(s)),o.index(max(o))]if all(s)else 1
Another starter bot, Aggressor will hit the larger of the opponent's hands with the larger of its own hands if both of its hands are non-empty; otherwise, it splits.
CautionBot
def play(s,o):
if max(s)+max(o)>1000 and (all(s) or max(s)+min(o)<1001):
return [s.index(max(s)),o.index(max(o))]
else:
return [s.index(min(s)),o.index(min(filter(bool,o)))]if all(s) else 'split'
CautionBot doesn't want to cause too much trouble, so it hits the smaller of the opponent's hands with its smaller hand if it has both hands, and otherwise splits. However, CautionBot is no fool, so if it can take out an opponents' hand without immediately losing next turn, it will do so instead of its normal move.