Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4 Since I use 0-indexed rounds, final round is of course 9, not 10..
source | link

Half In

This bot always bids half of what it has left, except in the final round where it will go all in.

class half_in:
  def __init__(self):
    self.money = 0
    self.round = -1
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount
    #  One round further
    self.round += 1

    # If it's the final round: bid all in
    if self.round == 109:
      return self.money
    # Else: Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what it has left, except in the final round where it will go all in.

class half_in:
  def __init__(self):
    self.money = 0
    self.round = -1
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount
    # One round further
    self.round += 1

    # If it's the final round: bid all in
    if self.round == 10:
      return self.money
    # Else: Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what it has left, except in the final round where it will go all in.

class half_in:
  def __init__(self):
    self.money = 0
    self.round = -1
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount
    #  One round further
    self.round += 1

    # If it's the final round: bid all in
    if self.round == 9:
      return self.money
    # Else: Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

3 All-in in the final round
source | link

Half In

This bot always bids half of what it has left, except in the final round where it will go all in.

class half_in:
  def __init__(self):
    self.money = 0
    self.round = -1
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount
    # One round further
    self.round += 1

    # If it's the final round: bid all in
    if self.round == 10:
      return self.money
    # Else: Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what it has left.

class half_in:
  def __init__(self):
    self.money = 0
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount

    # Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what it has left, except in the final round where it will go all in.

class half_in:
  def __init__(self):
    self.money = 0
    self.round = -1
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount
    # One round further
    self.round += 1

    # If it's the final round: bid all in
    if self.round == 10:
      return self.money
    # Else: Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

2 Added comments
source | link

Half In

This bot always bids half of what heit has left.

class half_in:
  def __init__(self):
    self.dollarmoney = 0
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.dollarmoney += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.dollarmoney -= win_amount 

    # Bid half what it has left:
    return self.dollarmoney / 2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what he has.

class half_in:
  def __init__(self):
    self.dollar = 0
  def play_round(self, winner, win_amount):
    self.dollar += 500
    if winner == 0:
      self.dollar -= win_amount
    return self.dollar/2

I never program in Python, so if you see any mistakes let me know..

Half In

This bot always bids half of what it has left.

class half_in:
  def __init__(self):
    self.money = 0
  def play_round(self, winner, win_amount):
    # Default actions:
    #  Collect 500 dollars
    self.money += 500
    #  If it was the winner: subtract the win_amount from his money
    if winner == 0:
      self.money -= win_amount 

    # Bid half what it has left:
    return self.money / 2

I never program in Python, so if you see any mistakes let me know..

1
source | link