Skip to main content
Tweeted twitter.com/StackCodeGolf/status/1255149795531821059
edited tags
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

Write a program that outputs the number 0.

That's a bit trivial, isn't it?

Let's sort all distinct permutations of your code in lexicographical order. When any of these codes are run, it should output the its location in the array (0-indexed or 1-indexed).

This means that your code must be the lexicographically smallest permutation of your code possible.

For example, if your code is ABB, then ABB -> 0; BAB -> 1; BBA -> 2.

Rules

  • Out of all distinct permutations of your code, it must be the lexicographically smallest.
  • Your program must be at least 3 bytes long.
  • "Output" represents any acceptable output: on the stack, to STDOUT, as a return value, as an exit code, etc.
  • Your program is to not take any form of input.
  • This is reverse , so longest code wins.

Write a program that outputs the number 0.

That's a bit trivial, isn't it?

Let's sort all distinct permutations of your code in lexicographical order. When any of these codes are run, it should output the its location in the array (0-indexed or 1-indexed).

This means that your code must be the lexicographically smallest permutation of your code possible.

For example, if your code is ABB, then ABB -> 0; BAB -> 1; BBA -> 2.

Rules

  • Out of all distinct permutations of your code, it must be the lexicographically smallest.
  • Your program must be at least 3 bytes long.
  • "Output" represents any acceptable output: on the stack, to STDOUT, as a return value, as an exit code, etc.
  • Your program is to not take any form of input.
  • This is reverse , so longest code wins.

Write a program that outputs the number 0.

That's a bit trivial, isn't it?

Let's sort all distinct permutations of your code in lexicographical order. When any of these codes are run, it should output the its location in the array (0-indexed or 1-indexed).

This means that your code must be the lexicographically smallest permutation of your code possible.

For example, if your code is ABB, then ABB -> 0; BAB -> 1; BBA -> 2.

Rules

  • Out of all distinct permutations of your code, it must be the lexicographically smallest.
  • Your program must be at least 3 bytes long.
  • "Output" represents any acceptable output: on the stack, to STDOUT, as a return value, as an exit code, etc.
  • Your program is to not take any form of input.
  • This is , so longest code wins.
Source Link
user62257
user62257

Determine the lexicographical permutation your code is in

Write a program that outputs the number 0.

That's a bit trivial, isn't it?

Let's sort all distinct permutations of your code in lexicographical order. When any of these codes are run, it should output the its location in the array (0-indexed or 1-indexed).

This means that your code must be the lexicographically smallest permutation of your code possible.

For example, if your code is ABB, then ABB -> 0; BAB -> 1; BBA -> 2.

Rules

  • Out of all distinct permutations of your code, it must be the lexicographically smallest.
  • Your program must be at least 3 bytes long.
  • "Output" represents any acceptable output: on the stack, to STDOUT, as a return value, as an exit code, etc.
  • Your program is to not take any form of input.
  • This is reverse , so longest code wins.