473,466 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

stuck on a very simple c++ program

i am a very beginner programmer and am stuck on a very simple problem.
I am trying to make a game where the user
is presented with a scenerio and options. ie

you are standing in the parking lot
a.run
b.go home
c.stay there

when a option is selected a new option is presented.
How do i do this. Here is the code I have so far. I have been on it
for days and i have until saturday. please help. thanks.

#include <iostream>

using namespace std;

void MorningMain()
{
cout<<"You walk into the main building.\n
a. Go left to the computer room.\n
b. Go right to the office.\n
c. Continue ahead into the "concourse".\n
d. Go back out side.\n"
}

void MorningIE()
{
cout<<"You walk into the the I.E. building. A grade eight
student is being shoved
into a locker.\n
a. Help the grade 8\n
b. Go into the art room\n
c. Go into the Shop.\n
d. Go into the Wood Room.\n
e. Go into the washroom.\n
f. Go back out side.\n"
}

void MorningGym()
{
cout<<"You go into the gym and see that there is a pick-up
basketball game
going on.\n
a. Ask \if you can play\n
b. Watch\n
c. Go up to the weight room\n
d. Go back out side\n"
}

void MorningComp()
{
cout<<"You go into the computer room. There seems to be alot
to do here.\n
a. Go on a computer\n
b. Talk to Mr.Schulting\n
c. Take an Optical Mouse\n
d. Go back into the concourse\n"
}

void MorningConcourse()
{
cout<<"You walk into the "concourse", still not
understnading why they can't
just call it the cafeteria or something.\n
a. Sit with your friends\n
b. Go to the library\n
c. Go to computer room\n
d. Go to \class early\n
e. Go to the bathroom\n
f. Go back outside\n"
}

void HitGirl()
{
cout<<"You walk back outside and run into a girl and knock
all of her books
down.\n
a. Say sorry help her pick them up\n
b. Pretend nothing happened and \continue on\n"
}

void PlayBall()
{
cout<<"The other players put you on a team and let you play.
They pass you the ball
and you...\n
a. Shoot\n
b. Drive \for the hoop\n
c. Pass\n
d. Throw it up into the weightroom\n"
}

void WatchBall()
{
cout<<"You sit in the bleachers and watch the game. Soon the
bell goes and
you...\n
a. Go to \class\n
b. Skip \class\n"
}

void Weightroom()
{
cout<<"You walk up to the weightroom, throw a couple weights
on to a bar and
\try to bench them, and because you your great 'strength', you get
stuck
and can't lift the weights off of your self.\n
a. Yell \for help\n
b. Keep trying to get the weights off\n
c. Wait \for someone to show up\n"
}

void MorningFight()
{
cout<<"You come outside and see a bunch of people walking
towards the back of
the school. Looks like theres going to be a fight.\n
a. Go watch\n
b. Report the fight to the office\n
c. Mind your own bussiness and \continue on\n"
}

void IEFight()
{
cout<<"You tell the guys shoving the kid into the locker to
go get a life.
They think your an idiot, but they listen and they leave.
By the time you pull the poor kid out, the bell goes.\n
a. Go to \class\n
b. Skip \class\n"
}

void MorningArt()
{
cout<<"You go into the art room and see Mr.Mocci working the
the backroom.\n
a. Talk to him\n
b. Take some art supplies\n
c. Leave\n"
}

void MorningShop()
{
cout<<"You go into the 'Shop' and see that no one is in
there, but you see the
"Rattler Racing Car". You...\n
a. Go over to the car\n
b. Steal some tools\n
c. Leave\n"
}

void MorningWood()
{
cout<<"You walk into the 'Wood Room' and see a bunch of
students building a table.\n
a. Go over to the kids\n
b. Use some machines\n
c. Leave\n"
}

void IgnoreKid()
{
cout<<"You ignore the people shoving the kid into the locker
and come back outside. You...\n
a. Go to the main building\n
b. Go to the gym\n
c. Go back into the I.E. Building\n"
}

void GetPunched()
{
cout<<"You tell the guys pushing the kid around to stop, and
one of them punches you in
the face and starts pushing you around in the circle too. So much
\for, 'Safe Schools'.
Mr. Sutherland comes outside and breaks it up, but only after you get
a bloddy nose.\n
a. Go to the main building\n
b. Go to the gym\n
c. Go to the I.E. building\n
d. Go to a washroom and wash all the blood\n"
}

void IgnoreCircle()
{
cout<<"You see that they are pushing a kid around in a
circle and beating him. You decide that
there is no point in saying anything because you'll end up with that
poor kid.\n
a. Go to the main building\n
b. Go to the gym\n
c. Go to the I.E. building\n"
}

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 17 '05 #1
1 1672
jessebasketball wrote:
i am a very beginner programmer and am stuck on a very simple problem.
I am trying to make a game where the user
is presented with a scenerio and options. ie

you are standing in the parking lot
a.run
b.go home
c.stay there


Look for the function getch(). And if you don't mind me saying, you
could consider removing all those function in favor of data array.
Your main display function would have a paramater which is a state of
the game based on which it would display text, and read output, and
return the new state. Your main() would just loop until specified
states are reached.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: JT | last post by:
Help me the following C++ question: Write a program to help a local bookshop automate its billing system. The program should do the following: (a)Let the user enter the ISBN, the system will...
8
by: MLH | last post by:
I use a mouse-down procedure to trap right mouse clicks and CTRL-Right mouse clicks. Running the procedure must put honey or some other sticky substance into my keyboard because subsequent...
7
by: steve marchant | last post by:
trying to learn VB6. Simple counting loop which counts to 8 in 1 sec intervals, then starts from 1 again and repeats. Have two Command buttons on the form. Cmd1 starts the counting, and I need to...
5
by: yojimbo2005 | last post by:
hey all, as part of my computing module i have been asked to create a program that will promp the user for the following: depth_beam /* i.e fprintf etc "enter value of beam" then fscanf %lf...
11
by: Peted | last post by:
Im using c# 2005 express edition Ive pretty much finished an winforms application and i need to significantly improve the visual appeal of the interface. Im totaly stuck on this and cant seem...
10
by: Cliff | last post by:
Greetings, I have been trying to teach myself C++ over the past few weeks and have finally came across a problem I could not fix. I made a simple program that prints out a square or rectangle...
5
by: Karl | last post by:
I normally only use A2000 but I need to do a little project in VB2005 But I can't figure out how to open the backend Access table in code and add data using code. I don't need to bind to a form....
0
by: =?Utf-8?B?QmlsbEI=?= | last post by:
This is a tough one... My Windows Service app periodically performs some processing on new entries to a SQL Server database table. It uses a simple System.Timer to call the Elapsed event...
7
by: alphasahoo | last post by:
Hi I am working on a program which writes the output a SQL select statements from number of source tables first to a load matrix and then writes to a load.dat file. But while writing to the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.