Skip to main content
1 of 8
feersum
  • 31.5k
  • 9
  • 65
  • 125

Create a programming language that only appears to be unusable

Cops' challenge: Design a programming language that appears to be unusable for programming, but admits computation (or at least completion of the task) through some non-obvious mechanism.

You should design a simple programming language that reads code from an input file and then does ... something. You must prepare a solution program that finds the 3rd-largest number in the input when run in your interpreter. You need to make it as hard as possible for robbers to find a solution program. Note that robbers can post any solution that accomplishes the task, not just the one you had in mind.

This is a popularity contest. The cops' goal is to get as many votes as possible while surviving 8 days without being cracked. To this end, the following practices should help:

  • Accurately explaining your language's semantics
  • Writing readable code

The following tactics are strongly discouraged:

  • Using encryption, hashes, or other cryptographic methods. If you see a language that employs RSA encryption, or refuses to execute a program unless its SHA-3 hash is equal to 0x1936206392306, please do not hesitate to downvote.

Robbers' challenge: Write a program that finds the third-largest integer in the input when run in the cops' interpreter.

This one is relatively straightforward. In order to crack a cop answer, you must create a program that completes the task when run in its interpreter. When you crack an answer, post a comment saying "Cracked" on the cop's answer linking to your post. Whoever cracks the most cops wins the robbers' thread.

I/O Rules

  • Interpreters should take a filename on the command line for the program, and use standard input and output when running it.
  • Input will be given in unary and consist only of the characters 0 and 1 (48 and 49 in ASCII). A number N is encoded as N 1s followed by a 0. There is an additional 0 before end of file. Example: For the sequence (3, 3, 1, 14), the input is 11101110101111111111111100.
  • Input is guaranteed to have at least 3 numbers. All numbers are positive integers.
  • Output will be judged by then number of 1s printed before the program halts. Other characters are ignored.

In the following examples, the first line is the input in decimal format; the second is the actual program input; the third is a sample output.

1, 1, 3
10111011100
1

15, 18, 7, 2, 15, 12, 3, 1, 7, 17, 2, 13, 6, 8, 17, 7, 15, 11, 17, 2
111111111111111011111111111111111101111111011011111111111111101111111111110111010111111101111111111111111101101111111111111011111101111111101111111111111111101111111011111111111111101111111111101111111111111111101100
111111,ir23j11111111111u

247, 367, 863, 773, 808, 614, 2
<omitted>
<contains 773 1's>

###Boring rules for cop answers:

  • To prevent security through obscurity, the interpreter should be written in a language in the top 100 of this TIOBE index and have a freely available compiler/interpreter.
  • The interpreter must not interpret a language which was published before this challenge.
  • Interpreter should fit into your post and not be hosted externally.
  • Interpreter should be deterministic
  • Interpreter should be portable and follow the standard of its own language; don't use undefined behavior or bugs
  • If the solution program is too long to fit into the answer, you must post a program that generates it.
  • Solution program should consist only of printable ASCII and newlines.
  • You must execute your solution program in less than 1 hour on your own computer for each of the example inputs above.
  • The program should work for any integers less than 106, and any number of integers less than 106.
  • To become safe, a cop must edit the solution program into the answer after 8 days have passed.

###Scoring The cop who becomes safe with the highest score, and a positive score, wins this question.

feersum
  • 31.5k
  • 9
  • 65
  • 125