48
\$\begingroup\$

In this challenge you are to write a program or function, that takes a string as input and outputs one of two possible values. We will call one of these values truthy and one falsy. They do not need to actually be truthy or falsy. For an answer to be valid it must meet four additional criteria

  • When you pass your program to itself it outputs the truthy value.

  • If you pass your program as input to any older answer it should output the truthy output (of the program you are passing to).

  • If you pass any older answer to your answer as input it should output the falsy output (of your program).

  • There must be an infinite number of strings that evaluate to truthy output in all answers on the challenge (including your new answer).

What this will do is it will slowly build up a chain of answers each of which can determine if other programs in the chain come before or after it.

The goal of this challenge is to build up a list of source restrictions that are applied to the successive answers making each one more challenging than the last.

Example

A chain (written in Haskell) could start:

f _ = True

Since there are no older programs, the criteria do not apply to this answer it need only output one of two possible values, in this case it always outputs True.

Following this could be the answer:

f x=or$zipWith(==)x$tail x

Try it online!

Which asserts that there is a character twice in a row somewhere in the string. The first answer doesn't have this property while the second does (==). Thus this is a valid next answer.

Special rules

  • You may use any language you wish (that has a freely available implementation) as many times as you wish.

  • If you were the last person to answer you must wait at least 7 days before posting a new answer.

  • Your program may not read its own source.

  • Since the 4th rule is exceedingly difficult to verify if cryptographic functions are involved, such functions are disallowed.

Scoring criterion

Each time you add an answer you will get as many points as its place in the chain. For example the 5th answer would gain it's writer 5 points. The goal is to get as many points as you can. The last answer will score its answerer -∞ points. This will probably be more fun if you try to maximize your own score rather than "win" the challenge. I will not be accepting an answer.

Since this is you may want to sort by oldest

\$\endgroup\$
  • \$\begingroup\$ Perhaps there should be a community wiki post listing all the new requirements added by the answers. It could possibly also have a TIO link to code verifying that a program satisfies all the requirements. \$\endgroup\$ – Steadybox Mar 19 '18 at 21:04
  • 1
    \$\begingroup\$ @totallyhuman The answerer could update it \$\endgroup\$ – Conor O'Brien Mar 19 '18 at 21:06
  • 1
    \$\begingroup\$ Here's a ruby script which does that \$\endgroup\$ – Conor O'Brien Mar 19 '18 at 21:07
  • 1
    \$\begingroup\$ @msh210 You shouldn't need to know much of anything about other people's languages. So long as they have been courteous enough to provide an easy way to run their program, all you need to do is paste your program into their program's input and run it. Their program run on your program should output the same thing as their program run on itself. \$\endgroup\$ – 0 ' Mar 21 '18 at 6:40
  • 1
    \$\begingroup\$ @user56656 Can you please address the issue of what cryptographic functions are allowed? See #31. \$\endgroup\$ – mbomb007 Mar 26 '18 at 14:10

31 Answers 31

10
\$\begingroup\$

14. X86 Assembly (gcc 6.3), 324 bytes

.TITLE "a"#"a" ELTIT.
.data
i:.fill 25,1,0
s:.string "%25[^\n]"
t:.string "->Hi, Retina!"
f:.string "Bye Retina!"
.global main
main:           
pushl $i
pushl $s
call scanf
addl $8, %esp
pushl $i
call strlen
addl $4, %esp
sub $21, %eax
jz y
pushl $f
call printf
addl $4, %esp
jmp en
y:
pushl $t
call printf
addl $4, %esp
en:
ret

Try it on ideone!

Note: this will return a runtime error because the exit code is not zero. Running this in the ideone editor will display all stdout output regardless of how the program concludes.

  • Truthy output: "->Hi, Retina!"
  • Falsy output: "Bye Retina!"

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).

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ".
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
\$\endgroup\$
  • 2
    \$\begingroup\$ Can the space in the "s be replaced with an a? \$\endgroup\$ – Destructible Lemon Mar 20 '18 at 3:52
  • \$\begingroup\$ @DestructibleLemon Yup! Fixed. \$\endgroup\$ – bitconfused Mar 20 '18 at 3:59
  • 1
    \$\begingroup\$ @user56656 you can't expect this answerer to know Pyth. Rather, he must necessarily go by the Pyth answerer's description of the criterion, which was that the program contain an a. This program contains an a. \$\endgroup\$ – msh210 Mar 20 '18 at 7:46
  • \$\begingroup\$ It seems that your answer doesn't do exactly what it claims. My answer here passes despite having 22 characters (excluding newline) on the first line. \$\endgroup\$ – Sriotchilism O'Zaic Mar 21 '18 at 15:58
  • \$\begingroup\$ @user56656 Just ran it in the editor, it prints the falsey value of "Bye Retina!" in the live console feed. \$\endgroup\$ – bitconfused Mar 21 '18 at 19:00
7
\$\begingroup\$

9. Retina, 16 bytes

.->0`Hi, Retina!

Try it online!

If you want to try your own program, simply append it to the input field, separated by two linefeeds. (If your program contains two linefeeds, you'll have to change the separator between all programs and in the TIO header.)

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!.

Sorry, but you kinda forced me to pad to length 16...

Without redundant requirements:

  • The first character is a .
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.

Explanation

Starting with . is fine, it just means that we suppress Retina's implicit output (provided the first line has a configuration, but I didn't want a two-line program). That means we need it explicit output, but the option for that is >, so we're in luck. The - can go in front of it because it doesn't do anything.

Now we can get to the program itself. The simplest thing to do is to match a literal string. That's guaranteed to show up in our program, we can easily make sure that it isn't part of any existing program, and it gives us a number as the result. However, it could potentially return a number greater than 1 (so more than two different values). We avoid this with the 0-limit which only looks at the first match and counts that if it exists. So the 0 ensures that the output is only ever 0 or 1 (depending on whether the input contains the literal string).

As for the literal string... well, we still need to include an e and an a... and we need the string to have at least 11 characters, so that we match the length requirements (getting to an even square). Hi, Retina! happens to satisfy those requirements.

\$\endgroup\$
7
\$\begingroup\$

13. Perl 5, 64 bytes

.1;";1.
\"Hi, Retina!->";$_=<>;chop;print y///c>5&&reverse
eq$_;

Try it online!

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.

Summary for future answers:

  • First character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10th character is a ".
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length > 5 (in characters).

Verification Ruby script

\$\endgroup\$
  • \$\begingroup\$ Just about to post my answer, aaand now it's impossible ahhhhhh \$\endgroup\$ – bitconfused Mar 19 '18 at 22:33
  • \$\begingroup\$ Oops, I'm deleting this until the V answer is fixed. \$\endgroup\$ – Lynn Mar 19 '18 at 22:45
  • 1
    \$\begingroup\$ @bitconfused I changed it, just for you...! \$\endgroup\$ – Lynn Mar 19 '18 at 23:16
  • 1
    \$\begingroup\$ You're too good for this world! \$\endgroup\$ – bitconfused Mar 19 '18 at 23:16
  • 1
    \$\begingroup\$ @user56656 you can't expect this answerer to know Pyth. He must, rather, necessarily go by the Pyth answerer's description of the criterion, which was that the program contain an a. This program contains an a. \$\endgroup\$ – msh210 Mar 20 '18 at 7:45
6
\$\begingroup\$

25, Octave, 196 bytes

New requirement: To avoid the tab versus spaces discussion, tabs can no longer be used for indentation. Each line still needs a tab, but it can't be the first character in the line.

.6;%+->?|"	"|?>-+%;6.
f=@(x)1&&cellfun(@(C)any(C=='	')&1&&find(C=='	')>1,strsplit(x,char(10)));
%	
%	
%	
%	
%	
%	
%Henry Jams?Hi, Retina!	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	
%	~

Verify all programs online!

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

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The first line is a palindrome of length 21.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.
  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The ninth line must have at least 22 characters, excluding the newline.
  • The last non-empty 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.
  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].

Explanation:

It was actually a bit hard to keep this at 196 bytes, since there are many bytes that are now mandatory on each line.

The first line is simply a scalar that's not outputted, followed by a comment. The second line is an anonymous function that takes a string x as input and makes the following operations:

strsplit(x,char(10))   % Split at newlines. Can't use a literal newline, or [10,''] due to previous rules
cellfun(@(C) ...     ) % Perform the following operation on each line:
  any(C==' ')          % Make sure there is at least one tab character
  1&&find(C==' ')>1    % Make sure the index is higher than 1
1&&cellfun( ... )     % Check that this is true for all lines.

It's lucky that the short circuit operation && takes precedence over &, and that 1&&find doesn't require parentheses. Otherwise I wouldn't manage to golf this down to 196 bytes.

\$\endgroup\$
  • \$\begingroup\$ Note that this isn't code golf. \$\endgroup\$ – ericw31415 Mar 22 '18 at 1:11
  • 1
    \$\begingroup\$ I know, but it's more fun to golf it than padding it with 50 bytes. :) \$\endgroup\$ – Stewie Griffin Mar 22 '18 at 8:00
5
\$\begingroup\$

5. Python 3, 64 bytes

.012
import sys
print(len(sys . stdin . read()) ** 0.5 % 1 == 0)

Try it online! Checks if the length of the input is a perfect square.

This had been updated by the time 18 answers were present to support multiline input.

The update does not hurt the chain.


Satisfies:

  1. starts with a .
  2. contains an e
  3. has an even length
  4. has a perfect square length
\$\endgroup\$
  • \$\begingroup\$ I haven't tried this but does it actually return false for e.g. 99999999^2+1 and true for e.g. 99999999^2? \$\endgroup\$ – msh210 Mar 20 '18 at 7:35
  • 1
    \$\begingroup\$ This currently only reads the first line of the input, so multiline answers will (incorrectly) return False. Is it possible for you to correct this when you get a chance? \$\endgroup\$ – caird coinheringaahing Mar 20 '18 at 8:00
  • \$\begingroup\$ @cairdcoinheringaahing fixed, thanks! \$\endgroup\$ – Uriel Mar 20 '18 at 10:42
5
\$\begingroup\$

11. JavaScript (ES6), 36 bytes

.11&&(s=>"Hi, Retina!->"&&s[9]=='"')

Try it online!

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 ".

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ".
\$\endgroup\$
5
\$\begingroup\$

23, Literate Haskell, 196 bytes

New requirement: Indentation is great, so each line needs to contain at least one tab character.

.1+C->|  "	"  |>-C+1.
		
>	main = interact test
>	test s = show (check (lines s))
>	check = all (elem tab)
>	tab = toEnum 9
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	Henry Jams?
	Hi, Retina!
	~

Try it online!

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.

For future answers:

  • The first line is a palindrome of length 21.
  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.
  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The last non-empty line does not have any duplicate characters.
  • Contains the exact sequence ->.
  • Contains the exact strings Hi, Retina! and Henry Jams?.
  • It contains |, + and C.
  • Each line contains a tab character.
  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
\$\endgroup\$
  • \$\begingroup\$ There goes my chance to post another Whitespace answer down the road. ;p \$\endgroup\$ – Kevin Cruijssen Mar 21 '18 at 14:42
5
\$\begingroup\$

27. GolfScript, 144 bytes

.		;'>-C+"1"+C->';		.
'	
z	
y	
x	
w	
v	
u	
Hi, Retina!	Henry Jams?';;
t	
s	
r	
q	
o	
m	
l	
k	
j	
i	
h	
g	
f	
e	
d	
c	
b	
n	/:^,27>^^^|=lynn
*	n~

Try it online!

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.

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.
  • The program ends with: tab, (whatever), ~.
\$\endgroup\$
  • 4
    \$\begingroup\$ 26 is here (non-obvious when sorting by oldest.) \$\endgroup\$ – Lynn Mar 21 '18 at 14:23
4
\$\begingroup\$

12. V, 36 bytes

.1lllGYVH""pØHi, Retina!->üˆ.*±
Ø^0$

Try it online!

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.

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ".
  • The last line non-empty line does not have any duplicate characters.
\$\endgroup\$
4
\$\begingroup\$

21. Alphuck, 676 bytes

Surprisingly, most of the code is not padding.

.11111111"1"11111111.
?|+->Hi, Retina!opaos
iipiiciasceaecppisaic
sapiceasccpisipiiiiia
ecsaiiijaeepiiiiiiaec
saeeejeepiiiaeecsajee
eeeepiaeecsaejipiiiii
iaecsaijeeeeeeeeeejii
iiiijiipiiiaecsaijiii
piaeeeecsaijeejiiijii
iiiiiiiiiiijiipiiiaec
saijiipiaeeeecsaejiii
iiiiiiijeeeeeejiiijpi
iaeeeeecsaeeejpiiaeee
eeeecsajeejiiijiiiiii
iijeeeeeeeeeeejeeepia
eeecsaeejeeeeeeeeeeee
jpiaeeeeecsaijepiaeee
csaeejeeeeeeeeejiiiii
iiiiijiipiiiaecsaiiij
epiiiiaecsaeeejiipiae
eeecsaijepiaeeecsaeje
eeeeeeeeeejiiiiiiiiii
iijiipiiiaecsaiijpiae
eecsaejipiaeeecsajiii
piaeeeecsajiiiiiiiiii
ijeeejiiiiiiiijejiipi
iiaecsajpHenry Jams?a
bcefghiwklmnopqrstuvw
xyzabcdefghwuklmnopqr
stuvwxyzabcdefg~

Try it online!

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 ~.

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The first line is a palindrome of length 21.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.

  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The last non-empty line does not have any duplicate characters.

  • Contains the exact sequence ->.
  • Contains the exact strings Hi, Retina! and Henry Jams?.
  • It contains | and +.

  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
\$\endgroup\$
4
\$\begingroup\$

26. Self-modifying Brainfuck (SMBF), 256 bytes

The third-to-last character must be a tab.

.1111111	"1"	1111111.
x	
x	
x	
x	
x	
x	
x	
x	Hi, Retina!Henry Jams?C|xxxxxxxxxxxxxxxxxxxx
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	
x	<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
x	+>>>->>+>>->>+>>->>>>>>>>>>>+>>>>>->>->>>>
x	>,Z>,^<Z-^<Z-^<---------Z>+.>^
^	x~

Prints out \x00 for truthy and outputs \x00\x01 for falsey. Always terminates with an error due to an unmatched bracket. This prevents any input from being dynamically executed.

This program only works in the Python interpreter. DOES NOT WORK ON TIO. This is because the Python interpreter EOF is NUL.

To use the Python interpreter, paste this code into the line where the data is set. This had to be done, because TIO has no easy way to type or input NUL bytes, so I still use Ideone. Then uncomment sys.stdin = MySTDIN("<[.<]") and replace the custom input with whatever input you are testing against.

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.

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The first line is a palindrome of length 21.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.
  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The ninth line must have at least 22 characters, excluding the newline.
  • The last non-empty 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.
  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
  • The third-to-last character is a tab.
\$\endgroup\$
  • 4
    \$\begingroup\$ 225 is not even? \$\endgroup\$ – Destructible Lemon Mar 21 '18 at 0:06
  • \$\begingroup\$ @DestructibleLemon I added padding and changed my answer to make it #26. \$\endgroup\$ – mbomb007 Mar 21 '18 at 13:19
4
\$\begingroup\$

28. Literate Haskell, 256 bytes

.	|+xx<<<"a"<<<xx+|	.
 		
>	g x=elem '<'x&&e%x==e
>	e=tail(show 0)	
>	('<':a)%('>':b)=a%b
>	a%('<':b)=('<':a)%b
>	a%('>':b)='<':e
>	a%(x:b)=a%b{->Hi, Retina!Henry Jams?-}
>	a@(_:_)%_=a
>	a%b=e
 	
a	
b	
C	
d	
e	
f	
g	
h	
i	
j	
k	
l	
m	
n	
o	
ppppppppp	
q	3~

Try it online!

Test Driver

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

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
\$\endgroup\$
  • \$\begingroup\$ I don't know what you mean by "perl5 currently doesn't work" in the test driver, it prints a 1 fine when I uncomment that line (though it could use a ; echo as there is no newline in the output) \$\endgroup\$ – Lynn Mar 21 '18 at 18:22
  • \$\begingroup\$ @Lynn I don't know. I can't remember what was wrong. I'll go ahead and uncomment it. Thanks. \$\endgroup\$ – Sriotchilism O'Zaic Mar 21 '18 at 18:23
4
\$\begingroup\$

29. PHP with -r, 256 bytes

.6|0&"123'  '321"&0|6.
<   
0   
;   
+   
eval(   
~   
preg_replace    
('Hi, Retina!'^'g5X|<J' 
,   
''  
^'Henry Jams?'  
,'×× ×  ×ÝÅÐÐÝÖÓÎÖÖÁÇÇÀ«Å¹ÖÄ'));?>->/45789:@ABCDEFGHIJKLMNOPQ  
*   
a   
b   
c   
d   
e   
f   
g   
h   
i   
j   
k   
m   
n   
o   p~

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. I've used high-byte characters, ~ and eval to work around the lack of decent variables for PHP. I nearly made the minimum number of unique code points 96, but I thought that might make it a little too hard for some languages.

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 3e2d 3e2f 3435 3738 393a 4041  ));?>->/45789:@A
000000c0: 4243 4445 4647 4849 4a4b 4c4d 4e4f 5051  BCDEFGHIJKLMNOPQ
000000d0: 090a 3c09 0a61 090a 6209 0a63 090a 6409  ..<..a..b..c..d.
000000e0: 0a65 090a 6609 0a67 090a 6809 0a69 090a  .e..f..g..h..i..
000000f0: 6a09 0a6b 090a 6d09 0a6e 090a 6f09 707e  j..k..m..n..o.p~

Try it online!

Test driver

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.
\$\endgroup\$
  • \$\begingroup\$ I think you forgot to add your script as an argument to the test driver here. I fixed it in my answer which is currently deleted. \$\endgroup\$ – Davis Yoshida Mar 22 '18 at 19:07
4
\$\begingroup\$

30. ><> with -v 0 -v 0, 324 bytes

1 is truthy, empty string is falsey

.1|-<<<<	"C"	<<<<-|1.
>i:0(?v'	'~
v     >}@@:'	'=0=?;@
v	
     >:0(?va=?v&1+&>'	'~
>{r0&/    v   >&}0&^	
          >&}rv	
<	
              >l3(?v@:}@@=?;{'	'~
                  ->1n;	
Hi, Retina!	
ABDEFGIKLMNOPQSTUVWXYZ	
b	c
d	
fg	
h	
jk	
o	
p	*      *  *
q	  *  *      *
u	*      *  *
w	
xz	
2	
45	
6	
78	9
Henry Jams?%-	_~

Try it online!

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.
  29. The third-to-last character is a tab (#26) AND adjacent lines must have different lengths

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.
  • Adjacent lines must have different lengths
\$\endgroup\$
  • \$\begingroup\$ I was trying to add this to the driver, but the binary "fish" did not accept it. What's the appropriate way to run it? \$\endgroup\$ – Davis Yoshida Mar 22 '18 at 23:01
  • \$\begingroup\$ @DavisYoshida The TIO link I shared works. Idk how \$\endgroup\$ – mbomb007 Mar 23 '18 at 3:05
  • \$\begingroup\$ Yeah there's nothing wrong with it, but if you want to execute it from a bash script you need to call an interpreter \$\endgroup\$ – Davis Yoshida Mar 23 '18 at 3:18
  • \$\begingroup\$ @DavisYoshida Ask Dennis in the TIO chat room. \$\endgroup\$ – mbomb007 Mar 23 '18 at 13:27
  • \$\begingroup\$ @DavisYoshida This is how TIO calls fish: github.com/TryItOnline/tryitonline/blob/master/wrappers/fish \$\endgroup\$ – Potato44 Mar 26 '18 at 13:18
2
\$\begingroup\$

1. Add++, 7 bytes

D,f,@,1

Try it online!

Might as well get Add++ in before things start getting difficult. This is very simply a translation of the first example into Add++. D,f,@,1 defines a function which, no matter the argument given, returns 1.

\$\endgroup\$
2
\$\begingroup\$

4. Stacked, 10 bytes

.3[#'even]

Try it online!

Checks if the length of the program is even. Anonymous function which returns 1 for "true" inputs and 0 for "false" ones.

Satisfies:

  1. starts with a .
  2. contains an e
  3. has an even length
\$\endgroup\$
  • \$\begingroup\$ How do I pass input to this code? It is not clear to me from the TIO link. \$\endgroup\$ – Sriotchilism O'Zaic Mar 21 '18 at 5:05
  • \$\begingroup\$ @user56656 try replacing the string before f out with what you want to test. Wrapped in single quotes, escape a single quote by doubling it \$\endgroup\$ – Conor O'Brien Mar 21 '18 at 5:06
  • \$\begingroup\$ Oh I see, you changed the code that's why the code doesn't appear in the footer. \$\endgroup\$ – Sriotchilism O'Zaic Mar 21 '18 at 5:06
  • \$\begingroup\$ @user56656 oh yes, sorry about that \$\endgroup\$ – Conor O'Brien Mar 21 '18 at 5:07
2
\$\begingroup\$

24, SNOBOL4 (CSNOBOL4), 256 bytes

.;*->+|a	"x"	a|+>-*;.
	x =input
	x =input
	x =input
	x =input
	x =input
	x =input
	x =input
	x =input;* Henry Jams?
	X =INPUT
	OUTPUT =GT(SIZE(X),21)	1
	
	
	
	
	
	
	
	
	
	
	
	
	
end	
	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234
	Hi, Retina!
	~

Try it online!

Prints out 1 for truthy and outputs nothing for falsey.

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.

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The first line is a palindrome of length 21.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.
  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The ninth line must have at least 22 characters, excluding the newline.
  • The last non-empty line does not have any duplicate characters.
  • Contains the exact strings ->, Hi, Retina!, and Henry Jams?.
  • It contains |, + and C.
  • Each line contains a tab character.
  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
\$\endgroup\$
1
\$\begingroup\$

2. Triangularity, 17 bytes

..)..
.)Im.
"."=.

Try it online!

Checks whether the first character is a dot (.).

\$\endgroup\$
  • 15
    \$\begingroup\$ You've already eliminated a lot of practical languages. :( \$\endgroup\$ – totallyhuman Mar 19 '18 at 20:34
  • \$\begingroup\$ That doesn't include Python, but it indeed rules out i.e Haskell \$\endgroup\$ – Mr. Xcoder Mar 19 '18 at 20:35
  • 2
    \$\begingroup\$ if your language supports floats just being anywhere in the code, .3 or similar would work \$\endgroup\$ – Conor O'Brien Mar 19 '18 at 20:35
  • \$\begingroup\$ This is a problem \$\endgroup\$ – Sriotchilism O'Zaic Mar 21 '18 at 4:59
  • \$\begingroup\$ @user56656 Ouch, that seems to be an internal bug with indexing... I’ll fix it later today \$\endgroup\$ – Mr. Xcoder Mar 21 '18 at 5:06
1
\$\begingroup\$

8. R, 64 bytes

.0->z;x=readLines();y=Vectorize(utf8ToInt)(x);any(grepl("->",x))

Try it online!

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 sequence -> in one of its lines.
\$\endgroup\$
1
\$\begingroup\$

10. Somme, 64 bytes

.1->Hi, Retina! I like French :D
"RVll;d.h:and random stuff too!

Try it online!

Verify it online!

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.

For future answers:

  • The first character is a .
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
\$\endgroup\$
1
\$\begingroup\$

7. Whispers, 66 bytes

.abcdefghijklmnopqrstuvwxyz
> ">"
> InputAll
>> 1∈2
>> Output 3

Try it online!

Outputs either True or False. Note the trailing new line.

Satisfies:

  1. The first character is a .
  2. It contains an e
  3. Its length is even
  4. Its length in characters is a perfect square
  5. It contains an a
  6. It contains a > character
\$\endgroup\$
  • \$\begingroup\$ Just FYI, this has 64 bytes, not 64 characters. not significant, just of note \$\endgroup\$ – Conor O'Brien Mar 19 '18 at 21:04
  • \$\begingroup\$ The Python 3 answer (#5) returns false when this is passed as input. I think it can be fixed by removing 2 characters from the alphabet at the top. \$\endgroup\$ – Potato44 Mar 19 '18 at 23:59
  • \$\begingroup\$ @Potato44 Are you sure you're including the trailing new line? \$\endgroup\$ – caird coinheringaahing Mar 20 '18 at 7:03
  • \$\begingroup\$ Yes, I checked again and I did have the newline. it is because the is a multi-byte chracter, and I believe the python submission is counting bytes. \$\endgroup\$ – Potato44 Mar 20 '18 at 7:08
  • \$\begingroup\$ @Potato44 No, it's because the Python submission is only reading the first line of input, not the whole thing \$\endgroup\$ – caird coinheringaahing Mar 20 '18 at 7:22
1
\$\begingroup\$

3. Jelly, 5 bytes

.
”ee

Try it online!

Checks whether the input contains a e character. Changed from to e because that seemed unfair to languages without that character. And, to verify, here's a hexdump:

00000000: 2e0a ff65 65                             ...ee

Satisfies:

  1. Starts with a .
  2. Contains an e
\$\endgroup\$
  • 2
    \$\begingroup\$ 5 bytes tells me this meant to be in the jelly codepage. Can we have a hexdump? \$\endgroup\$ – Potato44 Mar 20 '18 at 2:24
  • \$\begingroup\$ @Potato44 Hexdump added \$\endgroup\$ – caird coinheringaahing Mar 20 '18 at 7:58
1
\$\begingroup\$

18. Python 3, 144 bytes

.6;"ea->?"#"?>-ae";6.
"Hi, Retina!"
import sys
print(len(sys.stdin.read().split("\n"))>26+1)








































"|||||"
4.2

Try it online!

Outputs True if the input is at least 28 lines long, False otherwise.

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.

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ", and so is the twelfth character (palindromic rule).
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
  • It contains a ?.
  • It contains a |.
  • It contains a +.
  • It is at least 28 lines long.
\$\endgroup\$
1
\$\begingroup\$

16: Quarterstaff, 64

1 is truthy,

.1......."a".......1.
   1->a[Hi, Retina!]
  ?[-124(.|>a)?]
49a!

Try it online!

the indentation doesn't do anything, by the way.

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 |

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ", and so is the twelfth character (palindromic rule).
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
  • It contains a ?.
  • It contains a |
\$\endgroup\$
  • \$\begingroup\$ yeah but if the pyth answer isn't checking for "a", what is it checking for??? \$\endgroup\$ – Destructible Lemon Mar 20 '18 at 3:44
  • \$\begingroup\$ The pyth answer checks that the first line contains an a, this is because of the way pyth takes input. It looks like the OP made a mistake in either writing or analyzing their own code. Two earlier answers also have this problem. \$\endgroup\$ – Sriotchilism O'Zaic Mar 20 '18 at 3:45
  • \$\begingroup\$ @user56656 it was an easy fix \$\endgroup\$ – Destructible Lemon Mar 20 '18 at 3:46
  • \$\begingroup\$ @uset56656 I fixed the Pyth code now. Hopefully I didn’t break anything. Indeed, I made a mistake while copy-pasting from the online interpreter, accidentally taking the wrong program. Apologies for the inconvenience! \$\endgroup\$ – Mr. Xcoder Mar 20 '18 at 5:23
1
\$\begingroup\$

15. Python 3, 64 bytes

.1and(11*"""*11(dna1.
Hi, Retina!->   """)and(lambda s:"?"
in s)

Try it online!

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 ?.

For future answers:

  • The first character is a ..
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The 10-th character is a ".
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
  • It contains a ?.
\$\endgroup\$
  • \$\begingroup\$ @mbomb007 fixed \$\endgroup\$ – SuperStormer Mar 24 '18 at 0:16
1
\$\begingroup\$

31. Octave, 324 bytes

New requirement: All printable ASCII that are not previously forbidden must be part of the code. The complete list is: !"%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~.

.6;%+<-?|"	"|?-<+%;6.
f=@(x)all(ismember(horzcat(33,34,46,' %&''()*+,=/0123456789:;<->?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~'),x));	
%	>>
%	V'quQ9g8u'@f/&'A)eLS;p`t'{ZYv4R3aaa
%	bb
%	c
%	dd
%Henry Jams?Hi, Retina!	
%	e
%	ff
%	g
%	hh
%	i
%	jj
%	k
%	ll
%	m
%	nn
%	o
%	pp
%	q
%	rr
%	s
%	tt
%	u
%	vvv
%	a~

Try it online!

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

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?.
  • 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.
  • Adjacent lines must have different lengths
  • It contains all printable ASCII that are not previously forbidden. The characters are: !"%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~.
\$\endgroup\$
  • \$\begingroup\$ I'll happily delete it if cryptographic functions are disallowed, but it's not forbidden as of now. I actually had a good time brute forcing it though... \$\endgroup\$ – Stewie Griffin Mar 23 '18 at 13:47
  • \$\begingroup\$ If we don't disallow it, someone could do SHA-256 or worse, and again, there's no way we can prove that an infinite amount of strings are allowed when using these hash functions. \$\endgroup\$ – mbomb007 Mar 23 '18 at 13:54
  • \$\begingroup\$ All my tests show that it's enough to have 3 (perhaps 4) bytes that can be cherry picked, and you'll meet the crypto requirement with a very simple brute force. I could write an answer that would make it very hard for anyone else to follow, without using cryptographic functions, since there's no byte limit. I think it's better to just discourage future answers from deliberately attempting to break the chain. That's just my two cents though :) \$\endgroup\$ – Stewie Griffin Mar 23 '18 at 22:34
  • \$\begingroup\$ I think any answer that requires another answerer to use brute force is in bad taste. \$\endgroup\$ – mbomb007 Mar 24 '18 at 3:58
  • \$\begingroup\$ I agree to a certain degree. That's why I'd be happy to delete this answer if it becomes disallowed. \$\endgroup\$ – Stewie Griffin Mar 24 '18 at 7:00
0
\$\begingroup\$

6. Pyth, 16 bytes

.e}\as.zS13    5

Try it here!

Checks if the input contains an a. Outputs either:

  • [True, True, True, True, True, True, True, True, True, True, True, True, True] for truthy

  • or [False, False, False, False, False, False, False, False, False, False, False, False, False] for falsy

Satisfies:

  1. starts with a .
  2. contains an e
  3. has an even length
  4. has a perfect square length
  5. contains an a
\$\endgroup\$
  • 2
    \$\begingroup\$ Correct me if I'm wrong, but from testing the answer I'm working on this seems to only check whether an a is in the first line. At least 2 answers are wrong because that does not match what the text of this answer says (and people aren't testing their answers). \$\endgroup\$ – Potato44 Mar 20 '18 at 2:36
  • \$\begingroup\$ @Potato44 My bad, apologies! Fixed. \$\endgroup\$ – Mr. Xcoder Mar 20 '18 at 5:06
  • \$\begingroup\$ @Mr.Xcoder did you make sure it doesn't satisfy any of the "future" conditions? it doesn't appear to \$\endgroup\$ – Destructible Lemon Mar 20 '18 at 6:42
  • \$\begingroup\$ @DestructibleLemon Does this satisfy any of the future conditions? I couldn't seem to find any requirement this violates. \$\endgroup\$ – Mr. Xcoder Mar 20 '18 at 9:53
  • \$\begingroup\$ @Mr.Xcoder I believe it does not \$\endgroup\$ – Destructible Lemon Mar 20 '18 at 10:03
0
\$\begingroup\$

20. Jelly, 100 bytes

This code checks whether or not Henry Jams?. Returns 1 for truthy, 0 for falsy.

.6;%+->?|"e"|?>-+%;6.
Hi, Retina!->0123456789
0123456789
0123
























“Henry Jams?”ẇ

Try it online!

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.

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60.
  • The 10-th character is a ", and so is the twelfth character (palindromic rule).
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
  • It contains a ?.
  • It contains a |.
  • It contains a +.
  • It is at least 28 lines long.
  • The following characters can only be used five times in total: !"#$.[\].
    • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
  • Each program must contain Henry Jams? as a continuous substring.
\$\endgroup\$
0
\$\begingroup\$

22, Octave, 100 bytes

Executive summary: There must now be an uppercase C in the code.

.6;%+->?|"e"|?>-+%;6.
'Hi, Retina!Henry Jams?';
f=@(x)any(x=='C');
%Any C?























%~

Try it online!

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

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • The 10th character is a ", and so is the 12th character (palindromic rule).
  • The first line is a palindrome of length 21.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60 (the printables are ',1;6 and tab).
  • The last character is ~.

  • Its length is an even perfect square.
  • It is at least 28 lines long.
  • The last non-empty line does not have any duplicate characters.

  • Contains the exact sequence ->.
  • Contains the exact strings Hi, Retina! and Henry Jams?.
  • It contains |, + and C.

  • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
\$\endgroup\$
0
\$\begingroup\$

19, Octave, 196 bytes

Note: I made an edit to the code, to fix an error. The only change was to include the palindrome rule. This avoids a false positive for answer 10.


Most requirements up until now can easily be circumvented using comments and suppressed strings, making it trivial to add answers. I figured I'd make it a bit harder by disallowing some characters instead.

.6;%+->?|"e"|?>-+%;6.
f=@(x)all(ismember('Hi, Retina!',x))&sum(ismember(x,cat(2,33:36,46,91:93,'')))<6&x(2)<60&all((k=x(1:find(x==10,1)-1))==flip(k))
%













































Try it online!

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.

For future answers:

  • The first character is a ., and so is the 21st character (palindromic rule).
  • Its length is an even perfect square.
  • Contains the exact sequence ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4, and its code point is lower than 60.
  • The 10-th character is a ", and so is the twelfth character (palindromic rule).
  • The last non-empty line does not have any duplicate characters.
  • The first line is a palindrome of length = 21
  • It contains a ?.
  • It contains a |.
  • It contains a +.
  • It is at least 28 lines long.
  • The following characters can only be used five times in total: !"#$.[\].
    • Each program is now allowed only the 2 . and 2 " in the first line, and the ! in Hi, Retina!. Those characters cannot be used anywhere else, in addition to no uses of #$[\].
\$\endgroup\$
  • \$\begingroup\$ I didn't downvote, but citing OP: This will probably be more fun if you try to maximize your own score rather than "win" the challenge. \$\endgroup\$ – Uriel Mar 20 '18 at 11:55
  • \$\begingroup\$ I didn't downvote, but maybe the downvoter did so because you validate two things in one answer instead of one. There isn't any rule that disallows this, but I can imagine someone downvoting because of that. (Or because they had an answer planned which isn't possible anymore, although that would be a pretty childish reason to downvote imo..) Because I can't see anything wrong with it, I upvoted to neutralize. \$\endgroup\$ – Kevin Cruijssen Mar 20 '18 at 12:03
  • \$\begingroup\$ can you raise the 5 character limit to something higher or exclude . before another answer is due? since first line is palindrome it leaves only 3 dots, which is almost impossible in most OOP verbose langs. also 5 " and `` makes it almost impossible to create multiline strings \$\endgroup\$ – Uriel Mar 20 '18 at 13:01
  • \$\begingroup\$ The good news is that I know a couple languages that should still work. \$\endgroup\$ – mbomb007 Mar 20 '18 at 15:03
  • \$\begingroup\$ Thanks for noticing, I have fixed it now without affecting the chain. I must have copied the code from the wrong tab (I had similar codes in several tabs for testing purposes). \$\endgroup\$ – Stewie Griffin Mar 21 '18 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.