Anarcheat

From Esolang
Jump to navigation Jump to search

Anarcheat is an esolang invented by User:A inspired by the limitations of Anarchy golf: there are only 3 possible sample inputs at maximum, and the test cases can only be a finite sequence of a string.

Syntax

An odd line decides what the expected input is, and an even line decides what the corresponding output should be. Programs should be 6 lines at maximum.

Hello, world! (13 bytes)


Hello, world!

This decides whether the input is null, and outputs Hello, world! based on the input. There is also an instruction : meaning that this line should respond to any other input.

echo (13 bytes)

:$

Here $ means the input of the program.

[golf.shinh.org/p.rb?hello+golfers Hello, golfers!] (? bytes)

Anarcheat matches suffixes by default, although a line can be modified to match prefixes.

g
Hello, golfers!

Hello, world!
:Hello, shinichiro.h!

Golfed.

.Hello, 
g
golfers!

world!
:shinichiro.h!

The . instruction outputs until the end of line without a newline.

Dictionary

Anarcheat has a well-thought-out 95-word dictionary designed specifically for Anarchy Golf challenges.

Digit sum until no change

http://golf.shinh.org/p.rb?digit+sum+until+no+change

^0
7@10 1@1@60 6@99 18 9@102 3@103 4@122 5@128 11 2@100 1
^6
124 7@121 4@96 15 6@91 10 1@102 3@113 5@101 2@114 6@131 5@119 11 2
^5
106 7@95 14 5@110 2@97 16 7@114 6@104 5@99 18 9@116 8@135 9@118 10 1

^ is the prefix-completion marker, @ means insert a newline. \ will escape the next marker.

Other than ^ there is also a position-based checker called %. When preceded by a number, it starts its completion in the position specifiedd by the number based on the current completion state.

Further golfed:

^0
7@X 1@1@60 6@99 18 9@X2 3@X3 4@Z2 5@Z8 Y 2@X0 1
^6
Z4 7@Z1 4@96 15 6@91 X 1@X2 3@Y3 5@X1 2@Y4 6@131 5@Y9 Y 2
:X6 7@95 14 5@Y0 2@97 16 7@Y4 6@X4 5@99 18 9@Y6 8@135 9@Y8 X 1

X pushes 10, Y pushes 11, Z pushes 12.