I keep getting a parse error for line 146. It says before '}' which is the end of a do loop... please help i've tried everything.
I keep getting a parse error for line 146. It says before '}' which is the end of a do loop... please help i've tried everything.
You probably forgot a semicolon. Post your code so we can help more.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
It's line 146.. parss error before '}'
I would post the code but I couldn't find the code tag.
You aren't using a do loop properly. The proper way to use it is:
Code:do { Code to loop through... } while ( Condition );
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Thanks allot, I don't know why I missed it. I eaven mensioned the } was the end of a do-loop. It just went right over my head ,oh well.
Here's the new source.. I still have lots of things to work out( choice 4, I'm using too many variabls) Mainly because this came from a previous allmost idintical game. But I realized to get more then two players would be hard the way I was doing it. So I came up with thit from the existing code.
Last edited by zornthrohacker; 06-16-2003 at 06:15 AM.
its the number ( # ) symbol next to php and imgI would post the code but I couldn't find the code tag.
I've often thought it would help to change that to "CODE" instead...
Edit: Looking briefly through your code, I see at least one thing that could be done better. I don't see why you need to make x=q, when you could just use q.
Code:int q=0; //int x; <--declare it in a loop cin>>q; //x=q; <--die! do { float pq[x]; /* etc... */ for (int x=0;x<q;x++) { pa[x] = 0; /* etc. */ }
Last edited by JaWiB; 06-15-2003 at 08:10 PM.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Thanks, as I said before this code came frome some of my preveous code and I havn't weeded everything out.
I updatd the code 2 posts above.
I've found a new problem thoe. The iner most do-loop should... continue while 2 or more players have more then 2 states.
Code:do { system("CLS"); for (x=0;x<q;x++) { r1= 1+rand() %5; ... } while(1)//somehow while >1players has>0 states
Last edited by zornthrohacker; 06-16-2003 at 06:44 AM.
im thinking something along the lines of having a state class. it could have a variable named "ownedBy" or something, and then have like:
anyways i have to eat now, maybe ill add more laterCode:enum OWNER { PLAYER1, PLAYER2, PLAYER3 }; class state { ... private: OWNER whatever; };
I can't do any modifications to the source because my computer I programm with got water in it.. I live on a hill but water came in the walls. I'm posting with my dad's computer right now, and he dosn't want anything installed or downloaded.
Anyhow it just needs to dry out another 3-5 days and if it dosn't work my hardrive should be fine. If not I'll just download the source I posted . Anyhow I'm going to be gone for till next saturday.
Last edited by zornthrohacker; 06-21-2003 at 06:14 AM.