I Random Cricket Score Generator

It was a random cricket score generator, hidden behind a sophisticated-looking UI. He programmed it with basic logic: a 40% chance of a single, 10% for a boundary, 5% for a wicket, and a slight weighting for the batting team’s historical average. He hit 'Deploy' and prayed.

def generate_score(self): while self.wickets < 10: runs = random.randint(0, 6) if runs == 6: print(f"self.batsmen[0] hits a six! self.batsmen[0] scores runs runs.") elif runs == 0: print(f"self.batsmen[0] is out for a duck! self.wickets wickets down.") self.wickets += 1 self.batsmen[0] = f"Batsman self.wickets + 1" else: print(f"self.batsmen[0] scores runs runs.") self.score += runs print(f"Score: self.score/self.wickets") print("\n") i random cricket score generator

Fourth roll: . India win.