473,796 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ 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 MorningConcours e()
{
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 1686
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
2038
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 trace the title and price of the book automatically. The system should check whether the book is in the stock or not. If it is not, please let the user to enter again. (b)Allow a customer to buy more than one item from the bookshop.
8
2951
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 RightMouseClicks run as if they were CTRL-RightMouseClicks I have to close the form and reopen it to clear this behavior. Then, after the first CTRL-RightMouseClick, it starts all over again.
7
7123
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 know how to stop it with Cmd2. Here's my code so far: Private Sub Command1_Click() Dim x, y, m m = 1 Do Print m
5
1629
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 depth_beam*/ breadth_beam min_moment max_moment number_increments /*between minimum and maximum moments*/ then calculate bending stress using a loop controlled by relevant input data ^ and should store values of moment maximum and minimum stress...
11
3388
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 to work out how to start on a solution. I have of course used a varienty of componets, mostly radio buttons with "button" appearence.
10
1884
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 using the * character. The program was just for practice but I am having problems. My main problem is, in my program I use 4 functions to change or access two variables in my code. The variables are
5
2534
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. This is so simple in VBA but I have searched help, internet and 2 books and have yet to find a working example for VB 2005 Does anyone have a simple sample of opening a table and adding data. I know this an Access group but some here also...
0
1855
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 handler (which contains the processing code) every minute. The processing itself usually takes no more than a few seconds. Even so, I have a boolean set in the event handler when I'm currently processing information so that only one thread is...
7
2866
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 load.dat file, the program gets stuck if I am putting float variables getting rounded to 8 or 9 decimal places. But runs fine if the float variable getting rounded to 6 decimal places. The code snippet is below:
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10239
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9057
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6796
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.