作业帮 > 综合 > 作业

用matlab做一个游戏~~急需~谢谢~

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/05/09 04:29:30
用matlab做一个游戏~~急需~谢谢~
用matlab 做一个关于掷骰子的游戏,游戏规则如下:
一共两个人,第一个人先骰子,如果是掷到1的话,不算分,换下一个人掷,如果是2—6的话,就加相应的分,可以选择继续或者停止,如果继续的话,就再掷一次,依次类推,如果掷到1,就换下一个人。如果选择停止,直接到下一个人掷。到100分的人获胜。
做的程序可以和电脑对,可以两个人对,任选其一。
原文是英文的,这是根据我的理解翻译过来的,原文如下:
Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two options: roll - If the player rolls a
1: the player scores nothing and it becomes the next player's turn.
2 - 6: the number is added to the player's turn total and the player's turn continues. hold - The turn total is added to the player's score and it becomes the next player's turn. The first player to score 100 or more points wins.
Example Play
For example, the first player, Ann, begins a turn with a roll of 5. Ann could hold and score 5 points, but chooses to roll again. Ann rolls a 2, and could hold with a turn total of 7 points, but chooses to roll again. Ann rolls a 1, and must end her turn without scoring. The next player, Marissa, rolls the sequence 4-5-3-5- 5, after which she chooses to hold, and adds to her turn total of 22 points to her score.
建议你别买品牌,要买就买拼装机。
我用的是华硕p5kpl-am se的主板的9600GT 512m的显卡牌子七彩虹的就行了CPU最好酷睿双核的
现在市面上的游戏我都玩的起。我用3dmax建模虽然没数,但100w个面应该没问题。电源最好是选高端一点,以后升级免得显卡带不起。