Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSuperVGA

Posted 10 October 2012 - 02:13 AM

I've been reading a book on C++ and I decided it'd be good practice to code something from scratch instead of outside of the book. I decided it wouldn't be too hard to code a knock off of ZORK...I was wrong Posted Image

It's not that I find it HARD to code a knock off of ZORK but one thing after another keeps adding up and my main.cpp is getting so huge im started to get lost! ...I know, i know, its not THAT big, but for someone like me who is used to coding little things like calculators and other basic things, its pretty long ;p

I know I've probably coded this in a stupid way so If anyone has some suggestions as to how I can split it into other files or reuse parts of code so I don't have to manually re-write things, etc. Maybe some new methods I could check into because idk if this is normal but I feel like I used if, if else, and else statements for practically everything! xD

any advice / critic is appreciated. Thanks!


(lots of code on single line)... if (confused = true) ...(lots of code on single line)


Perhaps here you meant to say if(confused == true) the assignment will (in this case) always evaluate true...

Aside from that: Good job on your first game! I remember my first text adventure; I wanted to make it so advanced, and thus I never finished it.
Keep it up and write lot's of small applications!

#3SuperVGA

Posted 10 October 2012 - 02:13 AM

I've been reading a book on C++ and I decided it'd be good practice to code something from scratch instead of outside of the book. I decided it wouldn't be too hard to code a knock off of ZORK...I was wrong Posted Image

It's not that I find it HARD to code a knock off of ZORK but one thing after another keeps adding up and my main.cpp is getting so huge im started to get lost! ...I know, i know, its not THAT big, but for someone like me who is used to coding little things like calculators and other basic things, its pretty long ;p

I know I've probably coded this in a stupid way so If anyone has some suggestions as to how I can split it into other files or reuse parts of code so I don't have to manually re-write things, etc. Maybe some new methods I could check into because idk if this is normal but I feel like I used if, if else, and else statements for practically everything! xD

any advice / critic is appreciated. Thanks!


(lots of code on single line)... if (confused = true) ...(lots of code on single line)


Perhaps here you meant to say if(confused == true) the assignment will (in this case) always evaluate true...

Aside from that: Good job on your first game! I remember my first text adventure. I wanted to make it so advanced, and thus I never finished it.
Keep it up and write lot's of small applications!

#2SuperVGA

Posted 10 October 2012 - 02:11 AM

I've been reading a book on C++ and I decided it'd be good practice to code something from scratch instead of outside of the book. I decided it wouldn't be too hard to code a knock off of ZORK...I was wrong Posted Image

It's not that I find it HARD to code a knock off of ZORK but one thing after another keeps adding up and my main.cpp is getting so huge im started to get lost! ...I know, i know, its not THAT big, but for someone like me who is used to coding little things like calculators and other basic things, its pretty long ;p

I know I've probably coded this in a stupid way so If anyone has some suggestions as to how I can split it into other files or reuse parts of code so I don't have to manually re-write things, etc. Maybe some new methods I could check into because idk if this is normal but I feel like I used if, if else, and else statements for practically everything! xD

any advice / critic is appreciated. Thanks!


(lots of code on single line)... if (confused = true) ...(lots of code on single line)


Perhaps here you meant to say if(confused == true) the assignment will (in this case) always evaluate true...

#1SuperVGA

Posted 10 October 2012 - 02:09 AM

I've been reading a book on C++ and I decided it'd be good practice to code something from scratch instead of outside of the book. I decided it wouldn't be too hard to code a knock off of ZORK...I was wrong Posted Image

It's not that I find it HARD to code a knock off of ZORK but one thing after another keeps adding up and my main.cpp is getting so huge im started to get lost! ...I know, i know, its not THAT big, but for someone like me who is used to coding little things like calculators and other basic things, its pretty long ;p

I know I've probably coded this in a stupid way so If anyone has some suggestions as to how I can split it into other files or reuse parts of code so I don't have to manually re-write things, etc. Maybe some new methods I could check into because idk if this is normal but I feel like I used if, if else, and else statements for practically everything! xD

any advice / critic is appreciated. Thanks!


(lots of code on single line)... if (confused = true) ...(lots of code on single line)


Perhaps here you meant to say if(confused == true) the assignment will always evaluate true...

PARTNERS