Using the 74 characters from the 2016 time capsule string
H@~*^)$.`~+1A|Q)p~`\Z!IQ~e:O.~@``#|9@)Tf\eT`=(!``|`~!y!`) Q~$x.4|m4~~&!L{%
write N code snippets all in the same language where:
- The 1st snippet outputs
1
. - The 2nd snippet outputs
2
. - The 3rd snippet outputs
3
. - ... etc. ...
- The Nth snippet outputs
N
(the number, not the literal letter).
A "code snippet" is defined as any of these:
- A full program with no required input that outputs the number normally.
- A function with no required arguments that outputs/returns the number normally.
- A REPL expression that evaluates to the number.
(You may mix and match these three variants in your N snippets.)
The characters you're allowed to use in the combined set of N snippets are precisely the 74 characters of the time capsule, plus floor(N/2)
extra "wildcard" bytes that you may use anywhere.
For example, the time capsule contains three @
's so in the entirety of your N snippets there may only be up to three @
's present unless you decide to use some of your floor(N/2)
wildcard bytes for additional @
's.
Thus, not counting wildcards, the combined set of characters in your N snippets must be a subset of the 74 time capsule characters. Their combined lengths cannot exceed 74. You may not reuse time capsule characters or wildcard bytes between snippets.
Notes
The are no other limits on snippet length or how many wildcards may be used per snippet.
You must write all snippets for 1 through N. It's not 0 to N-1, not k to N+k-1.
The snippets must be individual, not one snippet that outputs the list
1, 2, 3, ..., N
.Outputs may be floats like
3.0
in place of3
and you can use a base other than decimal if it is your language's natural base. You must use the same base for all snippets.The wildcards are counted as bytes in your language's encoding. This will probably be ASCII but e.g. if
∞
counts as one byte in your encoding then you can use it as a single wildcard byte.You may use wildcard bytes for multibyte characters. e.g.
∞
is normally three bytes so you could use it in a snippet but it will cost three of yourfloor(N/2)
wildcard bytes.Newlines such as
\r\n
may be considered one byte.
Example
In Python, N = 4 is possible just using the REPL. There are floor(4/2) = 2
wildcards.
1
from the time capsule is an expression that evals to1
.2
consists of a single wildcard, namely the2
. Evals to2
.3
also consists of a single wildcard. Evals to3
. No more wildcards.4
is luckily in the time capsule and it evals to4
.
These snippets are short and trivial. A real answer would likely be much more complex.
(Five and beyond in Python may certainly be possible but I'll leave it to the professionals.)
Scoring
The answer with the highest N wins; i.e. the one that climbs the integer ladder the highest.
In case of a tie, the answer that used the fewest wildcard bytes wins.
In case there is still a tie, the answer that used the fewest cumulative characters wins.
If there is still a tie, the earlier answer wins.
4
a valid snippet that returns 4, in older versions of Perl which have no REPL?) \$\endgroup\$07
the same as7
? \$\endgroup\$-
norn
... \$\endgroup\$