mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Added comments
This commit is contained in:
@@ -56,6 +56,7 @@ THE MINIMUM BET IS $5, THE MAXIMUM IS $500.
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
def query_bets():
|
def query_bets():
|
||||||
|
"""Queries the user to input their bets"""
|
||||||
betCount = -1
|
betCount = -1
|
||||||
while betCount <= 0:
|
while betCount <= 0:
|
||||||
try:
|
try:
|
||||||
@@ -87,6 +88,7 @@ def query_bets():
|
|||||||
return bet_IDs,bet_Values
|
return bet_IDs,bet_Values
|
||||||
|
|
||||||
def bet_results(bet_IDs,bet_Values,result):
|
def bet_results(bet_IDs,bet_Values,result):
|
||||||
|
"""Computes the results, prints them, and returns the total net winnings"""
|
||||||
total_winnings = 0
|
total_winnings = 0
|
||||||
def get_modifier(id,num):
|
def get_modifier(id,num):
|
||||||
if id == 37 and num <= 12:
|
if id == 37 and num <= 12:
|
||||||
@@ -130,6 +132,7 @@ def bet_results(bet_IDs,bet_Values,result):
|
|||||||
return winnings
|
return winnings
|
||||||
|
|
||||||
def print_check(amount):
|
def print_check(amount):
|
||||||
|
"""Prints a check of a given amount"""
|
||||||
name = input("TO WHOM SHALL I MAKE THE CHECK? ")
|
name = input("TO WHOM SHALL I MAKE THE CHECK? ")
|
||||||
|
|
||||||
print("-" * 72)
|
print("-" * 72)
|
||||||
@@ -203,7 +206,8 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
def stringtobool(string):
|
def stringtobool(string):
|
||||||
|
"""Converts a string to a bool"""
|
||||||
return string.lower() in ("yes","y","true","t","yes")
|
return string.lower() in ("yes","y","true","t","yes")
|
||||||
|
|
||||||
# a,b = query_bets()
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user