-
February 22nd, 2007, 06:39 AM
#1
Programming Problem.
I have written a game playing program. Unfortuately, it is not working the way I want. Please help, Here is the relevant code.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 22nd, 2007, 06:41 AM
#2
Re: Programming Problem.
Regards,
Ramkrishna Pawar
-
February 22nd, 2007, 07:04 AM
#3
Re: Programming Problem.
or even
Code:
Play = static_cast<bool>(NULL);
Cheers,
Alex
Please rate this post if you find it helpful
-
February 22nd, 2007, 08:01 AM
#4
Re: Programming Problem.
What is Play? What is the way you want and what is actually happening? Did you try to debug it?
-
February 22nd, 2007, 10:04 AM
#5
Re: Programming Problem.
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
February 22nd, 2007, 10:12 AM
#6
Re: Programming Problem.
Gremlin you forgot
Code:
On Error Goto Game_Over
While 1
Play = True
Wend
:Game_over
Play = False
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
God does not play dice with the universe.(A.Einstein)
-
February 22nd, 2007, 10:36 AM
#7
Re: Programming Problem.
Thanks for all of the valuable suggestions. I think I will try
Code:
B= true;
Play =( B & B) | !( B& B);
<ROFL>
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 22nd, 2007, 10:52 AM
#8
Re: Programming Problem.
Originally Posted by TheCPUWizard
Have you looked at MSDN? Try also searching the forums and the FAQs
-
February 22nd, 2007, 11:49 AM
#9
Re: Programming Problem.
Originally Posted by TheCPUWizard
This sounds like you are another one trying to ask us to solve your homework...
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
God does not play dice with the universe.(A.Einstein)
-
February 22nd, 2007, 12:02 PM
#10
Re: Programming Problem.
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.
-
February 22nd, 2007, 12:50 PM
#11
Re: Programming Problem.
All the best games are written in perl. You should probably switch to it too and not waste your time with C.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
February 22nd, 2007, 02:28 PM
#12
Re: Programming Problem.
I was considering writing it in APL, but it all looks like greek to me then.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 22nd, 2007, 03:09 PM
#13
Re: Programming Problem.
Use:
It's faster (because it's obfuscated).
Or, even better:
Code:
++Play; /* even faster */
Note: Removing the comment will give faster code! |33(0z shorter (0D3 1|\|(R3S3 SP33|)
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.
Out of memory happens! Handle it properly!
Say no to g_new()!
-
February 22nd, 2007, 03:40 PM
#14
Re: Programming Problem.
Note: Removing the comment will give faster code!
Will shorting all variables to single letters, and removing all whitespace/linebreaks also make it faster????
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 22nd, 2007, 04:23 PM
#15
Re: Programming Problem.
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
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|