Software Development |
| |

| | Thread Tools |
|
11-Dec-2002, 11:29 AM
#1 |
| Hello, everyone! I have an URGENT request to ask of anyone who will help me. You see, I need someone to reply to this message giving me the source code for a simple C++ Yahtzee game. The game is text-based, one-player, and going to be built and compiled with Microsoft Visual C++ Version 6.0. Here is a description of the game: 1. The game is a Yahtzee game. 2. The game is a one-player only game. 3. The game is text-based. 4. The game only needs to use the following categories for points: A. 1's = 1 point per die that equals 1 B. 2's = 2 points per die that equals 2 C. 3's = 3 points per die that equals 3 D. 4's = 4 points per die that equals 4 E. 5's = 5 points per die that equals 5 F. 6's = 6 points per die that equals 6 G. Small Straight = Must have one of these sets of dice: 1, 2, 3, 4 or 2, 3, 4, 5, or 3, 4, 5, 6. Points equals the total of the values of the 4 dice in the small straight. H. Large Straight = Must have one of these sets of dice: 1, 2, 3, 4, 5 or 2, 3, 4, 5. Points equals the total of the values of the 5 dice in the large straight I. Full House = Must have 2 of one kind and 3 of another. Worth 25 points. J. Yahtzee = All dice must be equal to each other. Worth 50 points. K. Second Yahtzee = Same as Yahtzee, but can only be worth zero if Yahtzee has not been used yet. L. 3 of a kind = must have 3 like dice. Points equals the total of the values of the three like dice. M. 4 of a kind = must have 4 like dice. Points equals the total of the values of the four like dice. (NOTE: If user chooses to place his/her points in a point slot and the dice he/she has will not allow her to gain any points in that slot, a zero is placed there.) 5. The game need to do the following thing in the order I list them. A. Program tells 5 random numbers that could be rolled by a die. B. Program asks which of the dice user wants to hold. C. Program remembers the values of the dice that are held. D. Program gives new values to dice that are not held. E. Program asks which of the dice user wants to hold. F. Program assigns new values to dice that are not held. G. Program asks which of the diece user wants to hold. H. Programs assigns new values to dice that are not held. I. Program asks which of the 13 point places that the user wants to place their points. J. The place that the user chooses to place their points in can not be used again. K. Program assigns correct amount of points to the place user chose. L. Program begins at step A again. M. Program continues to run until all of the point places are used up. N. Once step M occurs, program will display the amount of points the user earned. Program will ask user whether or not the program is to restart. O. If input is y, program restarts. If input is n, program terminates. If input is not y or n, question is asked again until valid input is recieved. --------------------------------------------------------------- If you are willing to help me, remember one thing: I need the entire program, not just a part of it. Thanks, everyone! Jashen ![]() |
12-Dec-2002, 07:51 PM
#3 | |||||
| ______________________________________________ I doubt anyone here is gonna write the game for you, but ya can do a search on www.google.com and prolly find a game to use for a pattern. Search using this (include the quotes): +"yahtzee" +"source" +"c++" Good luck, Mac ![]() |
|
12-Dec-2002, 09:44 PM
#5 |
| Under my instructor's advice, I will tell everyone a little about myself. I am 14 years old and attend a private school. One of my classes is Beginning C++ Programming. This is my first semester in any type of programming. Please understand that my programming skills are not even close to your level. Thanks for understanding. I appreciate your help. ------------------------------------------------------------------------------ My program is so long that I will have to put it into two messages. I already tried it as one message. Here is Part 1 of my program ////Start////// #include <iostream.h> #include <time.h> #include <stdlib.h> void set_seed(); int main() { int die; int die2; int die3; int die4; int die5; int total=0; char a; int extra=205-total; int s1; int s2; int s3; int s4; int s5; int s6; int y; int y2; system("CLS"); cout<<"Enter S to start.\n"; cout<<"Enter E to exit.\n"; cin>>a; switch(a) { case 'S': int b; system("CLS"); die=rand()%6+1; cout<<"You roll the dice. You get: "<<die<<", "; die2=rand()%6+1; cout<<die2<<", "; die3=rand()%6+1; cout<<die3<<", "; die4=rand()%6+1; cout<<die4<<", "; die5=rand()%6+1; cout<<"and "<<die5<<".\n\n\n"; cout<<"Input any integer to continue. "; cin>>b; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Now you must choose which of the point sets you wish to put your points in.\n\n\n"; cout<<"Enter 1 to put your points in the 1's place.\n"; cout<<"Enter 2 to put your points in the 2's place.\n"; cout<<"Enter 3 to put your points in the 3's place.\n"; cout<<"Enter 4 to put your points in the 4's place.\n"; cout<<"Enter 5 to put your points in the 5's place.\n"; cout<<"Enter 6 to put your points in the 6's place.\n"; cout<<"Enter 7 to put your points in the Yahtzee place.\n"; cout<<"Enter 8 to put your points in the Second Yahtzee place.\n\n"; cin>>b; if(b==1) { system("CLS"); if(die==1) { total+=1; } else { system("CLS"); } if(die2==1) { total+=1; } else { system("CLS"); } if(die3==1) { total+=1; } else { system("CLS"); } if(die4==1) { total+=1; } else { system("CLS"); } if(die5==1) { total+=1; } else { system("CLS"); } s1=false; } else if(b==2) { system("CLS"); if(die==2) { total+=2; } else { system("CLS"); } if(die2==2) { total+=2; } else { system("CLS"); } if(die3==2) { total+=2; } else { system("CLS"); } if(die4==2) { total+=2; } else { system("CLS"); } if(die5==2) { total+=2; } else { system("CLS"); } s2=false; } else if(b==3) { system("CLS"); if(die==3) { total+=3; } else { system("CLS"); } if(die2==3) { total+=3; } else { system("CLS"); } if(die3==3) { total+=3; } else { system("CLS"); } if(die4==3) { total+=3; } else { system("CLS"); } if(die5==3) { total+=3; } else { system("CLS"); } s3=false; } else if(b==4) { system("CLS"); if(die==4) { total+=4; } else { system("CLS"); } if(die2==4) { total+=4; } else { system("CLS"); } if(die3==4) { total+=4; } else { system("CLS"); } if(die4==4) { total+=4; } else { system("CLS"); } if(die5==4) { total+=4; } else { system("CLS"); } s4=false; } else if(b==5) { system("CLS"); if(die==5) { total+=5; } else { system("CLS"); } if(die2==5) { total+=5; } else { system("CLS"); } if(die3==5) { total+=5; } else { system("CLS"); } if(die4==5) { total+=5; } else { system("CLS"); } if(die5==5) { total+=5; } else { system("CLS"); } s5=false; } else if(b==6) { system("CLS"); if(die==6) { total+=6; } else { system("CLS"); } if(die2==6) { total+=6; } else { system("CLS"); } if(die3==6) { total+=6; } else { system("CLS"); } if(die4==6) { total+=6; } else { system("CLS"); } if(die5==6) { total+=6; } else { system("CLS"); } s6=false; } else if(b==7) { system("CLS"); if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else { system("CLS"); } if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else { system("CLS"); } if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else { system("CLS"); } if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else { system("CLS"); } if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } y=false; } else if(b==8) { system("CLS"); if(y==false) { if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } } else { system("CLS"); } y2=false; } else { system("CLS"); return main(); } cout<<"You now have "<<total<<" points.\n\n"; cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Now you must choose which of the point sets you wish to put your points in.\n\n\n"; if(s1==false) { cout<<" "; } else { cout<<"Enter 1 to put your points in the 1's place.\n"; } if(s2==false) { cout<<" "; } else { cout<<"Enter 2 to put your points in the 2's place.\n"; } if(s3==false) { cout<<" "; } else { cout<<"Enter 3 to put your points in the 3's place.\n"; } if(s4==false) { cout<<" "; } else { cout<<"Enter 4 to put your points in the 4's place.\n"; } if(s5==false) { cout<<" "; } else { cout<<"Enter 5 to put your points in the 5's place.\n"; } if(s6==false) { cout<<" "; } else { cout<<"Enter 6 to put your points in the 6's place.\n"; } if(y==false) { cout<<" "; } else { cout<<"Enter 7 to put your points in the Yahtzee place.\n"; } if(y2==false) { cout<<" "; } else { cout<<"Enter 8 to put your points in the Yahtzee place.\n"; } cout<<"\n\n"; cin>>b; if(b==1) { system("CLS"); if(die==1) { total+=1; } else { system("CLS"); } if(die2==1) { total+=1; } else { system("CLS"); } if(die3==1) { total+=1; } else { system("CLS"); } if(die4==1) { total+=1; } else { system("CLS"); } if(die5==1) { total+=1; } else { system("CLS"); } s1=false; } else if(b==2) { system("CLS"); if(die==2) { total+=2; } else { system("CLS"); } if(die2==2) { total+=2; } else { system("CLS"); } if(die3==2) { total+=2; } else { system("CLS"); } if(die4==2) { total+=2; } else { system("CLS"); } if(die5==2) { total+=2; } else { system("CLS"); } s2=false; } else if(b==3) { system("CLS"); if(die==3) { total+=3; } else { system("CLS"); } if(die2==3) { total+=3; } else { system("CLS"); } if(die3==3) { total+=3; } else { system("CLS"); } if(die4==3) { total+=3; } else { system("CLS"); } if(die5==3) { total+=3; } else { system("CLS"); } s3=false; } else if(b==4) { system("CLS"); if(die==4) { total+=4; } else { system("CLS"); } if(die2==4) { total+=4; } else { system("CLS"); } if(die3==4) { total+=4; } else { system("CLS"); } if(die4==4) { total+=4; } else { system("CLS"); } if(die5==4) { total+=4; } else { system("CLS"); } s4=false; } else if(b==5) { system("CLS"); if(die==5) { total+=5; } else { system("CLS"); } if(die2==5) { total+=5; } else { system("CLS"); } if(die3==5) { total+=5; } else { system("CLS"); } if(die4==5) { total+=5; } else { system("CLS"); } if(die5==5) { total+=5; } else { system("CLS"); } s5=false; } else if(b==6) { system("CLS"); if(die==6) { total+=6; } else { system("CLS"); } if(die2==6) { total+=6; } else { system("CLS"); } if(die3==6) { total+=6; } else { system("CLS"); } if(die4==6) { total+=6; } else { system("CLS"); } if(die5==6) { total+=6; } else { system("CLS"); } s6=false; } else if(b==7) { system("CLS"); if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else { system("CLS"); } if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else { system("CLS"); } if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else { system("CLS"); } if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else { system("CLS"); } if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } y=false; } else if(b==8) { system("CLS"); if(y==false) { if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } } else { system("CLS"); } y2=false; } else { system("CLS"); return main(); } cout<<"You now have "<<total<<" points.\n\n"; cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Now you must choose which of the point sets you wish to put your points in.\n\n\n"; if(s1==false) { cout<<" "; } else { cout<<"Enter 1 to put your points in the 1's place.\n"; } if(s2==false) { cout<<" "; } else { cout<<"Enter 2 to put your points in the 2's place.\n"; } if(s3==false) { cout<<" "; } else { cout<<"Enter 3 to put your points in the 3's place.\n"; } if(s4==false) { cout<<" "; } else { cout<<"Enter 4 to put your points in the 4's place.\n"; } if(s5==false) { cout<<" "; } else { cout<<"Enter 5 to put your points in the 5's place.\n"; } if(s6==false) { cout<<" "; } else { cout<<"Enter 6 to put your points in the 6's place.\n"; } if(y==false) { cout<<" "; } else { cout<<"Enter 7 to put your points in the Yahtzee place.\n"; } if(y2==false) { cout<<" "; } else { cout<<"Enter 8 to put your points in the Yahtzee place.\n"; } cout<<"\n\n"; cin>>b; if(b==1) { system("CLS"); if(die==1) { total+=1; } else { system("CLS"); } if(die2==1) { total+=1; } else { system("CLS"); } if(die3==1) { total+=1; } else { system("CLS"); } if(die4==1) { total+=1; } else { system("CLS"); } if(die5==1) { total+=1; } else { system("CLS"); } s1=false; } else if(b==2) { system("CLS"); if(die==2) { total+=2; } else { system("CLS"); } if(die2==2) { total+=2; } else { system("CLS"); } if(die3==2) { total+=2; } else { system("CLS"); } if(die4==2) { total+=2; } else { system("CLS"); } if(die5==2) { total+=2; } else { system("CLS"); } s2=false; } else if(b==3) { system("CLS"); if(die==3) { total+=3; } else { system("CLS"); } if(die2==3) { total+=3; } else { system("CLS"); } if(die3==3) { total+=3; } else { system("CLS"); } if(die4==3) { total+=3; } else { system("CLS"); } if(die5==3) { total+=3; } else { system("CLS"); } s3=false; } else if(b==4) { system("CLS"); if(die==4) { total+=4; } else { system("CLS"); } if(die2==4) { total+=4; } else { system("CLS"); } if(die3==4) { total+=4; } else { system("CLS"); } if(die4==4) { total+=4; } else { system("CLS"); } if(die5==4) { total+=4; } else { system("CLS"); } s4=false; } else if(b==5) { system("CLS"); if(die==5) { total+=5; } else { system("CLS"); } if(die2==5) { total+=5; } else { system("CLS"); } if(die3==5) { total+=5; } else { system("CLS"); } if(die4==5) { total+=5; } else { system("CLS"); } if(die5==5) { total+=5; } else { system("CLS"); } s5=false; } else if(b==6) { system("CLS"); if(die==6) { total+=6; } else { system("CLS"); } if(die2==6) { total+=6; } else { system("CLS"); } if(die3==6) { total+=6; } else { system("CLS"); } if(die4==6) { total+=6; } else { system("CLS"); } if(die5==6) { total+=6; } else { system("CLS"); } s6=false; } else if(b==7) { system("CLS"); if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else { system("CLS"); } if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else { system("CLS"); } if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else { system("CLS"); } if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else { system("CLS"); } if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } y=false; } else if(b==8) { system("CLS"); if(y==false) { if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } } else { system("CLS"); } y2=false; } else { system("CLS"); return main(); } cout<<"You now have "<<total<<" points.\n\n"; cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Now you must choose which of the point sets you wish to put your points in.\n\n\n"; if(s1==false) { cout<<" "; } else { cout<<"Enter 1 to put your points in the 1's place.\n"; } if(s2==false) { cout<<" "; } else { cout<<"Enter 2 to put your points in the 2's place.\n"; } if(s3==false) { cout<<" "; } else { cout<<"Enter 3 to put your points in the 3's place.\n"; } if(s4==false) { cout<<" "; } else { cout<<"Enter 4 to put your points in the 4's place.\n"; } if(s5==false) { cout<<" "; } else { cout<<"Enter 5 to put your points in the 5's place.\n"; } if(s6==false) { cout<<" "; } else { cout<<"Enter 6 to put your points in the 6's place.\n"; } if(y==false) { cout<<" "; } else { cout<<"Enter 7 to put your points in the Yahtzee place.\n"; } if(y2==false) { cout<<" "; } else { cout<<"Enter 8 to put your points in the Yahtzee place.\n"; } cout<<"\n\n"; cin>>b; if(b==1) { system("CLS"); if(die==1) { total+=1; } else { system("CLS"); } if(die2==1) { total+=1; } else { system("CLS"); } if(die3==1) { total+=1; } else { system("CLS"); } if(die4==1) { total+=1; } else { system("CLS"); } if(die5==1) { total+=1; } else { system("CLS"); } s1=false; } else if(b==2) { system("CLS"); if(die==2) { total+=2; } else { system("CLS"); } if(die2==2) { total+=2; } else { system("CLS"); } if(die3==2) { total+=2; } else { system("CLS"); } if(die4==2) { total+=2; } else { system("CLS"); } if(die5==2) { total+=2; } else { system("CLS"); } s2=false; } else if(b==3) { system("CLS"); if(die==3) { total+=3; } else { system("CLS"); } if(die2==3) { total+=3; } else { system("CLS"); } if(die3==3) { total+=3; } else { system("CLS"); } if(die4==3) { total+=3; } else { system("CLS"); } if(die5==3) { total+=3; } else { system("CLS"); } s3=false; } else if(b==4) { system("CLS"); if(die==4) { total+=4; } else { system("CLS"); } if(die2==4) { total+=4; } else { system("CLS"); } if(die3==4) { total+=4; } else { system("CLS"); } if(die4==4) { total+=4; } else { system("CLS"); } if(die5==4) { total+=4; } else { system("CLS"); } s4=false; } else if(b==5) { system("CLS"); if(die==5) { total+=5; } else { system("CLS"); } if(die2==5) { total+=5; } else { system("CLS"); } if(die3==5) { total+=5; } else { system("CLS"); } if(die4==5) { total+=5; } else { system("CLS"); } if(die5==5) { total+=5; } else { system("CLS"); } s5=false; } else if(b==6) { system("CLS"); if(die==6) { total+=6; } else { system("CLS"); } if(die2==6) { total+=6; } else { system("CLS"); } if(die3==6) { total+=6; } else { system("CLS"); } if(die4==6) { total+=6; } else { system("CLS"); } if(die5==6) { total+=6; } else { system("CLS"); } s6=false; } else if(b==7) { system("CLS"); if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else { system("CLS"); } if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else { system("CLS"); } if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else { system("CLS"); } if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else { system("CLS"); } if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } y=false; } else if(b==8) { system("CLS"); if(y==false) { if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } } else { system("CLS"); } y2=false; } else { system("CLS"); return main(); } cout<<"You now have "<<total<<" points.\n\n"; cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you diceded not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Now you must choose which of the point sets you wish to put your points in.\n\n\n"; if(s1==false) { cout<<" "; } else { cout<<"Enter 1 to put your points in the 1's place.\n"; } if(s2==false) { cout<<" "; } else { cout<<"Enter 2 to put your points in the 2's place.\n"; } if(s3==false) { cout<<" "; } else { cout<<"Enter 3 to put your points in the 3's place.\n"; } if(s4==false) { cout<<" "; } else { cout<<"Enter 4 to put your points in the 4's place.\n"; } if(s5==false) { cout<<" "; } else { cout<<"Enter 5 to put your points in the 5's place.\n"; } if(s6==false) { cout<<" "; } else { cout<<"Enter 6 to put your points in the 6's place.\n"; } if(y==false) { cout<<" "; } else { cout<<"Enter 7 to put your points in the Yahtzee place.\n"; } if(y2==false) { cout<<" "; } else { cout<<"Enter 8 to put your points in the Yahtzee place.\n"; } cout<<"\n\n"; cin>>b; if(b==1) { system("CLS"); if(die==1) { total+=1; } else { system("CLS"); } if(die2==1) { total+=1; } else { system("CLS"); } if(die3==1) { total+=1; } else { system("CLS"); } if(die4==1) { total+=1; } else { system("CLS"); } if(die5==1) { total+=1; } else { system("CLS"); } s1=false; } else if(b==2) { system("CLS"); if(die==2) { total+=2; } else { system("CLS"); } if(die2==2) { total+=2; } else { system("CLS"); } if(die3==2) { total+=2; } else { system("CLS"); } if(die4==2) { total+=2; } else { system("CLS"); } if(die5==2) { total+=2; } else { system("CLS"); } s2=false; } else if(b==3) { system("CLS"); if(die==3) { total+=3; } else { system("CLS"); } if(die2==3) { total+=3; } else { system("CLS"); } if(die3==3) { total+=3; } else { system("CLS"); } if(die4==3) { total+=3; } else { system("CLS"); } if(die5==3) { total+=3; } else { system("CLS"); } s3=false; } else if(b==4) { system("CLS"); if(die==4) { total+=4; } else { system("CLS"); } if(die2==4) { total+=4; } else { system("CLS"); } if(die3==4) { total+=4; } else { system("CLS"); } if(die4==4) { total+=4; } else { system("CLS"); } if(die5==4) { total+=4; } else { system("CLS"); } s4=false; } else if(b==5) { system("CLS"); if(die==5) { total+=5; } else { system("CLS"); } if(die2==5) { total+=5; } else { system("CLS"); } if(die3==5) { total+=5; } else { system("CLS"); } if(die4==5) { total+=5; } else { system("CLS"); } if(die5==5) { total+=5; } else { system("CLS"); } s5=false; } else if(b==6) { system("CLS"); if(die==6) { total+=6; } else { system("CLS"); } if(die2==6) { total+=6; } else { system("CLS"); } if(die3==6) { total+=6; } else { system("CLS"); } if(die4==6) { total+=6; } else { system("CLS"); } if(die5==6) { total+=6; } else { system("CLS"); } s6=false; } else if(b==7) { system("CLS"); if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else { system("CLS"); } if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else { system("CLS"); } if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else { system("CLS"); } if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else { system("CLS"); } if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } y=false; } else if(b==8) { system("CLS"); if(y==false) { if(die==1 && die2==1 && die3==1 && die4==1 && die5==1) { total+=50; } else if(die==2 && die2==2 && die3==2 && die4==2 && die5==2) { total+=50; } else if(die=3 && die2==3 && die3==3 && die4==3 && die4==3 && die5==3) { total+=50; } else if(die==4 && die2==4 && die3==4 && die4==4 && die5==4) { total+=50; } else if(die==5 && die2==5 && die3==5 && die4==5 && die5==5) { total+=50; } else { system("CLS"); } if(die==6 && die2==6 && die3==6 && die4==6 && die5==6) { total+=50; } else { system("CLS"); } } else { system("CLS"); } y2=false; } else { system("CLS"); return main(); } cout<<"You now have "<<total<<" points.\n\n"; ////END PART 1 OF PROGRAM//////////// Last edited by Jashen : 12-Dec-2002 10:22 PM. |
|
12-Dec-2002, 09:49 PM
#6 |
| //////Start Part Two of Program////////// cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die4=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fifth die, which is "<<die5<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die5=rand()%6+1; } system("CLS"); cout<<"You roll what dice you decided not to keep.\n\n"; cout<<"You now have "<<die<<" ,"<<die2<<" ,"<<die3<<" ,"<<die4<<" , and "<<die5<<".\n\n"; cout<<"Input any integer to continue. "; cin>>a; system("CLS"); cout<<"Do you want to keep your first die, which is "<<die<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your second die, which is "<<die2<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die2=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your third die, which is "<<die3<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { die3=rand()%6+1; } system("CLS"); cout<<"Do you want to keep your fouth die, which is "<<die4<<"?\n\n"; cout<<"1 = YES\n"; cout<<"Anything else = NO\n\n"; cin>>b; if(b==1) { system("CLS"); } else { |




