Original Post
I programmed this little gem the other day, it was a testament to all I had learned so far in my research of the programming language that is c++. I have no former programming experience and am very new to this, I understand that I could have passed things as parameters so that I didn't have to duplicate functions, but while I understand that conceptually, I failed to successfully use such an implimentation. If you have advice on how I would successfully implement this game without duplicating functions, I'd greatly, appreciate it. I hope I won't dirty this topic by posting so many lines of code, so I'll just link you to a pastebin of it. I would greatly appreciate any advice, especially with regards to Object Oriented Design, because the material I've been reading has not covered that yet (I am on day 9 of Sam's C++ in 21 days book, I think it is pretty good, though I had my suspicions because of the title). This code is compiled on vc8 (well it does on mine), I can't vouch for other compilers. It's a deterministic game that utilizes luck in the form of a player having a fifty fifty chance, based on a message given them, to successfully block or dodge. My friends and I had fun playing it. I am more interested in design flaws (they must exist in this code because I am very raw to programming and couldn't do things how I intended to do them for lack of a complete understanding of the language's syntax, specifically involving parameters in functions involving classes. I wanted to pass the player's turns like this (Player & attacker) and (Player & attacker) but found it was too troublesome. Anyway I will let you go ahead and look at my program now for advice. I apologize if my language is hard to understand. I am not a native to English. Thank you. I appreciate you reading this, again, and look forward to your criticisms. http://pastebin.ca/90021 is my code.