Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » What's the funniest code we can think of?
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
Have you ever seen some ridiculously stupid code?
I've seen lots of it, and, quite frankly, I find it hilarious
I wanted to share some here:
^^ the best macro I have ever seen 
What can you come up with ?
I've seen lots of it, and, quite frankly, I find it hilarious

I wanted to share some here:
#define PROCESS_AND_RETURN(X) \ X.process(); \ // Important: Return only after invoking virtual method process() \ return X

What can you come up with ?
- ChocolatePi
-
1000+ posts
What's the funniest code we can think of?
#define if while #define bool string #define main slkjfldksjelkfj
also this
Exception up = new Exception("Something is really wrong."); throw up; //ha ha
Last edited by ChocolatePi (Dec. 16, 2014 19:35:29)
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
This one is from C++, another macro:
#include <iostream> #define System S s;s #define public #define static #define void int #define main(x) main() struct F{void println(char* s){std::cout << s << std::endl;}}; struct S{F out;}; /* this guy's a genius... */ public static void main(String[] args) { System.out.println("Hello World!"); }
Last edited by theonlygusti (Dec. 16, 2014 19:43:25)
- ChocolatePi
-
1000+ posts
What's the funniest code we can think of?
// sometimes I believe the compiler ignores all my comments
#define TRUE FALSE //Happy debugging suckers
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
I once saw this:// sometimes I believe the compiler ignores all my comments
#define TRUE FALSE //Happy debugging suckers
#define TRUE 0
if (function_which_returns_zero_on_success(x) == TRUE){
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
#define ever (;;) for ever { //... }
^^ this guy is a genius
- QuillzToxic
-
1000+ posts
What's the funniest code we can think of?
<script type=“text/javascript” async src="http://cdn.delphitools.info/wp-content/uploads/2013/10/jsbat.js?1.2"></script>
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
I'm now going to try and turn C into written Scratch:
Ta da!
#define when_gf_clicked main(int argc,char**argv){ #define repeat_until(c) while (!(c)){ #define end } #define then { #define say(s) fprintf(s); when_gf_clicked if (1 < 2) then repeat_until(1 != 1) say("Hi") end end
Ta da!
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
http://cdn.delphitools.info/wp-content/uploads/2013/10/jsbat.js?1.2"></script>Sorry, you got the wrong topic: this ought to go in the Obfuscated Code Contest… <script type=“text/javascript” async src="
I couldn't stop laughing at this guy's genius! So funny!
- technoboy10
-
1000+ posts
What's the funniest code we can think of?
rm -rf /
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
What is that? How do we run it?Don't try this at home (no, really).rm -rf /
- theonlygusti
-
1000+ posts
What's the funniest code we can think of?
public int GetRandomNumber(maxNum) { return 12; }
- goldfish678
-
1000+ posts
What's the funniest code we can think of?
I'm pretty sure that's Batch.What is that? How do we run it?Don't try this at home (no, really).rm -rf /
- technoboy10
-
1000+ posts
What's the funniest code we can think of?
*bashI'm pretty sure that's Batch.What is that? How do we run it?Don't try this at home (no, really).rm -rf /
It's Linux shell code. It erases your hard drive.

Last edited by technoboy10 (Dec. 16, 2014 20:56:11)
- ChocolatePi
-
1000+ posts
What's the funniest code we can think of?
*bashI'm pretty sure that's Batch.What is that? How do we run it?Don't try this at home (no, really).rm -rf /
It's Linux shell code. It erases your hard drive.
rmdir C:\Windows\System32
- PullJosh
-
1000+ posts
What's the funniest code we can think of?
Such random. Much wow.public int GetRandomNumber(maxNum) { return 12; }
- goldfish678
-
1000+ posts
What's the funniest code we can think of?
Wait a second, if Windows shell code is named Batch then is Bash just a parody of Batch?*bashI'm pretty sure that's Batch.What is that? How do we run it?Don't try this at home (no, really).rm -rf /
It's Linux shell code. It erases your hard drive.
- goldfish678
-
1000+ posts
What's the funniest code we can think of?
var var = var;
Last edited by goldfish678 (Dec. 17, 2014 01:29:28)
- MegaApuTurkUltra
-
1000+ posts
What's the funniest code we can think of?
No, Bash = “Bourne-again shell,” aka a better version of the classic Bourne shell (sh).Wait a second, if Windows shell code is named Batch then is Bash just a parody of Batch?*bashI'm pretty sure that's Batch.What is that? How do we run it?Don't try this at home (no, really).rm -rf /
It's Linux shell code. It erases your hard drive.
Batch = Batch script, aka running a bunch of commands at once, a batch job.
They're not related at all.
Obligatory XKCD:Such random. Much wow.public int GetRandomNumber(maxNum) { return 12; }

Here's my random code of the day:
int main(int argc,char**argv){ // the following compiles successfully // how??/ invalid statement derp }
// the following doesn't work
// try it! copy and paste into inspect element
var а = "swag";
alert(a);
Last edited by MegaApuTurkUltra (Dec. 17, 2014 03:48:28)
- Discussion Forums
- » Advanced Topics
-
» What's the funniest code we can think of?