Our crew being at last completed, we left Mukkud on the 27th, and toiled against the stream till sunset. At day-break next morning we were again at the track-ropes; but the most unwearied exertions brought us in the evening no further than Tora Mala, a village distant but five miles from Mukkud. The ascent had now become extremely laborious; though not hazardous, as the obstructions we had to surmount were not in the river᾿s channel, but arose from the wall-like nature of its banks. Quitting the boat here I landed and examined its channel as high as Sharkí, a village on its western shore. To this place I concluded the boat might possibly be dragged; but all hope of being able to advance higher was completely cut off by perpendicular banks several hundred feet high, which a little above Sharkí buttressed the river.
时间: 2023-02-21 15:40:04 浏览: 66
我们的船员最终到齐了,我们在27日离开了Mukkud,一直顶着河流的力量劳作到日落。第二天清晨,我们又回到了跟踪绳上;但是最不疲倦的努力让我们到晚上仍然留在Tora Mala,这个村庄离Mukkud只有五英里。现在的爬升已经变得非常艰难;尽管不是危险的,因为我们必须克服的障碍不在河流的河道中,而是来自于它的堤坝状的岸边。在这里我登陆并检查了它的河道,高达Sharkí,一个位于它西岸的村庄。我认为这个地方的船可能可以被拖动;但是所有的前进希望都被几百英尺高的垂直堤坝完全切断了,它们在Sharkí以上支撑着河流。
相关问题
根据以下要求编写一个python程序1. Description Ship of Fools is a simple classic dice game. It is played with five standard 6-faced dice by two or more players. - The goal of the game is to gather a 6, a 5 and a 4 (ship, captain and crew) in the mentioned order. - The sum of the two remaining dice (cargo) is preferred as high as possible. The player with the highest cargo score wins the round. Example: - In the first round turn, if a player rolls 6 4 3 3 1 (note we five dice at the beginning), the player can bank the 6 (ship), but the rest needs to be re-rolled since there is no 5. - In the second round turn, if the player rolls 6 5 4 4 (four dice, since the 6 from last turn is banked), the player can bank the 5 (captain) and the 4 (crew). The player has three choices for the remaining 6 and 4. The player can bank both and score 10 points, or re-roll one or two of the dice and hope for a higher score. - In the second round turn, if the player instead rolled 4 4 3 1, all dice needs to be re-rolled since there is no 5.程序需要包含一下几个类.The division of responsibility between the different classes is as follows. - Die: Responsible for handling randomly generated integer values between 1 and 6. - DiceCup: Handles five objects (dice) of class Die. Has the ability to bank and release dice individually. Can also roll dice that are not banked. - ShipOfFoolsGame: Responsible for the game logic and has the ability to play a round of the game resulting in a score. Also has a property that tells what accumulated score results in a winning state, for example 21. - Player: Responsible for the score of the individual player. Has the ability, given a game logic, play a round of a game. The gained score is accumulated in the attribute score. - PlayRoom: Responsible for handling a number of players and a game. Every round the room lets each player play, and afterwards check if any player has reached the winning score.
好的,根据您的需求,我为您编写了一个Python程序,如下所示:
```python
import random
class Die:
def __init__(self):
self.value = random.randint(1, 6)
def roll(self):
self.value = random.randint(1, 6)
class DiceCup:
def __init__(self):
self.dice = [Die() for i in range(5)]
self.banked = [False for i in range(5)]
def roll(self):
for i in range(5):
if not self.banked[i]:
self.dice[i].roll()
def bank(self, index):
self.banked[index] = True
def release(self, index):
self.banked[index] = False
def get_values(self):
return [d.value for d in self.dice]
def get_banked_values(self):
return [self.dice[i].value for i in range(5) if self.banked[i]]
def get_unbanked_values(self):
return [self.dice[i].value for i in range(5) if not self.banked[i]]
class ShipOfFoolsGame:
def __init__(self, win_score):
self.win_score = win_score
def play_round(self, dice_cup):
ship, captain, crew = False, False, False
while not (ship and captain and crew):
dice_cup.roll()
values = dice_cup.get_unbanked_values()
if 6 in values and not ship:
dice_cup.bank(values.index(6))
ship = True
elif 5 in values and not captain:
dice_cup.bank(values.index(5))
captain = True
elif 4 in values and not crew:
dice_cup.bank(values.index(4))
crew = True
cargo = sum(dice_cup.get_unbanked_values())
return cargo
class Player:
def __init__(self):
self.score = 0
def play_round(self, game):
dice_cup = DiceCup()
cargo = game.play_round(dice_cup)
self.score += cargo
def has_won(self, win_score):
return self.score >= win_score
class PlayRoom:
def __init__(self, win_score, num_players):
self.win_score = win_score
self.players = [Player() for i in range(num_players)]
self.game = ShipOfFoolsGame(win_score)
def play_game(self):
winner = None
while winner is None:
for player in self.players:
player.play_round(self.game)
if player.has_won(self.win_score):
winner = player
break
return winner
```
以上是一个基本的程序框架,您可以根据您的实际需求进行修改和完善。
Ship of Fools is a simple classic dice game. It is played with five standard 6-faced dice by two or more players. - The goal of the game is to gather a 6, a 5 and a 4 (ship, captain and crew) in the mentioned order. - The sum of the two remaining dice (cargo) is preferred as high as possible. The player with the highest cargo score wins the round.
Sure, here's a possible Python implementation of the game:
```python
import random
def roll_dice(num_dice):
"""Rolls a given number of dice and returns their values."""
return [random.randint(1, 6) for _ in range(num_dice)]
def play_round(num_players):
"""Plays a round of Ship of Fools with a given number of players."""
scores = [0] * num_players
for i in range(num_players):
print(f"Player {i+1}'s turn:")
input("Press Enter to roll the dice...")
dice = roll_dice(5)
print(f"You rolled: {dice}")
if 6 in dice and 5 in dice and 4 in dice:
print("You have a ship, captain, and crew! Good job.")
cargo = sum(d for d in dice if d not in [6, 5, 4])
scores[i] = cargo
else:
print("Sorry, you don't have a ship, captain, and crew.")
max_score = max(scores)
winners = [i+1 for i, score in enumerate(scores) if score == max_score]
print(f"\nRound over. The highest cargo was {max_score}.")
print(f"Player {winners[0]} is the winner!\n")
return winners[0]
def play_game(num_players):
"""Plays a full game of Ship of Fools with a given number of players."""
print(f"\nStarting a game of Ship of Fools with {num_players} players...\n")
winner = None
while winner is None:
winner = play_round(num_players)
print(f"Game over. Player {winner} wins!\n")
# Example usage:
play_game(3)
```
In this implementation, the `roll_dice` function generates a list of random values between 1 and 6, representing the dice rolls. The `play_round` function simulates one round of the game for a given number of players. Each player takes a turn rolling the dice and trying to get a ship, captain, and crew. If successful, their score for the round is the sum of the remaining dice values. If unsuccessful, their score for the round is zero. After all players have taken their turns, the winner of the round is the one with the highest score. The `play_game` function plays a full game of Ship of Fools with a given number of players, continuing until one player wins two rounds.