giftastro.blogg.se

Codereview stack exchange
Codereview stack exchange













codereview stack exchange

Instead, it would be better to instantiate one or more of them and then use member functions to manipulate the object. The MeadowGiant class has all of its code in the constructor. It will save many people lots of time, including and especially you! Don't put everything into the constructor Then cut and paste the whole thing into CodeReview. I'd recommend composing the question offline, using a text editor that changes tabs to spaces. There were so many typos in this code that I had to do quite a number of fixes before the code would even compile.

codereview stack exchange

There are a number of things that I see that may help you improve your code. The code is the same, but the tabs are much cleaner in my compiler so if that's an issue, I'm already on it. The format of my actual code doesn't look like this in my IDE. Std::cout << "You have exited the cave.\n" Std::cout << "You take the cowards way out and leave the cave.\n" Std::cout << "You successfully hit the goblin!\n" << "You head towards the chest and take the spoils\n"Ĭase 1: std::cout << "You find a bastard sword!\n" Ĭase 2: std::cout << "You find an Enchanted Staff!\n" Ĭase 3: std::cout << "You find an Obsidian Dagger!\n" Ĭase 4: std::cout << "You find a Holy Mace!\n" Std::cout << "You have slain the goblin!\n" Int goblinAttack, goblinHP, HP, attack, action1, ability I think that's called a constructor and I'm using it to call my MeadowGiant.cpp down the road. I really don't know a lot of C++ terms so ELIF would be awesome.

Codereview stack exchange how to#

If there is anything wrong or things that could change and improve I'd very much appreciate if you could walk me through what was wrong, why it was wrong and how to prevent it from happening again. I am a 100% complete newbie with maybe 2 weeks of C++ experience so I'd love some lessons on what I did wrong and how I can improve! I mainly just use a lot of switch statements and if statements.

codereview stack exchange

This is a text-based RPG game I've made in C++ and would love some review on it.















Codereview stack exchange