def run(self):
		print '--------GAME START--------'
		print 'player1 : %s'%self.p1.filename
		print 'player2 : %s'%self.p2.filename

		while True:
			# run ai again
			self.p1.run_again()
			self.p2.run_again()

			self.p1.vars = []
			self.p1.vars = ["1",
					str(self.scotch_pos),
					' '.join([str(x) for x in self.p1_moves]),
					' '.join([str(x) for x in self.p2_moves])
					]
			self.p2.vars = ["2",
					str(self.scotch_pos),
					' '.join([str(x) for x in self.p1_moves]),
					' '.join([str(x) for x in self.p2_moves])
					]

			# feed vars to ai and get result
			self.p1.feed_vars()
			self.p2.feed_vars()

			# get result and remove '\n' at the end
			r1 = self.p1.get_result()

			while True:
				if r1[-1] in ['\n',',','\r','\t']:
					r1=r1[:-1]
				else:
					break
			r2 = self.p2.get_result()

			while True:
				if r2[-1] in ['\n',',','\r','\t']:
					r2=r2[:-1]
				else:
					break
			r1 = int(r1)
			r2 = int(r2)

			# could not more than left money
			if r1>self.p1_money:
				# r1=self.p1_money
				self.win(2)
				break
			if r2>self.p2_money:
				# r2=self.p2_money
				self.win(1)
				break

			# record
			self.p1_moves.append(r1)
			self.p2_moves.append(r2)


			# tell winner
			if r1 <=0:
				self.win(2)
				break
			elif r2<=0:
				self.win(1)
				break

			if r1>r2:
				self.scotch_pos-=1
				self.p1_money-=r1
			elif r1<r2:
				self.scotch_pos+=1
				self.p2_money-=r2
			else:
				if self.equal_mark:
					self.equal_mark=False
					self.scotch_pos-=1
					self.p1_money-=r1
				else:
					self.equal_mark=True
					self.scotch_pos+=1
					self.p2_money-=r2

			# tell winner
			if self.scotch_pos<=0:
				self.win(1)
				break
			elif self.scotch_pos>=10:
				self.win(2)
				break

			# money left
			if self.p1_money<=0:
				self.win(2)
				break
			elif self.p2_money<=0:
				self.win(1)
				break
			# print round result
			self.print_log()
		self.print_log()
		print self.win_msg
do the bid and print logs
dataset/ETHPy150Open dawn110110/bid_game_platform/platform.py/GameLogic.run