请达人帮我写一个 silly board game 的程序
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 06:39:33
请达人帮我写一个 silly board game 的程序
Nancy’s Silly board game is a spectator game and is based on luck.
1.The board has 25 squares numbered 1
to 25.
2.The first of two players to land on square/box number 25 wins the game.The players start off the
board (equivalent to position 0).
3.Each player rolls 2 dice which tells them the number of squares/boxes to move,and flips a coin to determine the direction in which they move:heads player moves forward,tails
player moves backwards.
比如:到了第23格,必须只能投出2点才能到打25,如果大于两点,保持不动,其他情况相同
在0格时,如果硬币投出反面,将保持不动,因为没有负格
程序是这样执行的:
player1 is at box # 7(7) player2 is at box # 0(-12)
player1 is at box # 0(-8) player2 is at box # 0(-10)
player1 is at box # 0(-7) player2 is at box # 8(8)
player1 is at box # 7(7) player2 is at box # 1(-7)
player1 is at box # 0(-7) player2 is at box # 0(-8)
player1 is at box # 10(10) player2 is at box # 0(-4)
player1 is at box # 17(7) player2 is at box # 0(-12)
player1 is at box # 25(8) *** winner!
player1 is at square #25
player2 is at square #0
题目要求需要用function
即硬币正反面,和两个筛子的总数都要用function
Nancy’s Silly board game is a spectator game and is based on luck.
1.The board has 25 squares numbered 1
to 25.
2.The first of two players to land on square/box number 25 wins the game.The players start off the
board (equivalent to position 0).
3.Each player rolls 2 dice which tells them the number of squares/boxes to move,and flips a coin to determine the direction in which they move:heads player moves forward,tails
player moves backwards.
比如:到了第23格,必须只能投出2点才能到打25,如果大于两点,保持不动,其他情况相同
在0格时,如果硬币投出反面,将保持不动,因为没有负格
程序是这样执行的:
player1 is at box # 7(7) player2 is at box # 0(-12)
player1 is at box # 0(-8) player2 is at box # 0(-10)
player1 is at box # 0(-7) player2 is at box # 8(8)
player1 is at box # 7(7) player2 is at box # 1(-7)
player1 is at box # 0(-7) player2 is at box # 0(-8)
player1 is at box # 10(10) player2 is at box # 0(-4)
player1 is at box # 17(7) player2 is at box # 0(-12)
player1 is at box # 25(8) *** winner!
player1 is at square #25
player2 is at square #0
题目要求需要用function
即硬币正反面,和两个筛子的总数都要用function
#include
#include
#include
#include
#include
using namespace std;
int GenerateDice();
int GenerateDirect();
int GetNextPos( int curPos,int direct,int dice);
int main()
{
int dice1,dice2,direct1,direct2,squa1=0,squa2=0,d1,d2,pos1,pos2;
srand(time(0));
cout
#include
#include
#include
#include
using namespace std;
int GenerateDice();
int GenerateDirect();
int GetNextPos( int curPos,int direct,int dice);
int main()
{
int dice1,dice2,direct1,direct2,squa1=0,squa2=0,d1,d2,pos1,pos2;
srand(time(0));
cout
请达人帮我写一个 silly board game 的程序
silly game
手机上的game of life是什么一个程序
桌游board game英文简介
帮我写一个C语言程序.
notice open tape computer / game day recorder board 两个单词配成一个
写一个简单的matlab程序
高手帮我用C语言写一个很简单的程序
我用vb写了一个计算长方形~正方形或三角形面积的程序~
谁能帮我写一个MATLAB程序,是关于人类病毒图像特征提取与识别的?
我写的一个c语言程序,输入5个数字,输入按照从大到小的顺序进行排列,程序如下,调试的时候,告诉我出错
我要打一个三角形的乘法表,只要有右上角.我写的程序有点问题,求错误点.