Skip to main content
1 of 4
Dom Hastings
  • 24.4k
  • 4
  • 56
  • 93

29. PHP with -r, 256 bytes

.6|0&"123'   '321"&0|6.
*   
0   
;   
+   
eval(   
~   
preg_replace    
('Hi, Retina!'^'g5X|>/345789:@ABCDEFGHIJKLMNOPQRSTUVWXYZ 
a   
b   
c   
d   
e   
f   
g   
h   
i   
j   
k   
l   m~

Not being able to use $ made this quite tricky, in my original solution I misunderstood the rule, but I think I have everything covered now.

Here's a reversible hex dump for verification too.

00000000: 2e36 7c30 2622 3132 3327 0927 3332 3122  .6|0&"123'.'321"
00000010: 2630 7c36 2e0a 2a09 0a30 090a 3b09 0a2b  &0|6..*..0..;..+
00000020: 090a 6576 616c 2809 0a7e 090a 7072 6567  ..eval(..~..preg
00000030: 5f72 6570 6c61 6365 090a 2827 4869 2c20  _replace..('Hi, 
00000040: 5265 7469 6e61 2127 5e27 6735 587c 3c4a  Retina!'^'g5X|<J
00000050: 2709 0a2c 090a 2727 090a 5e27 4865 6e72  '..,..''..^'Henr
00000060: 7920 4a61 6d73 3f27 090a 2c27 9b96 9ad7  y Jams?'..,'....
00000070: 9c90 8a91 8bd7 9c90 8a91 8ba0 9c97 9e8d  ................
00000080: 8cd7 9996 939a a098 9a8b a09c 9091 8b9a  ................
00000090: 918b 8cd7 dd8f 978f c5d0 d08c 8b9b 9691  ................
000000a0: ddd6 d3ce d6d6 c1c7 c7c0 abc5 b9d6 c427  ...............'
000000b0: 2929 3b3f 3e3e 2f33 3435 3738 393a 4041  ));?>>/345789:@A
000000c0: 4243 4445 4647 4849 4a4b 4c4d 4e4f 5051  BCDEFGHIJKLMNOPQ
000000d0: 5253 5455 5657 5859 5a09 0a61 090a 6209  RSTUVWXYZ..a..b.
000000e0: 0a63 090a 6409 0a65 090a 6609 0a67 090a  .c..d..e..f..g..
000000f0: 6809 0a69 090a 6a09 0a6b 090a 6c09 6d7e  h..i..j..k..l.m~

Try it online!

I'm having problems getting my code properly into the test driver, but I believe I satisfy all the conditions.

Satisfies

  1. The first character is a ..
  2. It contains an e.
  3. Its length is even.
  4. Its length is a perfect square.
  5. It contains an a.
  6. It contains a > character.
  7. Contains the exact string ->.
  8. Contains the exact string Hi, Retina!.
  9. The sum of the first two Unicode code points is a multiple of 5.
  10. The 10-th character is a ".
  11. The last non-empty line does not have any duplicate characters.
  12. The first line is a palindrome of length > 5.
  13. The first line is exactly 21 characters long (not including newline).
  14. It contains a ?.
  15. It contains a |.
  16. Contains a +.
  17. It is at least 28 lines long.
  18. The following characters are used five times in total: !"#$.[\] and the codepoint of the second character is less than 60.
  19. Contains Henry Jams? as a continuous substring.
  20. The last character is ~.
  21. It contains a C
  22. Each line contains a tab character.
  23. The ninth line contains at least 22 characters, excluding the newline.
  24. The tab character can't be the first character on a line
  25. The third-to-last character is a tab.
  26. There are at least 28 lines, and they are all distinct.
  27. There must be a > in the code and angle braces must be balanced.
  28. There must be more than 88 distinct code points in the program.

For future answers:

  • The first line is a palindrome matching .␣␣␣␣␣␣␣␣"␣"␣␣␣␣␣␣␣␣. (you are free to fill in the ␣s).
  • The second character is one of ',16;, or a tab, or one of \x04\x0e\x13\x18\x1d.
  • Its length is an even perfect square.
  • There are at least 28 lines, and all lines are distinct.
  • The ninth line must have at least 22 characters (excluding the newline).
  • The last line does not have any duplicate characters.
  • Contains the exact strings ->, Hi, Retina!, and Henry Jams?.
  • It contains |, + and C.
  • Each line contains at least one tab character, but it can't be the first character on a line.
  • !". are banned except where necessary:
    • Only ! in Hi, Retina! and the two . and two " in the first line are allowed.
  • #$[\] may not appear in the program.
  • The program ends with: tab, (whatever), ~.
  • Angle braces must be balanced.
  • There must be more than 88 distinct code points in the program.
Dom Hastings
  • 24.4k
  • 4
  • 56
  • 93