Skip to main content
4 of 5
added 25 characters in body
ChristopheD
  • 1.7k
  • 1
  • 11
  • 21

##Python (2.6) Extremely simple, but still I'm curious how it will perform compared to the other approaches.

import sys, random
try:
    s = sys.stdin.readlines()[-2]
    m = min(int(x) for x in s.split())
except IndexError:
    m = random.choice([1,1,1,2,2,3,3,4])
a = random.choice([-2,-1,0,1,1,2,2,3,3])
print max(m + a, 1)

Just pipe in the bids via stdin, e.g. python testbid.py < bids.txt.

EDIT: changed for the 'first round all zeros'

EDIT: changed the 'magic numbers' a bit (a second time)

ChristopheD
  • 1.7k
  • 1
  • 11
  • 21