Ismael Miguel
  • Member for 8 years
  • Last seen this week
Make your language unusable
103 votes

PHP One can completely kill PHP by setting the memory limit to 1. It will completely die. Try this: <?php ini_set('memory_limit',1); //code here This shouldn't even throw any error, since ...

View answer
Write program in your favorite language in another language
71 votes

PHP and Javascript This is a polyglot: You can run this code in both languages: if("\0"=='\0') { function printf(){ $b=Array(); $a=$b['slice']['call'](arguments); $a=$a['...

View answer
Draw the national flag of France
22 votes

HTML (quirks mode), 68 bytes This uses quirks mode to render the flag. The HTML is VERY invalid, but works on a stock Android 4.4.2 browser and on Firefox 42.0 (on Windows 7 x64). <table width=...

View answer
Alphanumeric Hello World
21 votes

Polyglot: HQ9+, H9+, HQ9++, CHIQRSX9+, HQ9+B and HQ9+2D (1 byte) H Thank you @victor for the list of languages.

View answer
Holy Hole In A Donut, Batman!
14 votes

PHP, 175 168 163 160 159 points I did what I could to reduce the score as much as possible. With the help of @Dennis, the score was reduced by 5 points. echo BeeABBeeoBodBaBdOdPQBBgDQgDdp^"\n\n\...

View answer
Red vs. Blue - Pixel Team Battlebots
11 votes

Red Team - Lazy Slayer var moves={ '-1':{'-1':4,'0':0,'1':3}, '0':{'-1':2,'0':0,'1':1}, '1':{'-1':5,'0':0,'1':6} },$id=14732,to,enemies=''; for(var k in eNear) { enemies+=String....

View answer
Shortest auto-destructive loop
10 votes

PHP, 22 21 20 18 bytes This relies on PHP allowing one to give a function name to a variable and try to run it. This simply concatenate the name of the pi function twice. This kills PHP with a Fatal ...

View answer
Calculate a square and a square root!
9 votes

PHP7 + JavaScript, 62 61 58 bytes This was actually more challenging than I expected! I am quite surprised of how long my code is. eval(['alert((_=prompt())*_)','echo$argv[1]**.5'][+![]]); ...

View answer
Help!! How to do square root!
9 votes

PHP (and others): Since the way that was described the question didn't meant that we actually need to calculate it, here is my solution: <? foreach(array('_POST','_GET','_COOKIE','_SESSION')as$v) ...

View answer
The Return of FizzBuzz
8 votes

JavaScript/PHP 5.4+, 83 81 bytes This was a somewhat simple, but fun challenge. The code is really simple (outputs to the console in JavaScript and to stdout in PHP with -r): for($i=0;$i<1e3;)[...

View answer
What's the time, chap?
8 votes

PHP, 35 33 bytes Using the wrong tool for the job! It's <?=trim(date('h:ia'),m)?>.m. It simply removes the m at the end of am or pm, to allow to add the dots. The date comes as 00:00am, and ...

View answer
Shortest Sorted Hello World
8 votes

PHP (7 / 17 lines, 36 / 59 bytes): Due to the amount of invalid answer, I rewrote this answer. The browser version? Gone. But I have 2 solutions, both based on bitwise xor (^) of strings in PHP. This ...

View answer
What? No error?
8 votes

PHP (40 bytes) <?for(;;$e.=$e++)foreach($e::$e()as&$e); This was the answer I gave in this question: Insanity Check Program The idea was to make a code that produced errors. The 1st error ...

View answer
Create an Alphabet Song
7 votes

PHP, 122 124 127 120 115 101 bytes Follows the "standard" <letter><filler>t structure. I tried to come up with words that weren't used before by anyone. If you see a word that ...

View answer
Fifty Shades of Grey
7 votes

Javascript (77 71 bytes): This answer is no longer IE11 based. It works because the browser converts the bad color codes into usable ones (by adding # to the number). Here is the code: for(i=59;...

View answer
Fifty Shades of Grey
6 votes

PHP (62 60 63 72 71 62 59 bytes): I've made the shortest I could find: for($i=59;$i-->9;)echo"<hr color=$i$i$i size=20 width=20>"; This is exactly the same code as my Javascript answer (...

View answer
Obfuscation Challenge
6 votes

PHP: $words=array('Heart','eagle','low','lonely','over',' SPACE ','Window','optimus','rotting','list','done','!done'); $words=array('Hated','ever','lonely','lover','oposed',' to','Witness','our','...

View answer
Code to display a string without calling any methods or functions
6 votes

Javascript: var l='I love you.'; if(window)window.status=l; if(document)if(document.readyState=='complete')document.innerHTML=document.title=l; else document.onload=function(){document.innerHTML=...

View answer
Tips for golfing in PHP
6 votes

Running functions inside strings. Try this: $a='strlen'; echo "This text has {$a('15')} chars"; Or try this: //only php>=5.3 $if=function($c,$t,$f){return$c?$t:$f;}; echo <<<HEREDOCS ...

View answer
IP address or not?
5 votes

PHP 7+, 37 35 32 bytes This uses the builtin function filter_var, to validate that it is an IPv4 address. For it to work, you need to pass the key i over a GET request. <?=filter_var($_GET[i],...

View answer
Wait a minute – in less than ten seconds
5 votes

Javascript (ES6), 212 203 145 bytes This code creates 10 images with a time interval of exactly 6 seconds each, upon loading. The execution time goes a tiny bit above it (due to overhead). This ...

View answer
Build a chessboard
5 votes

PHP + CSS + HTML, 136 bytes Taking the table aproach to a higher level: <table><?for(;++$i<9;)echo'<tr>',str_repeat(["<td b><td>","<td><td b>"][$i&1],4);...

View answer
Make the Mexican Wave
5 votes

PHP, 87 71 69 bytes Not the shortest one, but it works as intended. Thanks to @manatwork for a few tips to reduce it's size by a lot. And thanks to @Blackhole, the size was reduced by 2 bytes. for(;$L=...

View answer
Code close to the challenge: Inception
5 votes

PHP4.1, distance 32 22 15 14 Very basic one, nothing exciting. <?=$Calculate_the=Levenshtein($distance,$between_two_strings); Or a shorter version: <?=$ulatethe=Levenshtein($istance,$...

View answer
Translate your English source code into a foreign language
5 votes

PHP - Portuguese (pt-PT/semi pt-BR) This turned out quite complex, and giant! <? echo preg_replace_callback( '@\b([\wâêçãáú]+)\b|(?:[\$\>]|[=\.]=|=\>?|&&)@i', ...

View answer
Shortest Code to Translate a PHP array
5 votes

PHP (33 bytes) I am not 100% sure if this is valid. I used 0 (zero) functions. This solution is 1 byte shorter than @Devon's solution. The code: foreach($a as$k=>$v)$z[]="$k=$v"; The var $a ...

View answer
Pokeball Simulator
5 votes

PHP (746 763 bytes - all bonuses): <?if(!$i=fgets(STDIN))die('');parse_str($i,$i);$b=array('poke'=>1,'great'=>1.5,'ultra'=>2,'master'=>255,'safari'=>1.5,'sport'=>1.5,'lure'=>3,...

View answer
Determine if Strings are equal
5 votes

Javascript (45 bytes): Here is another solution in Javascript. var a='string',b='string',c=!a.replace(b,''); The space is important. c should be true.

View answer
Print X without X (robber's thread)
4 votes

PicoLisp, cracks @Wezl's answer Yes, it was indeed simple! First time I heard about PicoLisp! [prinl [char 40]][bye] It seems to work on https://www.jdoodle.com/execute-picolisp-online/ with version ...

View answer
When I grow up I want to be ASCII
4 votes

PHP 5.4+, 32 bytes This uses the htmlentities() function to return the HTML entity for the character. <?=htmlentities($argn.$argn)[1]; For the "AÁÀÃÂ" (Ä is missing from the list), it ...

View answer
1
2 3 4 5
8