Aquí está el prometido código Python que simula el juego usando el sistema Martingale. Simplemente ajustando las variables, puedes adaptarlo a tu capital, apuesta, o apuesta máxima en caso de que juegues en un casino tradicional donde los límites de apuesta son muchas veces menores.
Para empezar sin instalar Python, puede utilizar el servicio web replit.com
import random
# players variables
bet = 1
budget = 10_000
max_bet = 200_000
rounds = 200
choice = "red"
# choice = "black"
# Game simulation
actual_bet = bet
red = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36]
black = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35]
for spin in range(rounds):
if actual_bet > budget:
print("You don't have enough money.")
print(f"Your final budget is {budget}")
break
if actual_bet > max_bet:
print("Your bet is higher than max bet.")
print(f"Your final budget is {budget}")
break
spin_number = random.randint(0, 36)
print(f"Your bet is {actual_bet}")
print(f"{spin + 1}. spin, {spin_number}")
if choice == "red":
if spin_number in red:
win_check = True
print(f"You win {actual_bet}")
else:
win_check = False
print(f"You loose {actual_bet}")
elif choice == "black":
if spin_number in black:
win_check = True
print(f"You win {actual_bet}")
else:
win_check = False
print(f"You loose {actual_bet}")
if win_check:
budget += actual_bet
actual_bet = bet
else:
budget -= actual_bet
actual_bet = actual_bet * 2
print(f"Now you have {budget}.")
print()
Aquí está el prometido código Python que simula el juego usando el sistema Martingale. Simplemente ajustando las variables, puedes adaptarlo a tu capital, apuesta, o apuesta máxima en caso de que juegues en un casino tradicional donde los límites de apuesta son muchas veces menores. Para empezar sin instalar Python, puede utilizar el servicio web replit.com
import random # players variables bet = 1 budget = 10_000 max_bet = 200_000 rounds = 200 choice = "red" # choice = "black" # Game simulation actual_bet = bet red = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36] black = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35] for spin in range(rounds): if actual_bet > budget: print("You don't have enough money.") print(f"Your final budget is {budget}") break if actual_bet > max_bet: print("Your bet is higher than max bet.") print(f"Your final budget is {budget}") break spin_number = random.randint(0, 36) print(f"Your bet is {actual_bet}") print(f"{spin + 1}. spin, {spin_number}") if choice == "red": if spin_number in red: win_check = True print(f"You win {actual_bet}") else: win_check = False print(f"You loose {actual_bet}") elif choice == "black": if spin_number in black: win_check = True print(f"You win {actual_bet}") else: win_check = False print(f"You loose {actual_bet}") if win_check: budget += actual_bet actual_bet = bet else: budget -= actual_bet actual_bet = actual_bet * 2 print(f"Now you have {budget}.") print()