Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def end_game():
pygame.quit()

def scoring(ballscore):
print("Button clicked")
global runs
global bye_status
global extras
Expand Down Expand Up @@ -295,14 +294,20 @@ def toggle_bold(): # Function to toggle between regular and bold font

while True:
# If it's the second innings, set the required score to the runs scored by team 1 then add 1 to win
if overs == 20:
read_score()

if overs < 1:
run_rate = 0
else:
run_rate = runs/numpy.round(overs, 1) # Makes the runrate (1 d.p.)
if run_rate > 36:
run_rate = 36
if overs % 1 == 0:
predicted = (run_rate * (20 - numpy.round(overs, 1)))+runs # Calculates the projected total at the end of every over
if run_rate >= 36:
run_rate = 36
else:
predicted = (run_rate * (20 - numpy.round(overs, 1)))+runs # Calculates the projected total at the end of every over

final_score = state["last"]
if innings == 2:
Expand Down