Baseball Simulation

This is a discussion on Baseball Simulation within the C++ Programming forums, part of the General Programming Boards category; Finally, after a week of programming, this program is finished (for now). There are a lot of improvements that still ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    193

    Baseball Simulation

    Finally, after a week of programming, this program is finished (for now). There are a lot of improvements that still need to happen. This is just the first release. I will change things in the future if someone wants me to. Also, if you have a suggestion, please let me know. I have made a future feature list (can be found in "Instructions").

    The object is to score more runs in 5 innings than the computer does. In order to score runs, you must enter a number between 1 and 100. The difference between your guess and the randomly choosen number, determines what your player does. I know some things are not humanly possible like hitting grand slams with back to back hitters, but this program allows you to do this. I have also included a batting chart, which shows what your player will do if the difference is in that range. The computers score will be randomly generated. Well, enough of the talking, let's play some baseball.

    Download It Here (Updated V.01)

    P.S. Remeber the "Const Char to Char Error" thread. Well, that string is used in this program when the computers score is randomly generated and outputted as the game notes. You'll see what I'm talking about.
    Last edited by stickman; 08-29-2004 at 10:01 PM.

  2. #2
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    I tried it but don't know if it's working right since I don't know the rules of baseball.
    However, it looks cool tho, the whole thing overall. The input checking needs to be fixed; it crashes when I input letter instead of digit. Also it does not over to play again after the game is over.
    Keep it up!
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Quote Originally Posted by alphaoide
    I tried it but don't know if it's working right since I don't know the rules of baseball.
    However, it looks cool tho, the whole thing overall. The input checking needs to be fixed; it crashes when I input letter instead of digit. Also it does not over to play again after the game is over.
    Keep it up!
    Thanks for the feedback. The input does crash, but you are supposed to input the number that is next to the team you want. It is a little confusing. I forgot to add the play again after it's over. Adding right now and will update post.

  4. #4
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    Quote Originally Posted by stickman
    Thanks for the feedback. The input does crash, but you are supposed to input the number that is next to the team you want. It is a little confusing. I forgot to add the play again after it's over. Adding right now and will update post.
    *Never* trust user input.
    I did know what to input, btw

    EDIT: You might want to attach the source code as well 'cause people around here don't trust you, or in fact anyone
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Uploading new file with source file, easier to understand instructions, and play again at the finish of a game.

  6. #6
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    .zip file corrupted.. (i was looking forward to playing some b-ball)
    • "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

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Try again. I was probably uploading a new version while you were downloading so the file wasn't complete.

  8. #8
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    awesome game man
    • "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

  9. #9
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Thanks for the feedback. Is there anything that might make it better because I know it's not perfect?

  10. #10
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Fixed a few things making it more realistic, still has some bugs, but it's better than before. I'm now at v.03 and changed the filename so you can't use the link above and its impossible to edit my post so use this link:

    Baseball v.03

  11. #11
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    That game isnt too bad, the glitches (as far as I can see) have been fixed, the game's sound, not bad, keep up the good work, and thanks for the source, its given me a few good little tricks that might come in handy

    sound program, im liking it...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fork, execv, spawn, or something else?
    By DavidP in forum C++ Programming
    Replies: 8
    Last Post: 01-26-2009, 03:25 PM
  2. Role of c++ in simulation software
    By CChakra in forum C++ Programming
    Replies: 9
    Last Post: 11-18-2008, 01:36 AM
  3. Help!For poker game simulation
    By tx1988 in forum C++ Programming
    Replies: 24
    Last Post: 05-25-2007, 09:59 PM
  4. Help with time simulation assignment
    By rakan in forum C++ Programming
    Replies: 3
    Last Post: 10-31-2006, 10:39 AM
  5. need some help with basic simulation
    By JOlszewski in forum C Programming
    Replies: 1
    Last Post: 01-25-2006, 09:36 PM

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