Page 1 of 1

Funny code

PostPosted: Mon Oct 27, 2003 9:05 pm
by MyrrhLynn
I'm sure all you computer geeks have come across "fake code" that would never really work but is changed to be funny. So share with us! (I think there is a technical word for this like Codglish or something but I can't think of it.)

Here is mine that a friend made for me when I didn't want to do my Java homework:

if(myJavaAssignment.getHoursRemainingUntilDue() > 12)
{
student.setSlacking(true);
}

PostPosted: Mon Oct 27, 2003 9:46 pm
by TheMelodyMaker
Trying my hand at some quick Visual Basic:

Code: Select all
Sub Redundant()

Call Repetitive()

End Sub


Sub Repetitive()

Call Redundant()

End Sub



(How long until we get a stack overflow here? ^_~ )

PostPosted: Mon Oct 27, 2003 10:04 pm
by LorentzForce
10 print "I'm an idiot"
20 print "/me smacks himself with a hammer"
30 goto 10

and it works.

PostPosted: Wed Oct 29, 2003 7:59 am
by Mithrandir
I have a friend who writes poetry in perl (I'm not making this up) and it's actually pretty good stuff. It was published to the clpm group by Larry one april fools day.

edit: btw, this code works in all versions of perl up to 5.8 (I think).

Code: Select all
 #!/usr/bin/perl
 
 APPEAL:
 
 listen (please, please);
 
 open yourself, wide;
     join (you, me),
 connect (us,together),
 
 tell me.
 
 do something if distressed;
 
     @dawn, dance;
     @evening, sing;
     read (books,$poems,stories) until peaceful;
     study if able;
 
     write me if-you-please;
 
 sort your feelings, reset goals, seek (friends, family, anyone);
 
         do*not*die (like this)
         if sin abounds;
 
 keys (hidden), open (locks, doors), tell secrets;
 do not, I-beg-you, close them, yet.
 
                             accept (yourself, changes),
                             bind (grief, despair);
 
 require truth, goodness if-you-will, each moment;
 
 select (always), length(of-days)
 
 # listen (a perl poem)
 # Sharon Hopkins
 # rev. June 19, 1995

PostPosted: Wed Oct 29, 2003 8:02 am
by Straylight
Wow, that's quite amazing, lol!

PostPosted: Wed Oct 29, 2003 9:49 am
by TheMelodyMaker
What does it do when it's actually run?

PostPosted: Wed Oct 29, 2003 9:53 am
by Mithrandir
Sorry. By 'works' I mean it does not generate any error messages. Feel free to try and run it if you like. On a linux box, save it, chmod 700 it, and ./ it.

The execution of the code is left as an excersise for the reader... :evil: Can you tell I work in education?

PostPosted: Thu Oct 30, 2003 5:52 am
by uc pseudonym
This is just an idea... I'm not too sure quite how to put it best. So I'll do it in QBASIC, the one language I'm actually proficient in:

PRINT "No monitor detected."

PostPosted: Thu Oct 30, 2003 9:36 am
by TheMelodyMaker
I see that that's along the same line as "No keyboard detected; press any key to continue." Or "If you're having trouble with your internet connection, please visit our website for help."

PostPosted: Thu Oct 30, 2003 10:07 am
by Mithrandir
I bought I CD drive one time. The packaging says, "Great to replace your current drive."

The drivers were on a CD-Rom.

PostPosted: Thu Oct 30, 2003 1:11 pm
by uc pseudonym
Oh... man. I'd definitely believe it.

PostPosted: Wed Nov 05, 2003 4:40 pm
by Fsiphskilm
Program=Forever

PostPosted: Wed Nov 05, 2003 4:44 pm
by shooraijin
Since Myrrh originally posted in Java, here's one allegedly seen at JavaOne:

if(you.CanRead(this)) you.CanGet(new Job(!problem))

PostPosted: Thu Nov 06, 2003 8:42 am
by Mithrandir
Actually, shoo, I saw that one when I did a stint there. At the time, I thought it was part of an add campaign. It may have just been some clever programmers, however...