コード例 #1
0
ファイル: PlaceAcross.py プロジェクト: cammoore/python-dice
 atm = 0
 for i in range(1, 50):
     # Do the banking first
     if stake < line_bet: # need more money
         stake += 100
         atm += 100
     if stake > 250: # deposit some of our winnings
         stake -= 100
         atm -= 100
     # play the line
     if stake > line_bet and g.is_button_off:
         if b.play_pass_line(line_bet):
             stake -= line_bet
             if debug:
                 print "pass line bet %s" % line_bet
     if stake > line_odds and g.is_button_on() and b.pass_line_odds == 0:
         if b.play_pass_line_odds(line_odds):
             stake -= line_odds
             if debug:
                 print "pass line odds %s" % line_odds
     have_place = b.have_place_bets()
     if stake > 27 and g.is_button_on() and not have_place:
         for i in [4, 5, 6, 8, 9, 10]:
             if i != 6 and i != 8 and i != g.current_point:
                 b.place_the_number(i, 5)
                 stake -= 5
             if i != g.current_point and (i == 6 or i == 8):
                 b.place_the_number(i, 6)
                 stake -= 6
         if debug:
             print "placing across, stake = %s" % stake 
コード例 #2
0
         if debug:
             print "Across: pass line bet %s" % line_bet
 # play the line
 if stake2 > line_bet and game.is_button_off:
     if six_eight.play_pass_line(line_bet):
         stake2 -= line_bet
         if debug:
             print "6_8: pass line bet %s" % line_bet
 # play the line
 if stake3 > line_bet and game.is_button_off:
     if come.play_pass_line(line_bet):
         stake3 -= line_bet
         if debug:
             print "Come: pass line bet %s" % line_bet
 # play pass line odds
 if stake1 > line_odds and game.is_button_on() and across.pass_line_odds == 0:
     if across.play_pass_line_odds(line_odds):
         stake1 -= line_odds
         if debug:
             print "Across: pass line odds %s" % line_odds
 # play pass line odds
 if stake2 > line_odds and game.is_button_on() and six_eight.pass_line_odds == 0:
     if six_eight.play_pass_line_odds(line_odds):
         stake2 -= line_odds
         if debug:
             print "6_8: pass line odds %s" % line_odds
 # play pass line odds
 if stake3 > line_odds and game.is_button_on() and come.pass_line_odds == 0:
     if come.play_pass_line_odds(line_odds):
         stake3 -= line_odds
         if debug:
コード例 #3
0
 num_come_bets = 0
 for i in range(1, 50):
     # Do the banking first
     if stake < line_bet:  # need more money
         stake += 100
         atm += 100
     if stake > 250:  # deposit some of our winnings
         stake -= 100
         atm -= 100
     # play the line
     if stake > line_bet and g.is_button_off:
         if b.play_pass_line(line_bet):
             stake -= line_bet
             if debug:
                 print "pass line bet %s" % line_bet
     if stake > line_odds and g.is_button_on() and b.pass_line_odds == 0:
         if b.play_pass_line_odds(line_odds):
             stake -= line_odds
             if debug:
                 print "pass line odds %s" % line_odds
     if stake > line_bet and num_come_bets < 3:
         if b.play_come_bet(line_bet):
             num_come_bets += 1
             stake -= line_bet
             if debug:
                 print "come bet %s" % line_bet
     g.roll_dice(verbose=debug)
     for c_b in b.come_bets_wo_odds():
         if b.play_come_bet_odds(c_b, line_odds):
             stake -= line_odds
             if debug: