请达人帮我写一个 silly board game 的程序

请达人帮我写一个 silly board game 的程序

题目
请达人帮我写一个 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)
答案
#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
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.