winglide
Legacy Member
Ok, ik ben dus bezig me een klein text based rpg spelekke.
Alles werkte perfect, tot ineenkeer dak et niemeer kon compile.
Ier ist script:
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int answer1=0;
string strName;
SetConsoleTitle("Book of dreams");
cout << "Hello noble traveller," << endl;
cout << "What's your name? ";
cin >> strName;
cout << "Hello " << strName << "!\n";
cout << "Ok, now for the history:" << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You grew up in a little town named: minrod." << endl;
cout << "You lived there for whole your live now," << endl;
cout << "Nothing really exiting ever happened," << endl;
cout << "Until today...." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You wake up , like any other day , in your own trusted bed" << endl;
cout << "But still, you sense that there is something wrong" << endl;
cout << "You step out of bed and get dressed ," << endl;
cout << "After supher , you go back to you room to do some studiyng." << endl;
cout << "But what you find there is the least you would have taught to find on your desk." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "|--------------------------|" << endl;
cout << "|///////////THE////////////|" << endl;;
cout << "|//////////////////////////|" << endl;
cout << "|///////////BOOK///////////|" << endl;
cout << "|//////////////////////////|" << endl;
cout << "|///////////OF/////////////|" << endl;
cout << "|//////////////////////////|" << endl;
cout << "|//////////Dreams//////////|" << endl;
cout << "|--------------------------|" << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You look at the big blue book while poundering about" << endl;
cout << "from whom the book is and how it came there," << endl;;
cout << "should i unravell its secrets by opening it?" << endl;
cout << "after thinking it over you think it is wise to open it up" << endl;
cout << "so, you open the book and what you see is..." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "Nothing!" << endl;
cout << "Just a bunch of white pages." << endl;;
cout << "Maybe my mother bought me a diary or somekind." << endl;
cout << "But why the strange name :The Book of Dreams?" << endl;
cout << "without thinking any further , you decide to ask your mother about it." << endl;
cout << "So, you grasp the book by its top end ," << endl;
cout << "BUT THEN SUDENLY..." << endl;
}
}
}
}
system("PAUSE");
return EXIT_SUCCESS;
}
Het geeft deze foutmelding:
C:\Dev-Cpp\bod.cpp In function `int main()':
80 C:\Dev-Cpp\bod.cpp syntax error at end of input
Alles werkte perfect, tot ineenkeer dak et niemeer kon compile.
Ier ist script:
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int answer1=0;
string strName;
SetConsoleTitle("Book of dreams");
cout << "Hello noble traveller," << endl;
cout << "What's your name? ";
cin >> strName;
cout << "Hello " << strName << "!\n";
cout << "Ok, now for the history:" << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You grew up in a little town named: minrod." << endl;
cout << "You lived there for whole your live now," << endl;
cout << "Nothing really exiting ever happened," << endl;
cout << "Until today...." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You wake up , like any other day , in your own trusted bed" << endl;
cout << "But still, you sense that there is something wrong" << endl;
cout << "You step out of bed and get dressed ," << endl;
cout << "After supher , you go back to you room to do some studiyng." << endl;
cout << "But what you find there is the least you would have taught to find on your desk." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "|--------------------------|" << endl;
cout << "|///////////THE////////////|" << endl;;
cout << "|//////////////////////////|" << endl;
cout << "|///////////BOOK///////////|" << endl;
cout << "|//////////////////////////|" << endl;
cout << "|///////////OF/////////////|" << endl;
cout << "|//////////////////////////|" << endl;
cout << "|//////////Dreams//////////|" << endl;
cout << "|--------------------------|" << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "You look at the big blue book while poundering about" << endl;
cout << "from whom the book is and how it came there," << endl;;
cout << "should i unravell its secrets by opening it?" << endl;
cout << "after thinking it over you think it is wise to open it up" << endl;
cout << "so, you open the book and what you see is..." << endl;
cout << "Continue?(1 to confirm) ";
cin >> answer1;
if(answer1 == 1)
{
cout << "Nothing!" << endl;
cout << "Just a bunch of white pages." << endl;;
cout << "Maybe my mother bought me a diary or somekind." << endl;
cout << "But why the strange name :The Book of Dreams?" << endl;
cout << "without thinking any further , you decide to ask your mother about it." << endl;
cout << "So, you grasp the book by its top end ," << endl;
cout << "BUT THEN SUDENLY..." << endl;
}
}
}
}
system("PAUSE");
return EXIT_SUCCESS;
}
Het geeft deze foutmelding:
C:\Dev-Cpp\bod.cpp In function `int main()':
80 C:\Dev-Cpp\bod.cpp syntax error at end of input
. Scrijf dan gewoon if(input != 1) return 0; of zo, ma nie omgekeerd he
. Kan allemaal in pure c++ gecoded worden, behalve consolename
.
lol.