Adventures in Game Development -- Day 14

So today I'm going to tell you how what the code from yesterday means. Opposed to going line by line, explaining everything, I'm instead just going to explain what the major parts of the program mean.

First, "cin" means console input. This is where people type into the console.

"if(selection == 1)"  means that if the user inputs one as their selection, the following code will execute.

"cout" means console output. This is all of the stuff that gets displayed in the console window.

"Sleep()" is a function I have explained before. Basically, it pauses the output in the console.

"endl;" ends the line. This pretty much simulates pressing the "enter" button in the console output.

Any text between quotation marks are strings.

"else" is what executes if the user types anything other than 1 (more options will be added soon).

"char" is a character.

"||" is an or operator.

Hopefully I've explained everything that may be foreign to someone who doesn't know C++. If you use the above as a guide, you should be able to piece together at least a basic understanding of what is happening. Trust me, none of this is advanced so anyone with at least a little bit of knowledge in C++ won't even need the above information. If you have any trouble understanding what is happening, I recommending reading a basic C++ tutorial online.

11 comments:

Xenototh said...

I want to learn how to do this stuff myself, guess I better start paying attention more. :P

Admin said...

Are you going to post anything that you make?

Jetah said...

Interesting blog. Keep it up!

Anonymous said...

this takes me back to my early days programming. You're doing a great service to others friend

baka1236 said...

thanks for the post. really informatve and i learnt something new today :P

knowbuddy said...

Im with Admin,post some of your stuff!

Pool Fool said...

interesting post but I got lost lol

baka1236 said...

what's with the lack of comments people? :(

baka1236 said...

can't wait for next post m8

Jay Reid said...

Seems cool enough.

Unknown said...

Seems cool though I'm not quite understanding what it is, do you have pictures of it in action?

Post a Comment