I have written a game playing program. Unfortuately, it is not working the way I want. Please help, Here is the relevant code.
:eek: :D :D :DCode:Play = true;
Printable View
I have written a game playing program. Unfortuately, it is not working the way I want. Please help, Here is the relevant code.
:eek: :D :D :DCode:Play = true;
Try
Code:Play = false;
or even
:DCode:Play = static_cast<bool>(NULL);
What is Play? What is the way you want and what is actually happening? Did you try to debug it?
Please expand on your original Post...
Is Play a UDT, Boolen type, or integer value ????
Have you tried your code in a Module or maybe a Dll Class ..
Maybe you must include some error traps...
Might i sujest:D :D :D :D :DCode:On Error Goto Game_Over
Play = True
:Game_over
Play = False
Gremlin you forgot
Code:On Error Goto Game_Over
While 1
Play = True
Wend
:Game_over
Play = False
Thanks for all of the valuable suggestions. I think I will try
:rolleyes:Code:B= true;
Play =( B & B) | !( B& B);
<ROFL> :D
Have you looked at MSDN? Try also searching the forums and the FAQsQuote:
Originally Posted by TheCPUWizard
;)
Quote:
Originally Posted by TheCPUWizard
This sounds like you are another one trying to ask us to solve your homework...
Why are you trying to make a game playing program? I refuse to give any answers or tips until I know why you are doing this in the first place, and after a few messages back and forth which will bump up my posting numbers, then I'll provide information pretty much identical to the two or three prior to my post.
Sad... but true.
All the best games are written in perl. You should probably switch to it too and not waste your time with C.
I was considering writing it in APL, but it all looks like greek to me then. ;)
Use:
It's faster (because it's obfuscated).Code:Play++;
Or, even better:
Note: Removing the comment will give faster code! |33(0z shorter (0D3 1|\|(R3S3 SP33|)Code:++Play; /* even faster */
Will shorting all variables to single letters, and removing all whitespace/linebreaks also make it faster???? :lol:Quote:
Note: Removing the comment will give faster code!
YOUr program is OK Because you set Play To TRUE .True means it play ,So Your Code is Ok .Problem Is Not with This COde .Show us more Code . Too Try Play = 1 or Declare Variable Int i = 0 and do Play = i | !i.
And Next Time post in Right Forum (C++ or VB), General Discussion/Chot-Chat is for Chit-Chat ,and Not Programming
Tanx