Does it Lead or Follow?

48

5

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

Post Rock Garf Hunter

Posted 2018-03-19T20:09:13.077

Reputation: 55 382

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. – Steadybox – 2018-03-19T21:04:43.110

@Steadybox The TIO link would be hard to constantly update, no? – totallyhuman – 2018-03-19T21:06:16.800

1@totallyhuman The answerer could update it – Conor O'Brien – 2018-03-19T21:06:31.653

@ConorO'Brien Is there a language everybody knows? :P – totallyhuman – 2018-03-19T21:06:56.670

1Here's a ruby script which does that – Conor O'Brien – 2018-03-19T21:07:26.677

@Arnauld I've gone ahead and added that. Thanks for the suggestion. – Post Rock Garf Hunter – 2018-03-19T21:07:45.543

@Steadybox On second thought it might be better to have a TIO link that is carried through with the answers like the answer chaining polyglot. – Post Rock Garf Hunter – 2018-03-19T21:11:52.627

@user56656 Yes, that might be better. – Steadybox – 2018-03-19T21:13:25.520

+1 for "The last answer will score its answerer -∞ points." Prior to reading that I was a bit worried that someone could 'win' the challenge by making it more or less impossible to add more answers. I hope all the answerers take note of this rule! – Nathaniel – 2018-03-20T06:10:39.833

–1 for (1) the requirement that my answer as input to an older program must return something specific, which requires me to know a language used by someone else; (2) being unclear in your second bullet point ("an older answer") whether every older program or one of my choosing must return its truthy. – msh210 – 2018-03-20T07:28:27.770

@msh210 I've gone ahead and fixed the ambiguity. – Post Rock Garf Hunter – 2018-03-20T13:06:33.290

1@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. – 0 ' – 2018-03-21T06:40:18.107

@totallyhuman I'm pretty sure Python is the most popular language on the site. – mbomb007 – 2018-03-21T14:22:49.777

1@user56656 Can you please address the issue of what cryptographic functions are allowed? See #31. – mbomb007 – 2018-03-26T14:10:01.057

@mbomb007 Since people seem to be in support of disallowing it I have disallowed it. – Post Rock Garf Hunter – 2018-03-27T04:26:08.033

What if someone post a length lowerbound? It desn't block the chain, but make it hard to test – l4m2 – 2018-04-01T00:13:14.927

@l4m2 A length lowerbound is consistent with the rules so it is ok – Post Rock Garf Hunter – 2018-04-01T00:42:26.757

Answers

10

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

bitconfused

Posted 2018-03-19T20:09:13.077

Reputation: 529

2Can the space in the "s be replaced with an a? – Destructible Lemon – 2018-03-20T03:52:02.217

@DestructibleLemon Yup! Fixed. – bitconfused – 2018-03-20T03:59:52.930

1@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. – msh210 – 2018-03-20T07:46:44.253

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.

– Post Rock Garf Hunter – 2018-03-21T15:58:39.287

@user56656 Just ran it in the editor, it prints the falsey value of "Bye Retina!" in the live console feed. – bitconfused – 2018-03-21T19:00:03.593

@bitconfused Doesn't your program also output Bye Retina!? That's what I get when I run your program into itself. Perhaps I am running things incorrectly. – Post Rock Garf Hunter – 2018-03-21T19:01:47.393

@user56656 The example input in the link is missing a char in the first line so yes it should print Bye Retina! – bitconfused – 2018-03-21T19:05:10.907

7

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.

Martin Ender

Posted 2018-03-19T20:09:13.077

Reputation: 184 808

7

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

Lynn

Posted 2018-03-19T20:09:13.077

Reputation: 55 648

Just about to post my answer, aaand now it's impossible ahhhhhh – bitconfused – 2018-03-19T22:33:52.640

Oops, I'm deleting this until the V answer is fixed. – Lynn – 2018-03-19T22:45:38.453

Just for context I was using x86 assembly and there's no assembler directive that begins with .1. Perhaps this restriction of the second character being 1 could be changed so that the second to last character of the palindrome mod 5 must be 4? – bitconfused – 2018-03-19T22:56:29.317

1@bitconfused I changed it, just for you...! – Lynn – 2018-03-19T23:16:28.580

1You're too good for this world! – bitconfused – 2018-03-19T23:16:58.027

1@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. – msh210 – 2018-03-20T07:45:14.437

Sorry for the inconvenience, I fixed the Pyth code and solved the issue

– Mr. Xcoder – 2018-03-20T09:55:57.740

@msh210 I don't expect the answerer to know pyth. I do however expect the answerer to try their program to make sure it fits the criteria. – Post Rock Garf Hunter – 2018-03-20T13:12:17.913

6

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.

Stewie Griffin

Posted 2018-03-19T20:09:13.077

Reputation: 43 471

Note that this isn't code golf. – ericw31415 – 2018-03-22T01:11:22.183

1I know, but it's more fun to golf it than padding it with 50 bytes. :) – Stewie Griffin – 2018-03-22T08:00:12.427

5

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

Uriel

Posted 2018-03-19T20:09:13.077

Reputation: 11 708

I haven't tried this but does it actually return false for e.g. 99999999^2+1 and true for e.g. 99999999^2? – msh210 – 2018-03-20T07:35:47.567

1This 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? – caird coinheringaahing – 2018-03-20T08:00:05.347

@cairdcoinheringaahing fixed, thanks! – Uriel – 2018-03-20T10:42:00.037

5

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

Arnauld

Posted 2018-03-19T20:09:13.077

Reputation: 111 334

5

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 #$[\].

Laikoni

Posted 2018-03-19T20:09:13.077

Reputation: 23 676

There goes my chance to post another Whitespace answer down the road. ;p – Kevin Cruijssen – 2018-03-21T14:42:06.133

5

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

Lynn

Posted 2018-03-19T20:09:13.077

Reputation: 55 648

426 is here (non-obvious when sorting by oldest.) – Lynn – 2018-03-21T14:23:42.693

4

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.

James

Posted 2018-03-19T20:09:13.077

Reputation: 54 537

4

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 #$[\].

Uriel

Posted 2018-03-19T20:09:13.077

Reputation: 11 708

4

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.

mbomb007

Posted 2018-03-19T20:09:13.077

Reputation: 21 944

4225 is not even? – Destructible Lemon – 2018-03-21T00:06:10.107

@DestructibleLemon I added padding and changed my answer to make it #26. – mbomb007 – 2018-03-21T13:19:42.317

4

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

Post Rock Garf Hunter

Posted 2018-03-19T20:09:13.077

Reputation: 55 382

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) – Lynn – 2018-03-21T18:22:50.457

@Lynn I don't know. I can't remember what was wrong. I'll go ahead and uncomment it. Thanks. – Post Rock Garf Hunter – 2018-03-21T18:23:56.990

4

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.

Dom Hastings

Posted 2018-03-19T20:09:13.077

Reputation: 16 415

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. – Davis Yoshida – 2018-03-22T19:07:15.313

4

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

mbomb007

Posted 2018-03-19T20:09:13.077

Reputation: 21 944

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? – Davis Yoshida – 2018-03-22T23:01:43.187

@DavisYoshida The TIO link I shared works. Idk how – mbomb007 – 2018-03-23T03:05:52.483

Yeah there's nothing wrong with it, but if you want to execute it from a bash script you need to call an interpreter – Davis Yoshida – 2018-03-23T03:18:00.660

@DavisYoshida Ask Dennis in the TIO chat room. – mbomb007 – 2018-03-23T13:27:31.480

@DavisYoshida This is how TIO calls fish: https://github.com/TryItOnline/tryitonline/blob/master/wrappers/fish

– Potato44 – 2018-03-26T13:18:48.723

Well, for this program to work, it requires the arguments -v 0 -v 0 – mbomb007 – 2018-03-26T14:06:45.390

2

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.

caird coinheringaahing

Posted 2018-03-19T20:09:13.077

Reputation: 13 702

2

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

Conor O'Brien

Posted 2018-03-19T20:09:13.077

Reputation: 36 228

How do I pass input to this code? It is not clear to me from the TIO link. – Post Rock Garf Hunter – 2018-03-21T05:05:08.940

@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 – Conor O'Brien – 2018-03-21T05:06:04.640

Oh I see, you changed the code that's why the code doesn't appear in the footer. – Post Rock Garf Hunter – 2018-03-21T05:06:47.773

@user56656 oh yes, sorry about that – Conor O'Brien – 2018-03-21T05:07:39.723

2

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 #$[\].

Giuseppe

Posted 2018-03-19T20:09:13.077

Reputation: 21 077

1

2. Triangularity, 17 bytes

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

Try it online!

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

Mr. Xcoder

Posted 2018-03-19T20:09:13.077

Reputation: 39 774

15You've already eliminated a lot of practical languages. :( – totallyhuman – 2018-03-19T20:34:38.130

That doesn't include Python, but it indeed rules out i.e Haskell – Mr. Xcoder – 2018-03-19T20:35:08.307

2if your language supports floats just being anywhere in the code, .3 or similar would work – Conor O'Brien – 2018-03-19T20:35:34.710

This is a problem – Post Rock Garf Hunter – 2018-03-21T04:59:00.657

@user56656 Ouch, that seems to be an internal bug with indexing... I’ll fix it later today – Mr. Xcoder – 2018-03-21T05:06:04.220

1

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

caird coinheringaahing

Posted 2018-03-19T20:09:13.077

Reputation: 13 702

25 bytes tells me this meant to be in the jelly codepage. Can we have a hexdump? – Potato44 – 2018-03-20T02:24:04.457

@Potato44 Hexdump added – caird coinheringaahing – 2018-03-20T07:58:36.307

1

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

caird coinheringaahing

Posted 2018-03-19T20:09:13.077

Reputation: 13 702

Just FYI, this has 64 bytes, not 64 characters. not significant, just of note – Conor O'Brien – 2018-03-19T21:04:56.807

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. – Potato44 – 2018-03-19T23:59:16.217

@Potato44 Are you sure you're including the trailing new line? – caird coinheringaahing – 2018-03-20T07:03:06.767

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. – Potato44 – 2018-03-20T07:08:40.993

@Potato44 No, it's because the Python submission is only reading the first line of input, not the whole thing – caird coinheringaahing – 2018-03-20T07:22:31.007

Well it seems not to be working for me TIO, but this does TIO

– Potato44 – 2018-03-20T07:56:12.597

@Potato44 This might help

– caird coinheringaahing – 2018-03-20T07:57:07.993

okay, this answer is still wrong then, but removing the 2 characters fixes it for a different reason than I thought, it makes the first line 25 characters long. This creates a bit more of a problem because one of the later answers requires the first line to be 21 characters long, I'll bring this up in chat or in comments on the other answers. – Potato44 – 2018-03-20T08:14:13.443

1

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.

Giuseppe

Posted 2018-03-19T20:09:13.077

Reputation: 21 077

1

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.

Conor O'Brien

Posted 2018-03-19T20:09:13.077

Reputation: 36 228

1

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

SuperStormer

Posted 2018-03-19T20:09:13.077

Reputation: 927

@mbomb007 fixed – SuperStormer – 2018-03-24T00:16:15.957

1

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 |

Destructible Lemon

Posted 2018-03-19T20:09:13.077

Reputation: 5 908

yeah but if the pyth answer isn't checking for "a", what is it checking for??? – Destructible Lemon – 2018-03-20T03:44:16.757

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. – Post Rock Garf Hunter – 2018-03-20T03:45:17.997

@user56656 it was an easy fix – Destructible Lemon – 2018-03-20T03:46:04.867

@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! – Mr. Xcoder – 2018-03-20T05:23:29.967

1

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.

Mr. Xcoder

Posted 2018-03-19T20:09:13.077

Reputation: 39 774

1

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

Stewie Griffin

Posted 2018-03-19T20:09:13.077

Reputation: 43 471

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... – Stewie Griffin – 2018-03-23T13:47:03.043

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. – mbomb007 – 2018-03-23T13:54:56.360

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 :) – Stewie Griffin – 2018-03-23T22:34:45.360

I think any answer that requires another answerer to use brute force is in bad taste. – mbomb007 – 2018-03-24T03:58:46.623

I agree to a certain degree. That's why I'd be happy to delete this answer if it becomes disallowed. – Stewie Griffin – 2018-03-24T07:00:11.547

Undeleted, since the previous answer #31 is deleted. – Stewie Griffin – 2018-04-11T08:40:37.713

0

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

Mr. Xcoder

Posted 2018-03-19T20:09:13.077

Reputation: 39 774

2Correct 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). – Potato44 – 2018-03-20T02:36:49.620

@Potato44 My bad, apologies! Fixed. – Mr. Xcoder – 2018-03-20T05:06:40.237

@Mr.Xcoder did you make sure it doesn't satisfy any of the "future" conditions? it doesn't appear to – Destructible Lemon – 2018-03-20T06:42:19.267

@DestructibleLemon Does this satisfy any of the future conditions? I couldn't seem to find any requirement this violates. – Mr. Xcoder – 2018-03-20T09:53:03.533

@Mr.Xcoder I believe it does not – Destructible Lemon – 2018-03-20T10:03:20.943

0

17, Whitespace, 100 bytes

.|?|?|?|?"+"?|?|?|?|.
Hi, Retina!-> 















 abcdefgh

I guess the perfect language for this challenge, and I might post more when the chain has progressed.

Try it online.

Outputs 1 if the input contains a +, or nothing otherwise.

I created a script to check all the characters the previous answers didn't contain yet, and + was the first one, so I've used that as a validation for my answer. My program also returns true in the TIO-links of all previous answers (except in X86 Assembly (gcc 6.3) where I got an error.., although my answer does satisfy to all the rules of the previous answers).

Satisfies / For future answers:

  • The first and twenty-first characters are ..
  • Its length is even and a perfect square.
  • Contains the exact string ->.
  • Contains the exact string Hi, Retina!.
  • The second character's Unicode code point, mod 5, is 4.
  • The tenth and twelveth characters are ".
  • 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 +.

Explanation:

In Whitespace, every character except for spaces, tabs and new-lines are ignored. Here is the base program with just the spaces, tabs and new-lines:

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

[N
S S N
_Label_LOOP][S S S N
_Push_0][S N
S _Duplicate_0][T   N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve][S S S T  S S S S S N
_Push_43][T S S T   _Subtract][N
T   S S N
_Jump_to_Label_TRUE_if_0][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_TRUE][S S S T N
_Push_1][T  N
S T _Print_as_integer][N
S N
S _Jump_to_Label_EXIT]

Kevin Cruijssen

Posted 2018-03-19T20:09:13.077

Reputation: 67 575

1According to the rules, If you pass any older answer to your answer as input it should output the falsy output (of your program) – This fails on the Pyth, Whispers, Retina, Somme, Python, Quarterstaff, X86 Assembly, Perl and Javascript answers. – Mr. Xcoder – 2018-03-20T10:00:45.007

@Mr.Xcoder Should be fixed now. None of the other answers contains a +, so I've used that instead of space. – Kevin Cruijssen – 2018-03-20T10:13:17.660

0

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 #$[\].

Stewie Griffin

Posted 2018-03-19T20:09:13.077

Reputation: 43 471

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. – Uriel – 2018-03-20T11:55:19.747

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. – Kevin Cruijssen – 2018-03-20T12:03:01.613

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 – Uriel – 2018-03-20T13:01:36.653

The good news is that I know a couple languages that should still work. – mbomb007 – 2018-03-20T15:03:45.220

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). – Stewie Griffin – 2018-03-21T08:31:49.103

0

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.

dylnan

Posted 2018-03-19T20:09:13.077

Reputation: 4 993

0

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 #$[\].

Stewie Griffin

Posted 2018-03-19T20:09:13.077

Reputation: 43 471