From 768ab3486ae203442c72b22e1cab1899bde21499 Mon Sep 17 00:00:00 2001 From: Suri-Sh <146209237+Suri-Sh@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:53:04 -0700 Subject: [PATCH 1/3] Create Rolling_Dice100 --- Rolling_Dice100 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Rolling_Dice100 diff --git a/Rolling_Dice100 b/Rolling_Dice100 new file mode 100644 index 0000000..5c7a5c5 --- /dev/null +++ b/Rolling_Dice100 @@ -0,0 +1,36 @@ +# python +import random +import time + +def race(): + player1 = 0 + player2 = 0 + + print("Welcome to the race!") + print("The race is about to begin...") + + while player1 < 100 and player2 < 100: + # Generate random numbers between 1 and 6 for each player + player1_roll = random.randint(1, 6) + player2_roll = random.randint(1, 6) + + # Update positions of the players + player1 += player1_roll + player2 += player2_roll + + # Display the positions of the players + print("Player 1:", "#" * player1) + print("Player 2:", "#" * player2) + print() + + # Pause for a moment between each roll + time.sleep(0.5) + + if player1 >= 100 and player2 >= 100: + print("It's a tie!") + elif player1 >= 100: + print("Player 1 wins!") + else: + print("Player 2 wins!") + +race() From 8221de31651c8205f52e476e4ce24284eed21a9a Mon Sep 17 00:00:00 2001 From: Suri-Sh <146209237+Suri-Sh@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:58:32 -0700 Subject: [PATCH 2/3] Create Rollingdice100 --- Rollingdice100 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Rollingdice100 diff --git a/Rollingdice100 b/Rollingdice100 new file mode 100644 index 0000000..614cdc9 --- /dev/null +++ b/Rollingdice100 @@ -0,0 +1,36 @@ +python +import random +import time + +def race(): + player1 = 0 + player2 = 0 + + print("Welcome to the race!") + print("The race is about to begin...") + + while player1 < 100 and player2 < 100: + # Generate random numbers between 1 and 6 for each player + player1_roll = random.randint(1, 6) + player2_roll = random.randint(1, 6) + + # Update positions of the players + player1 += player1_roll + player2 += player2_roll + + # Display the positions of the players + print("Player 1:", "#" * player1) + print("Player 2:", "#" * player2) + print() + + # Pause for a moment between each roll + time.sleep(0.5) + + if player1 >= 100 and player2 >= 100: + print("It's a tie!") + elif player1 >= 100: + print("Player 1 wins!") + else: + print("Player 2 wins!") + +race() From 7ed24742fea805faaee56070c5007684bd6cb112 Mon Sep 17 00:00:00 2001 From: Suri-Sh <146209237+Suri-Sh@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:10:51 -0700 Subject: [PATCH 3/3] Delete Rollingdice100 --- Rollingdice100 | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 Rollingdice100 diff --git a/Rollingdice100 b/Rollingdice100 deleted file mode 100644 index 614cdc9..0000000 --- a/Rollingdice100 +++ /dev/null @@ -1,36 +0,0 @@ -python -import random -import time - -def race(): - player1 = 0 - player2 = 0 - - print("Welcome to the race!") - print("The race is about to begin...") - - while player1 < 100 and player2 < 100: - # Generate random numbers between 1 and 6 for each player - player1_roll = random.randint(1, 6) - player2_roll = random.randint(1, 6) - - # Update positions of the players - player1 += player1_roll - player2 += player2_roll - - # Display the positions of the players - print("Player 1:", "#" * player1) - print("Player 2:", "#" * player2) - print() - - # Pause for a moment between each roll - time.sleep(0.5) - - if player1 >= 100 and player2 >= 100: - print("It's a tie!") - elif player1 >= 100: - print("Player 1 wins!") - else: - print("Player 2 wins!") - -race()