- Devmaster
- → Viewing Profile: Felthorn
Community Stats
- Group Members
- Active Posts 2 (0.01 per day)
- Most Active In General Development (2 posts)
- Profile Views 359
- Member Title New Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
Contact Information
0
Neutral
User Tools
Friends
Felthorn hasn't added any friends yet.
Latest Visitors
No latest visitors to show
Topics I've Started
Question on Do\While
15 February 2013 - 12:15 AM
Hey, I have a (probably really stupid and noobish ) question. Do I need to have a condition for a do\while statment. I've change my game so that it is far simpler, and right now I'm trying to make a room with two doors in it, and I want the game to ask you which door you want to use every time you enter the main room. Any help will be greatly appreciated. Thanks!
Game Help
24 December 2012 - 05:43 AM
Hi all, I need a hand with some code for a text based game. I have loved video games for most of my life and I thought maybe I could make one my self but hit a snag. I need a back function to go back a step in my game. For example if the game asks you if you want to make your own character or use a pre made character and you choose to make your own character. Then the game asks you is this your choice and you say nah I'll use a pre made character, that's where my problem is. It will not show the pre made character things and so I rewrote the code to this:
#include <iostream>
#include "back.h"
using namespace std;
int yesno (int min, int max)
{
int choice1;
do
{
cout << "Please enter one of the above numbers.\n";
cin >> choice1;
cout << endl;
}
while( choice1 < min || choice1 > max);
return( choice1 );
}
void back ()
{
int choice1, i;
char *back[3] = {"Is this your choice?", "1: Yes", "2: No"};
for (i = 0; i < 3; i++)
cout << back[i] << endl;
choice1 = yesno (1, 2);
if (choice1 == 1)
while () {continue};
if (choice1 == 2)
do
{
begin ();
choice = getchoice (1, 2);
cout << endl;
}
while(choice1 == 2);
return (choice1);
}
but it will not work either. Please help anyone. Thanks!
#include <iostream>
#include "back.h"
using namespace std;
int yesno (int min, int max)
{
int choice1;
do
{
cout << "Please enter one of the above numbers.\n";
cin >> choice1;
cout << endl;
}
while( choice1 < min || choice1 > max);
return( choice1 );
}
void back ()
{
int choice1, i;
char *back[3] = {"Is this your choice?", "1: Yes", "2: No"};
for (i = 0; i < 3; i++)
cout << back[i] << endl;
choice1 = yesno (1, 2);
if (choice1 == 1)
while () {continue};
if (choice1 == 2)
do
{
begin ();
choice = getchoice (1, 2);
cout << endl;
}
while(choice1 == 2);
return (choice1);
}
but it will not work either. Please help anyone. Thanks!
- Devmaster
- → Viewing Profile: Felthorn



Find content
Display name history