fork download
  1. import random
  2.  
  3. def crash_game_simulation(bet_amount, cash_out_multiplier):
  4. # اللعبة تولد رقم عشوائي يمثل الرقم الذي تنكسر فيه اللعبة
  5. crash_point = random.uniform(1.0, 10.0) # رقم بين 1 و 10
  6.  
  7. print(f"Crash point: {crash_point:.2f}")
  8. if crash_point >= cash_out_multiplier:
  9. winnings = bet_amount * cash_out_multiplier
  10. print(f"You cashed out at {cash_out_multiplier}x and won {winnings}")
  11. return winnings
  12. else:
  13. print("You lost your bet.")
  14. return 0
  15.  
Success #stdin #stdout 0.03s 11584KB
stdin
Standard input is empty
stdout
Standard output is empty