As many posters here are, I am new to C++ programming; and to get to the point, I was tasked by my professor to create a "Who wants to be a Millionaire" game (Standard console text, 0% UInterface)
Before you ask, this is NOT a demand for a completed project or code. I have already finished the game to the best of my knowledge.
Now the reason why I am here; I feel that my lessons in class are proving to be more of a chore than a learning experience, over and over I am tasked to retread Do-while loops and If-else-if series's. It's my second semester now in programming and I feel that there is so much I am not being taught (yet, but its just taking forever to get there).
In any case; This is my code, that should work with (and probably only with) Turbo C++. I have no idea why we still use this outdated software but here it is nonetheless, finished. and I am here to ask the expert programmers among this board for advice, expert simplification on syntax's. I understand I could have taken a shortcut here, or there than making things so simple.
The strange symbols are ASCII art btw.
Code:
#include<iostream.h>#include<conio.h>
int main()
{
beginning:
clrscr();
int num,question;
for(int e=0;e<90;e++){
cout<<"";
}
cout<<"\n\n\n\n\n";
for(int z=50;z>10;z--){
cout<<"зз";}
for(int zx=22;zx>6;zx--){
cout<<" л "; }
for (int i=0;i<40;i++){
cout<<"зз";}
cout<<"\n";
cout<<"\n";
cout<<"\n\t лл лл ллллл ллллл ";
cout<<"\n\t лл лл ллллллллллл ";
cout<<"\n\t лл ллл лл ллл ллл ллл ";
cout<<"\n\t ллллллллллл HO WANTS TO BE A ллл ллл ILLIONAIRE ";
cout<<"\n\t лллл лллл ллл ллл [Drive-To edition]";
cout<<"\n\t\t\t\t ";
cout<<"\n\t\t\t\t \t";
cout<<"\n\t\t\t\t \t";
cout<<"\n\t\t\t\t ";
cout<<"\n\t\t\t\t ";
cout<<"\n\t\t\t\t \t\t\t \n \t\t [Programmed by: ]";
cout<<"\n\n\n";
for(int zd=50;zd>10;zd--){
cout<<"зз";}
for(int zxd=22;zxd>6;zxd--){
cout<<" л "; }
for (int id=0;id<40;id++){
cout<<"зз";}
cout<<"\n \t\t\t [PRESS THE ENTER BUTTON] ";
getch();
againz:
clrscr();
for (int u=0;u<320;u++){
cout<<"л"; }
cout<<"\n\n===============================================================================\n";
cout<<"\n\n\t\t\t INSTRUCTIONS\n";
cout<<"\n 1. Each sucessful choice will give you the NEXT valuable cash prize\n 2. While the first wrong answer prevents you from gaining anymore points!\n 3. You may use LOWER or UPPER case letters!\n";
cout<<"\n\t\t\t [PRESS THE ENTER BUTTON]\n\t\t";
getch();
clrscr();
int points=0;
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [10] [9] [8] [7] [6] [5] [4] [3] [2] [1] \n";
cout<<"\n Every correct answer moves the car above closer to the bank. \n One mistake and the car stops collecting points!\n The game does not end until question 10. \n Get 2 cars to the bank to win the game!\n ";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
getch();
int helper;
clrscr();
cout<<"\n лRead the help file again? (1) Play the game (2) or Exit the program? (3) - ";
cin>>helper;
if (helper==1){
goto againz;}
else if (helper==2){
; }
else{
return 0;}
clrscr();
int lose=0,finals=0,mox=0;
char choice;
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [1] \n";
cout<<"\t Which insect shorted out an early supercomputer\n \t and inspired the term 'Computer bug'?\n\n";
cout<<"\tA: Stag beetle\tB:Roach\n\tC: Giraffe\tD:Moth\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if ((choice=='d')|| (choice=='D')) {
points+=100; }
else{
lose+=1;
mox+=1;
}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл бЪЪб ";
cout<<"\n лл Џ "<<points<<"KЎ ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [2] [1] \n";
cout<<"\tWhich of the following men does not have\n\t a chemical element named after him?\n\n";
cout<<"\tA: Albert Einstein\tB:Niels Bohr\n\tC: Isaac Newton\t\tD:Enrico Fermi\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
int max=0;
if (lose==1){
;}
else if ((choice=='c')|| (choice=='C')) {
points+=100;
}
else {
lose+=1;
}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл бЪЪб ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [3] [2] [1] \n";
cout<<"\tAccording to the Population Reference Bureau, what is the approximate\n\t number of people who have ever lived on Earth?\n\n";
cout<<"\tA: 50 Billion\tB:100 Billion\n\tC: 1 Trillion\tD:5 Trillion\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='b')|| (choice=='B')) {
points+=100;
}
else{
lose+=1;}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ ";
cout<<"\n ллллллллллл бЪЪб ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [4] [3] [2] [1] \n";
cout<<"\tWhich of these zodiac signs is not represented\n\t by an animal that grows horns?\n\n";
cout<<"\tA: Taurus\tB: Capricorn\n\tC: Cancer\tD: Aries\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='c')||(choice=='C')) {
points+=100;
}
else{
lose+=1; }
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [5] [4] [3] [2] [1] \n";
cout<<"\tThe young of which creature is known as a squab?\n\n";
cout<<"\tA: Octopus\tB: Pidgeon\n\tC: Raven\tD: Eagle\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='b')|| (choice=='B')) {
points+=100;
}
else{
lose+=1;
}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [6] [5] [4] [3] [2] [1] \n";
cout<<"\tComplete the title of the James Bond film Sky...\n\n";
cout<<"\tA: High\t\tB: Bullet\n\tC: Falling\tD: Fall\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='d')|| (choice=='D')) {
points+=100;
}
else{
lose+=1;}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл бЪЪб ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [7] [6] [5] [4] [3] [2] [1] \n";
cout<<"\tIn basketball, a shot made outside of the arc\n\t is worth how many points?\n\n";
cout<<"\tA: 1\tB: 3\n\tC: 2\tD: 4\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='b')|| (choice=='B')) {
points+=100;
}
else{
lose+=1; }
clrscr();
cout<<"\n ллллллллл бЪЪб ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [8] [7] [6] [5] [4] [3] [2] [1] \n";
cout<<"\tAccording to Arthurian legend, where did Sir Bedivere\n\t throw the Excalibur when King Arthur died?\n\n";
cout<<"\tA: The Lake\tB: The Mountain\n\tC: The forest\tD: Through Arthur\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='a')|| (choice=='A')) {
points+=100;
}
else{
lose+=1;}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ бЪЪб ";
cout<<"\n ллллллллллл ";
cout<<"\n ллллБББлллл бЪЪб ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [9] [8] [7] [6] [5] [4] [3] [2] [1] \n";
cout<<"\tHow many consoles has Sony Playstation\n\tsold over 2015?\n\n";
cout<<"\tA: 15 Million\tB: 50 Million\n\tC: 20,000\tD: 20 Million\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='d')|| (choice=='D')) {
points+=100;
}
else{
lose+=1;}
clrscr();
cout<<"\n ллллллллл ";
cout<<"\n лл ";
cout<<"\n лл Џ "<<points<<"KЎ ";
cout<<"\n ллллллллллл бЪЪб ";
cout<<"\n ллллБББлллл бЪЪб ";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n [10] [9] [8] [7] [6] [5] [4] [3] [2] [1] \n";
cout<<"\tThe last letter of the Greek Alphabet is...?\n\n";
cout<<"\tA: Sigma\tB: Omega\n\tC: Alpha\tD: Centauri\n";
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t [TYPE [A] or [B] or [C] or [D] only!] ";
cin>>choice;
if (lose>0){
;
}
else if ((choice=='a')|| (choice=='A')) {
points+=100;
}
else{
lose+=1;}
cout<<"\t\t\t[Tallying score press ENTER]";
getch();
clrscr();
cout<<"Let's see your final score... ";
getch();
cout<<"\nDid you win 1,000,000$ ?";
getch();
cout<<"\n\t ллллл ллллллл ллллллл ";
cout<<"\n\t лллллл ллллллллллллллллл ";
cout<<"\n\t ллллллл ллллл ллллл ллллл ";
cout<<"\n\t лллл ллллл ллл ллллл ";
cout<<"\n\t лллл ллллл ллллл ";
cout<<"\n\t лллл ллллл ллллл ";
cout<<"\n\t лллл ллллл ллллл ";
cout<<"\n\t лллл ллллл ллллл ???? ";
cout<<"\n\t лллл ллллл ллллл ? ??? ";
cout<<"\n\t лллл ллллл ллллл ?? ";
cout<<"\n\t лллл ллллл ллллл ?? ";
cout<<"\n\t лллл ллллл ллллл ?? ";
cout<<"\n\t лллл ллллл ллллл ";
cout<<"\n\t ллллл ллллл ллллл ";
cout<<"\n\t ллллллллл ллллл ллллл ?? ";
getch();
if (points==1000){
cout<<"л\n\t\t\t $ ONE MILLION DOLLARS $ бЪЪб";
getch();
cout<<"\n \t Congratulations on reaching the highest score possible. \n\t\t\t Thank you for playing! :)";}
else{
cout<<"л\n\t\t\t You only won "<<points<<"K! бЪЪб";
getch();
cout<<"\n\t You did not win the game, but you managed to bring home "<<points<<"K\n\t\t\t Better luck next time!";}
getch();
clrscr();
cout<<"\n _____________________________________________________________________ ";
cout<<"\n | | ";
cout<<"\n | =================================================================== | ";
cout<<"\n | |\\\\\=-=-=-=-=-=-=-=-{Final programming exam}-=-=-=-=-=-=-=-=/////| |||| ";
cout<<"\n | |///\)===============------------------------================(/\\\\| |||| ";
cout<<"\n | |////\ ))---PLAY FOR UP TO --(( /\\\\| |||| ";
cout<<"\n | |)|//(================/ ONE Million DOLLARS \================)|//(| || ";
cout<<"\n | |{===}=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-{===}| | ";
cout<<"\n | ==================================================================== | ";
cout<<"\n |______________________________________________________________________| ";
cout<<"\n\n\t\t бЪЪб Would you like to play again? ";
cout<<"\n\t (1) RETURN TO TITLE SCREEN (2) READ INSTRUCTIONS (3) EXIT л ";
int champ;
cin>>champ;
if (champ == 1)
{
goto beginning;
}
else if (champ == 2)
{
goto againz;
}
else if (champ == 3)
{
return 0;
}
getch();
}