sandboarding experience
class SandboardingExperience:
def __init__(self):
self.sand_dunes = []
self.player_position = 0
def add_sand_dune(self, height):
self.sand_dunes.append(height)
def start_experience(self):
print("Welcome to the Sandboarding Experience!")
while True:
print(f"\nCurrent position: {self.player_position}")
action = input("Enter 'r' to roll the dice or 'q' to quit: ")
if action == 'r':
roll = random.randint(1, 6)
print(f"You rolled a {roll}!")
self.player_position += roll
if self.player_position >= len(self.sand_dunes):
print("Congratulations! You reached the end of the sand dunes.")
break
current_dune = self.sand_dunes[self.player_position]
print(f"You are now at sand dune {self.player_position} with a height of {current_dune}.")
if current_dune > 0:
print("Prepare for an exciting sandboarding ride!")
else:
print("This dune is flat, keep rolling the dice.")
elif action == 'q':
print("Thank you for playing!")
break
else:
top of page
bottom of page
class SandboardingExperience:
def __init__(self):
self.sand_dunes = []
self.player_position = 0
def add_sand_dune(self, height):
self.sand_dunes.append(height)
def start_experience(self):
print("Welcome to the Sandboarding Experience!")
while True:
print(f"\nCurrent position: {self.player_position}")
action = input("Enter 'r' to roll the dice or 'q' to quit: ")
if action == 'r':
roll = random.randint(1, 6)
print(f"You rolled a {roll}!")
self.player_position += roll
if self.player_position >= len(self.sand_dunes):
print("Congratulations! You reached the end of the sand dunes.")
break
current_dune = self.sand_dunes[self.player_position]
print(f"You are now at sand dune {self.player_position} with a height of {current_dune}.")
if current_dune > 0:
print("Prepare for an exciting sandboarding ride!")
else:
print("This dune is flat, keep rolling the dice.")
elif action == 'q':
print("Thank you for playing!")
break
else: