SA-MP Forums Archive
Best aphorisms you know of using valid code. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Best aphorisms you know of using valid code. (/showthread.php?tid=552125)



Best aphorisms you know of using valid code. - Crayder - 22.12.2014

Well, we see them everywhere, hear them too. For example I say "If at first you don't succeed, try again.", in code that would be like this:
pawn Код:
while(!(succeed=try()));
I wanna see what you guys can all compile here. I know a few more like this:
pawn Код:
if(LifeGivesYou == lemons) MakeLemonade(); //When life gives you lemons, make lemonade.

if (glass.getLevel() == 0.5) //This is a joke, get it? XD
    throw new ContainerTooLargeException(glass + " is twice as big as it needs to be.");

You=true;function BigBrother(){};BigBrother.isWatching=function(y){return y};
BigBrother.isWatching(You) //What's my big brother doing? o.O

Power=a=means=it=an=end=0
Power is not (a, means, it is (an, end)) //"Power is not a means; it is an end." -George Orwell

war=peace=freedom=slavery=ignorance=strength=0
war is peace|freedom is slavery|ignorance is strength //"War is Peace; Freedom is Slavery; Ignorance is Strength;" -INGSOC (also George Orwell)

dont = []; y = 1
dont.count + y or ('chickens'.before('they hatch')) //Don't count your chickens before they hatch! (another idiom)

$all = array('not well', 'not well', 'not well', 'well'); //All is well! (Just a saying)
$end = array_pop($all);
$all = ($end == 'well') ? $end : 'not well';
return true;

assert(life != fair); //Life is not fair. (An opinion of some)

return (Do || !Do) || (there == !try); //"Do. Or do not. There is no try." -Yoda (SW)

//One of my favorites:
return 2 * be || !(2 * be); //"To be or not to be." -Shakespeare (i think, Hamlet right?)
Like none of those (except the first two) would accomplish anything in pawn. You should list as many as you can from any language known. You could also tell us what language it is so we know why it works and what it is supposed to say.


Re: Best aphorisms you know of using valid code. - Diabloa - 22.12.2014

Quote:

givecommand - i want beer
giveplayerorderedthing- beer
playerrecieve beer
player makes happy

I'm still learning this lanaguage, not hard at all.


Re: Best aphorisms you know of using valid code. - CJ101 - 22.12.2014

Код:
if(HadSex == true)
{
    printf("im happy");
}else printf("im lonely");



Re: Best aphorisms you know of using valid code. - SchurmanCQC - 22.12.2014

Your code isn't very nice looking


Re: Best aphorisms you know of using valid code. - Abagail - 22.12.2014

pawn Код:
new stupid[MAX_PLAYERS];
if(stupid[playerid]))
{
     SendClientMessage(playerid, -1, "go away idiot");
     BanEx(playerid, "Is stupid");
     return 1;
}



Re: Best aphorisms you know of using valid code. - SchurmanCQC - 23.12.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
pawn Код:
new stupid[MAX_PLAYERS];
if(stupid[playerid]))
{
     SendClientMessage(playerid, -1, "go away idiot");
     BanEx(playerid, "Is stupid");
     return 1;
}



Re: Best aphorisms you know of using valid code. - cessil - 23.12.2014

new life, love;
new shrek = love = life;


Re: Best aphorisms you know of using valid code. - mamorunl - 23.12.2014

First one could be improved a little:
Код:
if(LifeGivesYou == lemons) MakeLemonade(); //When life gives you lemons, make lemonade.
PHP код:
if($life->getValue() == "lemons") {
  
Lemonade::make();
}
// Thank you Laravel! :D 



Re: Best aphorisms you know of using valid code. - renegade334 - 23.12.2014

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
PHP код:
if($life->getValue() == "lemons") {
  
Lemonade::make();
}
// Thank you Laravel! :D 
What would a static function do here? You'd be better off using a constructor to make a Lemonade object!

PHP код:
if(!empty($life->getLemons())) {
  
$lemonade = new Lemonade();
} 



Re: Best aphorisms you know of using valid code. - Abagail - 23.12.2014

pawn Код:
public OnLifeUpdate(playerid)
{
      if(Lemons[playerid] == true)
      {
            Lemon[playerid] = CreateObject(OBJECT_LEMONADE, 0.0, 0, 0, 0, 0, 0, 0);
            Lemonade[playerid] = true;
      }
      return true;
}