Help on Improving

This is a discussion on Help on Improving within the C++ Programming forums, part of the General Programming Boards category; Hello, I am new to this forum, and I am interested on making games. I have started with making a ...

  1. #1
    Registered User
    Join Date
    May 2005
    Location
    Texas
    Posts
    103

    Help on Improving

    Hello, I am new to this forum, and I am interested on making games. I have started with making a board game or something similar to it. Can someone help me improve it, and give me ideas for making more chanllenging?? Please.


    Code:
    #include <iostream>
    #include <ctime>
    #include <cstdlib>
    
    using namespace std;
    
    int main() {
    
    cout<<" THIS IS A BOARD GAME, PLAY WELL GRASSHOPER"<<endl;                                         
    
    int die;
    const int LOW=1;
    const int HIGH=6;
    
    time_t seconds;
    time(&seconds);
    srand((unsigned int)seconds);
    die=rand()%(HIGH-LOW+1)+LOW;
    cout<<"Do you want to roll first?"<<endl;
    int first_player=0;
    int second_player=0;
    char answer;
    cin>>answer;
        switch(answer)
        {
        case 'y':
        cout<<"You roll a "<<die<<" , you move "<<die;
        cout<<" space(s) on the board"<<endl;
        first_player+=die;
        break;
        case 'n':
        cout<<"You choose your opponent to be first"<<endl;
        cout<<"He rolls a "<<die<<" . He moves "<<die<<" space(s) on the board"<<endl;
        second_player+=die;
        break;
        default:
        cout<<"Terminating Program"<<endl;
        cout<<"Error Occured"<<endl;
    	}
    	switch(answer)
    	{
    	case 'y':
    	cout<<"Now is the turn of your opponent"<<endl;
    	die=rand()%(HIGH-LOW+1)+LOW;
    	cout<<"He rolls a "<<die<<" , he moves "<<die<<" space(s) on the board"<<endl;
    	break;
    	case 'n':
    	cout<<"Now is your turn"<<endl;
    	die=rand()%(HIGH-LOW+1)+LOW;
    	cout<<"You roll a "<<die<<" you move "<<die<<" space(s) on the board"<<endl;
    	break;
    	default:
    	{
    	cout<<"Error Occured"<<endl;
    	 }
    	}
    return 0;
    }

    Thanx everyone for even seeing me post.

  2. #2
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    Here is a good place to go if you want to add a little pizzaz to your program http://www.adrianxw.dk/SoftwareSite/index.html
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  3. #3
    Registered User
    Join Date
    May 2005
    Location
    Texas
    Posts
    103
    Thank you, I really appreciate someone replying to my posts, thankyou I was searching for a site like this one!

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Welcome to the boards. If you haven't already done so then please take some time to familiarise yourself with the faq:
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

    Make sure you have a look at the the posting guidelines:
    http://cboard.cprogramming.com/annou...ouncementid=51
    Following the rules will ensure you get a prompt answer to your question.

    Remember, too, that the board has a search facility, a link is at the top of your screen:
    http://cboard.cprogramming.com/search.php
    It will often get you a quicker answer to your questions than waiting for a response to one you have posted.


    If you have any questions about this you may ask or you can contact one of our forum leaders:

    http://cboard.cprogramming.com/showgroups.php
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Improving the efficiency..
    By aaronljx in forum C Programming
    Replies: 11
    Last Post: 12-01-2008, 09:09 AM
  2. Improving Code Interface
    By helloamuro in forum C Programming
    Replies: 20
    Last Post: 05-02-2008, 04:34 AM
  3. Improving my code
    By rwmarsh in forum C++ Programming
    Replies: 14
    Last Post: 07-08-2006, 11:18 AM
  4. Code improving
    By Ideswa in forum Game Programming
    Replies: 6
    Last Post: 04-06-2006, 09:49 AM
  5. Need help with improving my programming
    By Mikro in forum C Programming
    Replies: 7
    Last Post: 01-04-2003, 10:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21