The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C++ Code
Posted by: matt2 | July 21, 2010 @ 11:25pm
C++ Code
[
Download
]
#include <iostream> #include "shop.h" //#include "character_base.h" //#include "battle.h" int isPlaying = 1; int gameOptions = 0; shop gShop; void ingame_menu() { do { //gShop = new shop; std::cout << "\n\n1 = Shop \n2 = Battle \n3 = Rest \n4 = Leave Arena"; std::cout << "\n\nGladiator, what would you like to do? "; std::cin >> gameOptions; switch (gameOptions) { case 1: //GO TO SHOP.h gShop.shop_menu(); gameOptions = 0; break; case 2: // character_base player; //character_base enemy; //battle playerbattle; // playerbattle.battle(enemy, player); break; case 3: //REST break; case 4: isPlaying = 0; break; default: std::cout << "\nInvalid choice, Gladiator. \n"; break; } }while (gameOptions > 4 || gameOptions < 1); /* If game options is outside the bounds of the question it will catch it and it back at the user, making them try again */ }//ingame_menu ends void main_menu() { std::cout << "\n Welcome to the Arena!\n\n"; std::cout << " Will you be fighting today, Gladiator?\n\n"; std::cout << "1 = Enter the Arena \n2 = Go Home "; std::cin >> isPlaying; switch (isPlaying) { //Start of switch case 1: /* Player decides to take part in the arena battles and is passed onto the ingame menu */ ingame_menu(); break; default: /* If the player enters anything other than 1 They do no not want to take part in the arena battles therefore the program will close */ isPlaying = 0; break; } // End of isPlaying switch } int main() { do { main_menu(); }while (isPlaying == 1); /* Unless specificly told the program will not close due to this dowhile loop. Control = isPlaying */ return 0; }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.55 / 8
31 Votes
http://codebin.yi.org/752
page generated in 0.00 seconds