Home

Awesome

<h1> <img src="https://cloud.githubusercontent.com/assets/5456665/22564404/991be738-e9ae-11e6-9084-c1631f970b60.png" width="20" height=auto /> CreepyCodeCollection</h1>

A Nonsense Collection of Disgusting Codes

Here we are talking about creepiest of the most creepy codes. Programs, behave so strange, that they will twist your brain. Snippets, so small, that you won’t believe their functionality. And codes, so cryptic, that even the top coders will think of going back to the college.

Note: Never try this type of code in a real life software project; readability and maintainability should be the main concern there.

Intro

See this cute little code ()-

(1x$a)!~/^1?$|^(11+?)\1+$/

In Perl, this regular expression checks if a number is prime.

Following code will produce day of the week for a given date ()-

((y-=m<3)+y/4-y/100+y/400+" bed=pen+mad."[m]+d)%7

Consider this Java code ()-

int i = (byte) + (char) - (int) + (long) - 1;

What will be the value of i? Will the code even compile? Weird! Huh?

The program is a Ruby Quine called qlobe (). Isn't the the output amazing?

<div align="center"> <img src="https://cloud.githubusercontent.com/assets/5456665/21362343/258441bc-c712-11e6-88bf-f8f02a028ad3.gif" alt="Qlobe" height="300" width=auto/> </div>

This is one of my favourites- The Animated 3d Doughnut (). Taste how delicious it is!

<div align="center"> <img src="https://cloud.githubusercontent.com/assets/5456665/21362492/c976724a-c712-11e6-9773-03e80f8ba598.gif" alt="Animated 3d Doughnut" height="300" width=auto/> </div>

Paste this in your browser's url-

data:text/html,<body%20style=margin:0><canvas%20id=q%20/><script>var%20q=document.getElementById('q'),s=window.screen,w=q.width=s.width,h=q.height=s.height,p=Array(256).join(1).split(''),c=q.getContext('2d'),m=Math;setInterval(function(){c.fillStyle='rgba(0,0,0,0.05)';c.fillRect(0,0,w,h);c.fillStyle='rgba(0,255,0,1)';p=p.map(function(v,i){r=m.random();c.fillText(String.fromCharCode(m.floor(2720+r*33)),i*10,v);v+=10;%20return%20v>768+r*1e4?0:v})},33)</script>

And see the magic yourself ()!

Most of the programs here are hell hard to understand. The details-url provided with the codes contain useful description. Follow the Creepy Rank for getting a structured view of all the programs.

Creepy Rank

Sorted by difficulty level-

Level- 1: Genin

CodeIntro
pyjava.javaJava code written like python. Finds factorial of big numbers.
backward.javaWeird flipped code compiles- "backward!".
one_line_swap.cStrange one-liners that swaps value of two variables.
without_main.cC code without main.
hello_world.javaMagically outputs "hello world" in the console.
obfuscated.javaPrints "Hi!" in the console, looks like a big meaningless comment though.
strange.cA strange code with more strange output.

Level- 2: Chunin

CodeIntro
bitwise_arithmetic.cPerforms addition and multiplication using only bit operation.
prefix2postfix.cConverts prefix notation to postfix.
sapin.cPrints a dynamic christmas tree.
crazy_jvm.javaSeems like the JVM has gone mad, printing random integers.
confusion.javaIt is surprising enough, that the code compiles & prints 1.
not_so_random.javaWill (randomly!) print- 1 1 1 1 1 1 1 1 1 1.
bangladesh.cPrints the map of Bangladesh.
signature_prime.cKeeps printing prime number (theoretically) forever.
day_of_week.cComputes day of the week for given date.
polyglot_so404.py.pl.rb.c.bfPrints 404 in python, perl, ruby, c and brainfu*k.
polyglot_quine.c.py.pl.rbA quine that runs in c, python, perl & ruby.

Level- 3: Jonin

CodeIntro
compound_eye.rbDisplays animated pattern.
best_short_program.cReads a spelt number and writes a corresponding decimal number.
check_prime.plChecks if a number is prime using regular expression!
quine_signature.cShortest C code that prints itself.
clock_in1line.cPrints current time in text-art.
japh.plPrints "just another perl hacker".
matrix_effect.htmlDisplays a matrix-like screen.
pi_signature.cCalculates the first 15000 digits of PI.

Level- 4: Kage

CodeIntro
mandelbrot_imager.pyCreates an image of Mandelbrot (may take 20m to run!).
shortest_tetris.htmlVery short and simplified variant of the classic tetris game.
qlobe.rbPrints the globe. And it can also be turned by puting command-line argument.
animated_3d_doughnut.cShows a 3d animated doughnut with ASCII art.
mandelbrot_flythrough.plRotates, zooms in & out, and scrolls randomly to examine regions of the Mandelbrot.

Rogue

CodeIntro
octaglot.cob.pas.f77.c.ps.sh.pl.comA polyglot, prints "hello polyglots" in 8 languages.
esoteric_polyglot.mal.bf.ws.asdf.123.spoon.exconA polyglot written in 7 esoteric languages.
palindrome_polyglot_quine.cs.javaThe code is palindromic, compiles in C# and Java, prints itself.
quine_relay.rbAn uroboros program with 100 programming languages.

All the programs here have been tested (by me). TutorialsPoint-CodingGround or repl.it has online code editors and compilers, which can be used to run these programs. Many programs here have been collected from q/a and discussion sites, like- StackOverflow, Quora, Programming Puzzles & Code Golf, & Hacker News.

If you liked this project, then you may also love CuteVirusCollection.

Not Satisfied Yet!