online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import sys, os Gamestart=0 prologue=0 FinalClassMage=0 dragonhealth=10 FinalClassKnight=0 ClassKnight=[] ClassMage=[] def clear_screen(): os.system('cls' if os.name == 'nt' else 'clear') PrologueMage="The sun is dimming, fading, slowly absorbing itself; as a sorcerer, you expected this, it's a reoccuring cataclysmic event spanning eons\nThe only known object capable of refueling the sun is 'The Essence of Fire'; only found in the lands of ash.\nYou start your journey at its gates after closing your portal, leather boots crunching the ash beneath you, already caked in ash." PrologueKnight="The sun is dimming, fading.\nYou are tasked by your king with obtaining, and retrieving an object called 'The Essence of Fire'; only found in the lands of ash.\nYou start your journey at its gates after a long ride inside a carriage gifted to you for your journey. \nYour metal greaves crunching the ash beneath you, already caked in ash" print("\t============================\n\t=======The Last Ember=======\n\t============================") while Gamestart==0: TitleChoice=input("Will You Proceed?\n(Yes/No): ") if TitleChoice in ["Y","y","Yes","yes","YES"]: Gamestart=Gamestart+1 elif TitleChoice in ["No","N","no","n","NO"]: print("\nGoodbye") sys.exit() else: print("\nPlease enter Yes or No\n") clear_screen() while FinalClassKnight==0 and FinalClassMage==0: if Gamestart==1: print("\n\nCharacter Creator:\n\nKnight: A renowned knight with high defence and health\n\tadorned with plate armor, starts with a helmet, large broadsword, bow, and shield\n\nMage: A trained sorcerer of the dark arts, dressed in a shadowed cloak\n\tstarts with a staff, dagger and spells") Class=input("\nPlease choose your class: ") if Class in ["Knight","knight","KNIGHT","K","k"]: print('\nYou have chosen the Knight') FinalClassKnight+=1 elif Class in ["Mage","mage","MAGE","M","m"]: print('\nYou have chosen the Mage') FinalClassMage+=1 else: print("Please enter Knight or Mage") if FinalClassKnight==1: ClassKnight=[["Helmet"],["Cuirass"],["Vambraces"],["Metal Greaves"],["Broadsword"],["Heavy Shield"],["Bow and Arrows"]] if FinalClassMage==1: ClassMage=[["Shadowed Cloak"],["Leather Boots"],["OldStaff"],["Spell - Black Lightning"],["Spell - WindVortex"],["Spell - Life Siphon"],["Spell - Meteor"]] clear_screen() if FinalClassMage==1: print("\nPROLOGUE\n--------") print(PrologueMage) elif FinalClassKnight==1: print("\nPROLOGUE\n--------") print(PrologueKnight) while prologue==0: prologuechoice=input("\nAre you ready to move to the final boss? Y/N:") if prologuechoice in ["Y","y","Yes","yes","YES"]: prologue+=1 else: continue clear_screen() print("After a long trek through the ashed lands, you enter an old burnt gladiators arena. \nSpires of old ash marble surrounding you in a circle. Before you lies a dragon, its name unknown.\nIts chest is glowing, bright with heat. Your goal lies within. Its heart. \nIt stands tall as it looks down at you, steam flowing from its nostrils\n") while dragonhealth>0: if FinalClassKnight==1: while dragonhealth>0: print("The dragons remaining health is: ",dragonhealth,"\n") print("1-Slash at its legs with your Broadsword") print("2-Cleave at its Head") print("3-Shoot arrows at its head") print("4-Bash its head with your Shield") print("5-Climb it and slash at its neck") print("6-Look at Inventory") try: choice=int(input("Please choose an option out of the menu: ")) except: print("Invalid Input") continue if choice==1: clear_screen() print("\nYou charge at its large form and slash its thick legs, forcing it to pull back, its teeth bared as it snaps at you, eyes furious\n") dragonhealth-=1 elif choice==2: clear_screen() print("\nYou gauge its behavior and on its next snap, you dodge, slamming the blade of your broadsword into its head,it squeals loudly\n") dragonhealth-=2 elif choice==3: clear_screen() print("\nDeciding to be safe, you fire a volley of arrows into its head, running to keep your distance\n") dragonhealth-=1 elif choice==4: clear_screen() print("\nIt snaps at you, grabbing your arm in its jaws, you can feel it crushing the plate armor,\nluckily you smash its head with the brunt of your shield, knocking it away\n") dragonhealth-=1 elif choice==5: clear_screen() print("\nIt tries to swipe you with its scaled tail, but you jump on it, clambering up its neck and slamming your blade into it\n") dragonhealth-=3 elif choice==6: clear_screen() for i in range(len(ClassKnight)): print(ClassKnight[i],"\n") else: print("Please select a menu option") elif FinalClassMage==1: while dragonhealth>0: print("The dragons remaining health is: ",dragonhealth,"\n") print("1-Attack with staff") print("2-Cast Black Lightning") print("3-Summon Wind Vortex") print("4-Siphon some of its life") print("5-Summon a Meteor") print("6-Look at Inventory") try: choice=int(input("Please choose an option out of the menu: ")) except: print("Invalid Input") continue if choice==1: clear_screen() print("\nYou gauge its behavior and on its next snap, you dodge, slamming the brunt of your staff into its head,it squeals loudly, but more annoyed than anything\n") dragonhealth-=1 elif choice==2: clear_screen() print("\nAfter numerous dodges and running, you find room to raise your hands and cast black lightning. \nIt cracks down onto the beast, slamming it to the ground, clearly more winded now\n") dragonhealth-=2 elif choice==3: clear_screen() print("\nYou open your spellbook to cast more intense incants. The wind erupts from beneath the beast, lifting it up and twirling it around, \nbefore slamming it back to the stone ground\n") dragonhealth-=3 elif choice==4: clear_screen() print("\nSpellbook open, you lift it up, black ethereal strands latch to the beasts body like leeches, siphoning life from its body, it visibly begins to age rapidly\n") dragonhealth-=2 elif choice==5: clear_screen() print("\nSpellbook wide open, the skies darken, the beast looks at the sky in fear as a boulder of flame crashes down into its body, \na loud crunching noise is heard as it falls, heavily injured\n") dragonhealth-=5 elif choice==6: clear_screen() for i in range(len(ClassMage)): print(ClassMage[i],"\n") else: print("Please select a menu option") clear_screen() if dragonhealth<=0: if FinalClassKnight==1: print("The dragon barrels at you, attempting one final attack. It cries in pain, breathing heavily as it crashes into the wall instead. \nIt feels its strength leaving its body. The dragons chest slowly loses its glow. \nAfter its death, you take its heart to the royal sorcerors, who use magic to restore the sun with its essence.") print("\n\t============================\n\t=========The End============\n\t============================") elif FinalClassMage==1: print("The dragon is already panting, limping towards you with fury. You siphon the last of its health, and take its burning heart from the husk of its scaled body. \nWith one final incant, the heart fades into embers and up into the sky. The sun regaining new light in the process.") print("\n\t============================\n\t=========The End============\n\t============================")

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue