Obviously there is loads of blocks there and gcc is confused, and I can probably make it more clear and fix it with a bit of fiddling around (it is actually a bit more clear inside kate, some of my spacing was lost in the copy pase :/). But as it is to become more complex I was wondering whether I could change to something like this:

> Obviously there is loads of blocks there
No, not really. I counted six. The compiler can handle waaaaaaaaay more than that before it starts to get confused.

> /* a command to run ./game would appear here, if there is such a thing */
> So is that possible? And if so, how?

Yes, but that won't solve your problem.

Looking a little closer:

Code:

char play;
if ( play == "y" )
else if ( play == n )

Several things wrong here. (1) In C and C++, string (character array) comparison is not done with ==; you have to use strcmp. (2) play isn't a string anyway so it won't compare with "y" even with strcmp. play is a single character so it will compare with 'y' and for this you can use ==. (3) n is not defined so play==n will throw an error; do you mean play=='n'?

Code:

scanf ( "% ", &play );

I haven't seen percent-space before. What does that do? Did you mean %c?