Page 5 of 5

Re: IF Hater Club: Replace The Code

PostPosted: Sun Nov 15, 2009 5:52 pm
by DST
You can optimize this code by sending $10.00 to DST.

Re: IF Hater Club: Replace The Code

PostPosted: Sun Nov 15, 2009 7:58 pm
by Fuzzy
If I send 20.00 will it be double optimised?

Re: IF Hater Club: Replace The Code

PostPosted: Sun Nov 15, 2009 8:05 pm
by DST
Depends on if you send it in USD or that playmoney all the other countries use.

Re: IF Hater Club: Replace The Code

PostPosted: Sun Nov 15, 2009 8:09 pm
by Fuzzy
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.

Re: IF Hater Club: Replace The Code

PostPosted: Sun Nov 15, 2009 8:21 pm
by Bee-Ant
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...

Re: IF Hater Club: Replace The Code

PostPosted: Fri Jul 24, 2015 2:28 pm
by bat78
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)

Re: IF Hater Club: Replace The Code

PostPosted: Thu Jun 16, 2016 12:21 pm
by mariamedina
Code: Select all
    int hpControl(int hpNOW, int hpMAX)
    {
        return max(0, min(hpNOW, hpMAX) ;
    }


This code will help you.

Re: IF Hater Club: Replace The Code

PostPosted: Fri Jun 17, 2016 7:50 pm
by schnellboot
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

Re: IF Hater Club: Replace The Code

PostPosted: Tue Jun 28, 2016 1:29 pm
by Bee-Ant
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));

Re: IF Hater Club: Replace The Code

PostPosted: Thu Jun 30, 2016 7:35 pm
by schnellboot
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

Re: IF Hater Club: Replace The Code

PostPosted: Sat Jul 02, 2016 12:17 pm
by mariamedina
Thanks for re correcting it.