伪代码的编写

来源:百度知道 编辑:UC知道 时间:2024/05/21 12:49:47
各位大哥 大姐 谁知道这个题的伪代码怎么编写
谢谢了....
问题: You are required to design a complete solution for a simple two player game called
Sticks. The objective of Sticks is to avoid being forced to take the last stick in a pile
of sticks. Each player may take from 1 to a number of sticks (generally 3) on their turn.

1. The design of the solution algorithm must follow a top-down approach, resulting in
a modular solution.
2. The game is to be played between a human player and a computer.
3. Before the game starts the human player is asked who will move first.
4. If the human player is the first to move (s)he will also chose a number between 2
and 4 for the maximum number of sticks each player may take on their turn. If the
computer is the first to move this number is a computer generated random number
(also between 2 and 4)
5. The number of sticks on the initial pile is a computer generated random number
between 5 and 30. This numbe

你必须设计一套完整的解决方案,一个简单的两个玩家的游戏称为
枝。客观的棍棒,是为了避免被迫采取最后坚持在一个桩
的枝。每个玩家可以从1到若干枝(一般为3 )在轮到自己。

1 。设计该解决方案的算法必须遵循自上而下的办法,导致
模块化解决方案。
2 。游戏是要发挥一个人的播放器和一部电脑。
3 。比赛之前,始于人类的选手是问谁会先搬到。
4 。如果人类的选手是第一次提出( ) ,他也将选择若干2
4 ,为人数最多的棍棒每个玩家可能就轮到自己。如果
电脑是第一个提出这个数字是一个计算机生成的随机数
(也与2和4 )
5 。有多少枝于初始桩是一个计算机生成的随机数
5日和30日。这个数字显示出来后,才人数最多的
坚持每个玩家可以采取的是众所周知的。
6 。一旦游戏已经完成了(与胜利,无论是球员还是
计算机的时间) ,玩家可以选择扮演另一种游戏或戒烟。
7 。该算法设计的计算机动议必须是一个'美酒算法' ,即
是时,电脑一定要打赢,除非它是完全不可能的。计算机可能
不是能不能打赢,如果它的确有其一或者如果它的首要之举,但
若干枝对桩令,是不可能取胜的,除非人类的球员
使得一个错误。

我英语太烂...