Thread: Trying to make a simple yazee game...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    15

    Trying to make a simple yazee game...

    For computer class im trying to make a yazee game. Im trying to make it so that when you get more than one of the same number, it will put those off to the side for you, and make new numbers with the remaining slots. So far here is what i haveim pretty new to this stuff)
    Code:
    #include<iostream>
    #include<time.h>
    using std::cout;
    using std::cin;
    using std::endl;
    
    void main()
    {
    	int dice1, dice2, dice3, dice4, dice5, choice;
    	srand(time(0));
    	cout<<" ----- \n";
    	cout<<"|Yazee|\n";
    	cout<<" ----- \n";
    	cout<<"Enter 1 to roll, or 2 to quit.\n";
    	cin>>choice;
    	if(choice==2)
    	{
    		cout<<"Thanks for playing.\n";
    	}
    	if(choice==1)
    	{
    		dice1=1+rand()%6;
    		dice2=1+rand()%6;
    		dice3=1+rand()%6;
    		dice4=1+rand()%6;
    		dice5=1+rand()%6;
    		cout<<"Rolling dice...\n";
    		cout<<" -------------------\n";
    		cout<<"|["<<dice1<<"]-["<<dice2<<"]-["<<dice3<<"]-["<<dice4<<"]-["<<dice5<<"]|\n";
    		cout<<" -------------------\n";
    	}
    	if(dice1==dice2==dice3==dice4==dice5){
    		cout<<"YAZEE!!! YOU WIN!\n";
    	}
    }
    Now if i did anything wrong let me know, but it seems to generate the numbers just fine.

    Is there an easy way to make it so it keeps numbers that are the same, and goes on to random the remaining dice over again? I can see a long way... a looooong way, but the people in my class dont know much so im trying to keep it simple. Any ideas or tips are helpful, thanks. If not i'll have to think up another game.


    &#91;code]&#91;/code]tagged by Salem
    Im special

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    15
    thanks man that helps a lot!
    Im special

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    98
    There still teaching void main () in schools?

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    36
    There still teaching void main () in schools?
    Most teachers are old-fashoined! They prob. do say the difference in using int main and void main but the newbies just get the habbit with void main(for the easy sake!, i guess).
    will be there one day!

    I usually use VStudio 6!

  5. #5
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176
    I don't know about you, but I thought it was Yahtzee, not Yazee.
    Later.
    Last edited by fuh; 01-14-2003 at 03:24 PM.
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

  6. #6
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176
    Don't put
    Rolling dice...
    ||||||||||
    When nothing is loading. It gets annoying for me.
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  2. Simple Game Engine Programming
    By AoA in forum Tech Board
    Replies: 1
    Last Post: 05-26-2006, 12:50 AM
  3. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM
  5. Simple driving game
    By VirtualAce in forum Game Programming
    Replies: 6
    Last Post: 07-06-2004, 09:34 AM