CreepyCodeCollection
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?
This is one of my favourites- The Animated 3d Doughnut (↗). Taste how delicious it is!
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
Level- 2: Chunin
Level- 3: Jonin
Level- 4: Kage
Rogue
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!
评论