It's not a whole lot to work with, but round here we like a challenge.

The Challenge

To determine what language is "best" with the time capsule string we'll have 6 (for 2016) challenges that increase in difficulty where in each you must use a subset of the 74 time capsule characters.

Having 6 distinct challenges helps ensure more languages can compete, but only the best languages will be able to answer all of them and score high.

Scoring:

Each challenge will be scored from 0 to 74 depending on how many characters are used.

Higher scores are better.

If your language cannot complete a challenge, your score for that challenge is 0.

Any nonempty subset of the challenges may be completed.

Your final score is the sum of scores from all 6 challenges.

The best final score possible is 6×74 or 444.

The Challenges

1. Run

If a language's code can't run in the first place it won't be able to do anything at all.

Write the longest full program possible (using only the 74 time capsule characters, remember) that runs/executes without compile-time or runtime errors.

It doesn't matter what the program does, it doesn't matter if it has input/output or enters an infinite loop, it only matters that it runs without errors. (Warnings are ok, as are errors caused by bad user input.)

4. Loopability

A language that can't do loops will spawn repetitive code so tedious you'll need to take a programming break for a while.

Given a positive integer, output an ASCII-art square of that side length filled with a pattern of concentric smaller squares that alternates between any two distinct printable ASCII characters. They don't have to be the same two characters for different inputs.

6. Esotericism

Write the longest quine you can, according to usual quine rules. A quine is a program that takes no input and outputs itself.

Score = program length (longer program is better)

Specific Rules

In each of the 6 challenges your program must be a subset of the 74 time capsule characters rearranged any way you like. It may be an empty subset or an improper subset, so each of your programs could have as few as 0 and as many as 74 characters.

A single trailing newline at the end of input/output/code is alright anywhere since some languages require this or it cannot be easily avoided.

Unless otherwise specified, each challenge may be completed as a function or full program according to our defaults.

All challenges must be completed in the same language.

You must use a language (or version of a language) made before it was 2017 anywhere on Earth.

Anyone is welcome to answer, whether you added a character to the time capsule or not.

Feel free to use the 2016 time capsule characters in your own challenges.

\$\begingroup\$fairly sure that 6×74 or 444 is not possible, as that would mean empty programs, which somehow behave differently. hence, 442 is the actual minimum, as that means that two of the 3 input taking programs have a char in them\$\endgroup\$
– Destructible LemonJan 3 '17 at 9:14

27 Answers
27

1. Run (74 bytes)

2. IO (36 bytes)

!!!#!$!$4419TAHT\ee\OQQQ))*+)..)|~~~

Explanation

Glypho seemed like a fairly good choice for this challenge, because it doesn't care about the actual characters being used. Instead, it looks at groups of four characters and chooses the command based on the pattern of repetition in those four characters. Since there are a lot of duplicates among the time capsule string, we're fairly flexible in the programs we can write, except that we're limited to programs of 18 commands (which isn't a whole lot in Glypho). While this allowed me to solve the first two problems quite easily, I doubt that Glypho can run the others with so few characters.

Work

2

This is most definitely impossible. The only ways to manipulate character values are a. and u:, and we have access to neither.

Now, if we could use a instead of, say, A, then this would be a solution:

Q{~(*^.4%9 1)+I.~&Q=:a.

The hardest part to getting this to work was producing the number -1.

Q{~(*^.4%9 1)+I.~&Q=:a.
a. The array of all bytes.
Q=: Bind it to Q
I.~& and find the input's index in it.
( )+ Add the following array:
* Signum of
^. logarithm of
4% 4 divided by
9 1 the array 9 1.
This evaluates to -1 1.
Q{~ Index back into Q.

4

(*.1:"|~@+.)

This generates the shape of the husk, but I can't seem to find a way to generate characters. Alas.

5

Admittedly, this seems like the easiest of the tasks to do in J. However, without i., this will be quite hard.

6

This is likely impossible without a fake-out quine like 449 or something like that, because the capsule string doesn't contain quotes or any other way of producing J strings.

\$\begingroup\$For task 2, Q{~1+I.~&Q=:a. gives the next character: bind the alphabet a. to Q, find the input's index in it with I., add one, and index into Q. Try it. The only remaining problem is to produce -1...\$\endgroup\$
– ZgarbJan 4 '17 at 8:55

\$\begingroup\$Also, task 3 can be done without string functions: +16=100&|. You just need to produce 16 and 100 somehow.\$\endgroup\$
– ZgarbJan 4 '17 at 11:51

\$\begingroup\$Ha, I think I got 3: +($@#~@$~4)=1e4|&%:*~ It was extremely annoying because we only have one each of (&=:+* and two 4s.\$\endgroup\$
– ZgarbJan 4 '17 at 12:39

\$\begingroup\$Aaand here's 2: Q{~(*^.4%9 1)+I.~&Q=:a. I realized that the logarithm ^. gives negative numbers for inputs strictly between 0 and 1, and we have % for producing fractions and * for taking the results to -1 and 1.\$\endgroup\$
– ZgarbJan 4 '17 at 13:13

1. Run - Score: 74

Since this is extremely difficult in PowerShell (every possible method of obtaining input is impossible with the characters given, as far as I can tell), I've at least decided to randomize the first challenge so we're not all copying the example directly from the post.

So here's a random challenge 1 answer generator (for languages where # is a comment):

\$\begingroup\$I think you're correct. The closest we could get would be $^ which is "the first token of the previous line in the session," which would be extremely limited and very likely a severe bending of standard I/O rules.\$\endgroup\$
– AdmBorkBorkJan 3 '17 at 16:32

\$\begingroup\$@TimmyD yeah, $^ is blank in a new session anyway.\$\endgroup\$
– briantistJan 3 '17 at 16:34

I removed all backticks (`) and mathematical operators. They conflicted because there weren't enough numbers to satisfy every unary and binary operator. I left some in, resulting in +3 bytes. Resulting program:

!!!!!#$$%&())))...+1^4*49:=@@@AHILOQQQTTZ\\eefmpxy{||||~~~~~~~~~

I have no idea why and how this worked. Atleast it doesn't throw any C# runtime exception, and doesn't therefore crash.

6: Quine

You know, if there would've been an - or lowercase q somewhere in those 74 characters, this would be way too easy. I'm glad for the I operator, atleast.

1/4I

This code isn't exactly obvious. Here's an explanation:

1 Set object to 1 (1)
/4 Divide by 4 (0.25)
I Set object to a fraction string. (1/4)

Fraction strings (e.g. 1/4) are displayed with an I at the end, to indicate exactly that. The I operator is usually useless, I added it for other means, but hey, it works like this!

Above code is invalid. Stupid me didn't see that the 74 characters don't contain a single division operator, forwardslash (/). I came up with something else though:

True

Explanation:

T Set object to "true" (bool value)
rue None of these are valid tokens, so they don't get interpreted.

Outputs True (because of how the way C# handles Boolean.ToString() uppercase and not lowercase). Not sure if this is a proper quine, meanwhile I'm still cracking my head for a valid, really proper, and intuitive one.

Could maybe also solve I/O and Math challenge, but I'm missing specific tokens (characters) which aren't included in the 74 characters.

\$\begingroup\$It actually does produce output. It produces those characters. They may not be "printable" (read: visible), but they are still sent to stdout nonetheless.\$\endgroup\$
– mbomb007Jan 4 '17 at 14:45

Octave, score 74

1. Run

50 of these characters are part of the function, while the remaining 24 are not.

What it does:

x =@(AHILOQQQTTZeefmpy) creates a function x that can take a variable AHILOQQQTTZeefmpy as input.

To understand the rest:

a||b calls the function all() on both a and b. If one or both of those return true, the || operator will return true.

!a and ~a means the same thing here, they are both not(a).

a.^b is an element-wise power (a(1)^b(1), a(2)^b(2) ...)

Continued explanation

I'll shorten each of the steps as I go along:

4.^.4||9 % This is 4 raised to the power of .4||9
% .4||9 is true, since both .4 and 9 are true
% true is evaluated to 1 when used in an expression
... % 4 raised to the power of 1 is simply 4.
4 % The above expression simplified

And:

!!!!!~~~~~~~~~4 % ! and ~ are the not() operator, so this is equivalent to:
not(not(not(not(not(not(not(not(not(not(not(not(not(not(4))))))))))))))

There is an even number of not, so this is equivalent to not(not(4)) which is true or 1.

Challenges faced

I might try the other challenges ... they'd be extremely hard and may involve bending the rules in weird ways but liberal use of the | mirrors and the ! trampolines should make at least one more challenge possible.

These challenges are particularly hard because we're not allowed any outputs with *><> (o and n), or even function calls (C), function returns (R), or program terminators (;). Even though we're also missing i for input, we can still have input placed on the stack which is a plus. Another plus is that we get a single p instruction, which allows us to replace an instruction in the codebox. This might be able to be used multiple times (haven't figured out a practical way yet), which would start to make the other programs seem more possible (as we'd be able to generate two or more instructions).

Other challenges

I doubt that any of the other challenges are possible, most notably because of the lack of possible variable names that can appear twice, which is only e (or something like eQT), because variable names can't start with an uppercase letter. Of course, having only one = doesn't help either.

It's fairly tricky to write a program with arbitrary characters that doesn't error in Pyth. I set myself the additional challenge of requiring that the program run without requiring user input, as well.

The first step is to use # to eat all of the errors. Next, we need to avoid errors caused by ~, I and L, which each have their own details. This is achieved by putting them inside the $$, which embeds them inside the output compilation, and thus subjects them to Python's compilation rules, not Pyth's. Finally, to avoid taking user input, the various arity 0 tokens (Variables and similar) are placed at the end, and the Qs are moved inside the $$ block.

2. IO

This will be incredibly difficult, if it's even possible. None of the Pyth functions that create arbitrary strings or characters are present except .f, and that does a really poor job of creating arbitrary characters.

3. Branchability: 74 - 17 = 57

This code takes the input mod 100, compares it to 16, and then uses a ternary to choose between the input and the input plus one. Due to character restrictions, I made some substitutions:

Instead of ?, the ternary, I used |&, or then and, which has the same functionality, except that it breaks if the input is zero, but since we're guaranteed positive integer input, it's fine. (This could have been fixed for no additional characters, but it's simpler this way.)

Instead of directly comparing the two numbers, I take their XOR with x, which is zero if and only if they're equal, as desired.

Instead of writing 100 directly, I generate it with *TT, since T is initialized to 10.

Instead of writing 16 directly, I generate it with ye|LZ9. |LZ essentially functions as the range function, so |LZ9 gives [0, 1, 2, 3, 4, 5, 6, 7, 8]. e takes the final element of a list, giving 8. y doubles it, giving 16 as desired. With an extra + or an extra * I could save a character, but they're both more useful elsewhere.

\$\begingroup\$@MartinEnder In my browser, that program outputs its source code literally. It's a statement that evaluates to itself. I'm not sure what you're saying; there is no different part of the source.\$\endgroup\$
– wizzwizz4Jan 3 '17 at 12:28

1

\$\begingroup\$@wizzwizz4 this community has more requirements for quines than just "the program prints its own source", because that allows for various kinds of cheating solutions that are not in the spirit of quines. See the link.\$\endgroup\$
– Martin EnderJan 3 '17 at 12:30

1

\$\begingroup\$@wizzwizz4 from the top voted answer "It must be possible to identify a section of the program which encodes a different part of the program. ("Different" meaning that the two parts appear in different positions.)" As for Golf you a quine for great good, the challenge (and the linked answer) are several years older than the linked meta post.\$\endgroup\$
– Martin EnderJan 3 '17 at 13:16

Pip, score 74 + (74 - 19) = 129

Task 1, score 74

Basically just a series of pattern (regex) literals in backticks, the last of which is printed. Since there are an odd number of backticks, we have to backslash-escape one of them (`\``). Try it online, with the -w flag added to prove that no warnings are generated.

Task 3, score 55 (length 19)

e+!!e%(1.#x.!9)=4*4

Using a rather odd input method--the fifth command-line argument--this is possible. Try it online!

Other tasks

It's possible to get input for task 2, by the same method as task 3 above. The trouble is converting to ASCII code and back to a character. The former can be done with A, but the latter requires C, or possibly indexing into the PA variable. Constructing and evaluating code can't be done without V. I don't think the task is possible.

Task 4 is challenging even without a restricted character set. At a guess, it would require lists (without using the [] delimiters or RL (repeat list) and only having one chance to use AL (append list)--not likely) or possibly something with CG (coordinate grid) or MC (map coords), both disallowed.

Task 5 is on the edge of possibility. Loops would be difficult, since For and Map aren't possible, and ranges can't be constructed with ,. There might be something to be done with Till. Increment could be of the x:x+1 variety (obviously with a variable other than x, though). Divisibility checks can use %. Still, I don't think there are enough characters--especially repeated letters--to do everything that needs to happen.

Task 6 looks completely impossible. All known Pip quines have " in them. They also use R (replace), RP (repr), or V (eval), none of which are available.

\$\begingroup\$The quine program will (hopefully) be quite simple, if you can make some ops into noops.\$\endgroup\$
– wizzwizz4Jan 3 '17 at 11:45

1

\$\begingroup\$The quine program is not simple. You cannot use Q at all (since it's the quining builtin), and there's no double quotes, so you can't do any string formatting. I worked for a while on this yesterday, and I'm fairly certain the other programs are not possible solely with the 74 characters.\$\endgroup\$
– Mego♦Jan 3 '17 at 23:16

\$\begingroup\$And there doesn't seem to be the italic f... :(\$\endgroup\$
– user48538Jan 4 '17 at 5:27

(abused) PHP, 74 + 74 = 148

The PHP interpreter simply dumps the source code until it finds a <? since we lack < every permutation of those chars is a running quine. I guess this is not that worse than using a builtin quine command :P

\$\begingroup\$This doesn't meet our specifications for quines, see here. It doesn't encode itself (i.e. it doesn't actually print itself, it just happens to be outputted because of the compiler.\$\endgroup\$
– RɪᴋᴇʀJan 3 '17 at 14:39

\$\begingroup\$@Easterly the interpreter treats every char as output this char until it meets an <. I'm not saying it's payload-capable or sth I'm just saying that's no difference to a language having a char saying output the source. If this is not a valid answer for part 1 than any language that accepts any input without error is not valid answer, too. I don't think this is more abusive than most answers here.\$\endgroup\$
– ChristophJan 3 '17 at 14:52

4

\$\begingroup\$@Christoph it's valid for part one, but it's not a valid quine by the rules linked in the challenge. This community considers a quine valid if you can identify a section of the source that encodes a different part of the code. In your program, every character only encodes itself.\$\endgroup\$
– Martin EnderJan 3 '17 at 16:43

\$\begingroup\$@MartinEnder: #!/bin/cat was considered a quine earlier.\$\endgroup\$
– JoshuaJan 4 '17 at 20:53

\$\begingroup\$@Joshua indeed, but these days it's not and neither is cat considered a programming language.\$\endgroup\$
– Martin EnderJan 4 '17 at 21:36

Labyrinth, score 74

I'm pretty sure any assortment of these characters produces a valid Labyrinth program, but to make it at least slightly more interesting, this prints out 2016 digit by digit. (In summary: push 2 2's on the stack, pop/print one, move the other to the aux stack, print 0, push 2 1's on the stack, pop/print 1, increment, bitwise not, negate (that last 1 is a 3 at this point), sum with the 2 from the aux stack, 5*10+4 = 54, print as ascii value, terminate)

Most of the long line is simply ignored, as the @ terminates the program.

Challenges 2, 3, and 4 are impossible since neither of Labyrinth's input commands are available (, or ?), and I didn't come up with anything for 5 or 6.

\$\begingroup\$Rule note: If somebody challenges that empty isn't a valid quine and wins, I still have the winning entry (w/o any quine). If on the other hand I don't place it and somebody else does and they win the challenge they beat me. So there it stays.\$\endgroup\$
– JoshuaJan 5 '17 at 2:50

The immediate hurdle preventing the challenges 2-6, is that there doesn't seem to be a way to do I/O:

If we assume there's a file called f, we could use Q`f`.IO.e to check if it exists or Q`f`.IO.x to check if it is executable. But we can't read it or write from it.

We could use Q:x` ` to run a shell command (assuming we find the characters for one). But we can't interpolate anything into, so it would only be good for reading, not writing.

Since there is no closing brace, we can't make a block lambda (e.g. {1 + $_}) that automatically returns the value of its last statement.

We could use the asterisk to make an expression lambda (e.g. 1+*), but then we can only take one argument, refer to this argument only once, and are even more limited in the syntax/operators we can use.

Your Answer

If this is an answer to a challenge…

…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.

…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.

…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.

More generally…

…Please make sure to answer the question and provide sufficient detail.

…Avoid asking for help, clarification or responding to other answers (use comments instead).

Code Golf Stack Exchange is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.