IF Hater Club: Replace The Code

Non-platform specific questions.

Re: IF Hater Club: Replace The Code

Postby DST » Sun Nov 15, 2009 5:52 pm

You can optimize this code by sending $10.00 to DST.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: IF Hater Club: Replace The Code

Postby Fuzzy » Sun Nov 15, 2009 7:58 pm

If I send 20.00 will it be double optimised?
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: IF Hater Club: Replace The Code

Postby DST » Sun Nov 15, 2009 8:05 pm

Depends on if you send it in USD or that playmoney all the other countries use.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: IF Hater Club: Replace The Code

Postby Fuzzy » Sun Nov 15, 2009 8:09 pm

DST wrote:Depends on if you send it in USD or that playmoney all the other countries use.


Thats funny for a country that banks with Parker Brothers Monopoly money.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: IF Hater Club: Replace The Code

Postby Bee-Ant » Sun Nov 15, 2009 8:21 pm

Well, well, the stupid fight starts again...

That depends on what code inside kickDST() i think...
If you have something like walking code :
Code: Select all
x+=direct*walk*speed;

You may add more trigger to it :
Code: Select all
x+=(1>(max(beeant,teh.suck)-min(beeant,teh.suck)))*direct*walk*speed;

And simply type
Code: Select all
kickDST();

To could optimize it, i must see the entire code, the logic or how them work...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: IF Hater Club: Replace The Code

Postby bat78 » Fri Jul 24, 2015 2:28 pm

You can replace every if statement with a macro LOL
Code: Select all
#define notif if // Of course you will be using if through another textual replacement to it

or with a macro function
Code: Select all
#define notif(x) if(x) // Of course you will be using if through another textual replacement to it

or with ternary
Code: Select all
(expression) ? (iftrue) : (else); // Although it is not very recommended as it semantically cannot take advantage of scopes. Commas though. .. and it is not even meant to be used as a conditional statement but a syntax condition

or
a for-loop
Code: Select all
for( ; condition && mutex;) { expression }

or a while-loop
Code: Select all
while(condition && mutex) { expression }

or a do-while loop
Code: Select all
do { expression } while(condition && mutex);

or to exclude the need of mutex/locker:
Code: Select all
for( ; condition;) { expression; break; }

Code: Select all
while(condition) { expression; break; }

Code: Select all
do { expression; break; } while(condition);

or switches
Code: Select all
switch(lvalue)
{
    case rvalue : // must be an integral literal
    { }
}


(Btw I am answering to you from the past)
(Jk.. this message just didn't send back then and it was delivered just now with a delay)
(nested joke)
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: IF Hater Club: Replace The Code

Postby mariamedina » Thu Jun 16, 2016 12:21 pm

Code: Select all
    int hpControl(int hpNOW, int hpMAX)
    {
        return max(0, min(hpNOW, hpMAX) ;
    }


This code will help you.
mariamedina
 
Posts: 3
Joined: Tue Jun 14, 2016 11:59 am
Score: 0 Give a positive score

Re: IF Hater Club: Replace The Code

Postby schnellboot » Fri Jun 17, 2016 7:50 pm

mariamedina wrote:
Code: Select all
    int hpControl(int hpNOW, int hpMAX)
    {
        return max(0, min(hpNOW, hpMAX) ;
    }


This code will help you.

find the error
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: IF Hater Club: Replace The Code

Postby Bee-Ant » Tue Jun 28, 2016 1:29 pm

schnellboot wrote:
mariamedina wrote:
Code: Select all
    int hpControl(int hpNOW, int hpMAX)
    {
        return max(0, min(hpNOW, hpMAX) ;
    }


This code will help you.

find the error

It should be:
Code: Select all
return max(0,min(hpNOW,hpMAX));
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: IF Hater Club: Replace The Code

Postby schnellboot » Thu Jun 30, 2016 7:35 pm

Bee-Ant wrote:
schnellboot wrote:
mariamedina wrote:
Code: Select all
    int hpControl(int hpNOW, int hpMAX)
    {
        return max(0, min(hpNOW, hpMAX) ;
    }


This code will help you.

find the error

It should be:
Code: Select all
return max(0,min(hpNOW,hpMAX));

some expert out there haha
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: IF Hater Club: Replace The Code

Postby mariamedina » Sat Jul 02, 2016 12:17 pm

Thanks for re correcting it.
mariamedina
 
Posts: 3
Joined: Tue Jun 14, 2016 11:59 am
Score: 0 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron