Mystery

From Esolang
Jump to navigation Jump to search

Mystery is an Esolang designed by PSTF, inspired from Guess.

How will it work?

First, I write the program. Once I've written at least 5 programs, I'll open the guessing channels. At that point, you can guess the command table as much as you like. When a command is guessed incorrectly by three people in a row, I will show the correct usage of the command.

Why my edit got reverted?

  • Modify on other's command table
  • Delete programs
  • Insert craps
  • Credit

If you do any of these things, your edit will be reverted.

1: Hello, world!

→『Hello, world!』

Input: None

Output:

Hello, world!

2: Collatz sequence

#x①;#y①;$x$←@;ò($x$≠1){→$x$;$x$м2=0?{$x$←$x$÷2;→『÷2=』,$x$;}:{$x$←$x$×3+1;→『×3+1=』,$x$;};$y$++;}→『\nSteps: 』,$y$;

Input:

12

Output:

12 6 3 10 5 16 8 4 2 1
Steps: 10

3: Quine

→$ѽҁᵷ$;

Input: None

Output:

→$ѽҁᵷ$;

4: Factorial function

ƒ(fac, [$x$①]){®($x$≤0)?1:($x$×ř(fac, [$x$ - 1]))};ř(fac, [@])

Input:

10

Output:

3628800

5: Count from 0 to infinity

#x←0;ò(@=$x$){$x$++;→『Correct, what about the next one?』};→『Wrong, you bastard! You lose!!』

Input:

0
1
2
3
4
1145141919810

Output:

Correct, what about the next one?
Correct, what about the next one?
Correct, what about the next one?
Correct, what about the next one?
Correct, what about the next one?
Wrong, you bastard! You lose!!

Guesses

Guess 1(Would credit myself but that would get reverted)

『X』X is a string literal with some string commands

\n Newline
#X① Defines var X as an integer
$X$ A reference to X
← Sets the left to the right
@ Input
; Command separator 
ò(C){P} Does P while C is true
X≠Y A comparison for if X is different from Y
→X Prints X
XмY X modulo Y
X=Y A comparison for if X is the same as Y
C?{A}:{B} Does A if C is true and B if not
X÷Y X divided by Y
X×Y X multiplied by Y
X+Y Y added to X
X,Y Y with X
X++ 1 is added to X
ƒ(A, [B]){C} Defines function A with arguments B and code C
ř(A, [B]) Calls function A and has the arguments B
® Allows recursivity
X≤Y A comparison for if X is atmost Y


Categories and References