Best aphorisms you know of using valid code.
#1

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.
Reply
#2

Quote:

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

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

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

Your code isn't very nice looking
Reply
#5

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

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;
}
  • 'playerid' is not set
  • 'stupid' as an array is completely empty
  • You have an extra right circular-bracket in your if statement
  • You are returning while not in a function
Reply
#7

new life, love;
new shrek = love = life;
Reply
#8

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 
Reply
#9

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();
} 
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)