Matcha

From Esolang
Jump to navigation Jump to search

Matcha is an esoteric programming language created by qvixnh22, yyyy7089, and hibye1217 in 2025. It is based on geometrical approach of uniqueness.

Code

Every code should be consist of two integers per line. In case other than two integers on a single line, this line is considered as comments. Alphabet letters are also considered as comments.

this is comment line
123 456 789 this line is considered as comment
123456789 this line is considered as comment
1234 5678 this line represent single point

Code analysis

Every valid code lines will be transfered to points on 2-dimensional Euclideian space. If single line code is on its convex hull, then this line will be converted to 1, if not, converted to 0. Two consequetive code line represents 3 kind of command alphabets, A, B, and C. Two consequtive line are transfered to A if both are 0, B if two lines are different, and C if both are 1. For example, 101 will be transfered to BB, 1100 will be transfered to CBA. This works for only consequtive code lines, that is, seperated lines with comment only line is not considerated to consequtive.

0 1000 one
500 500 zero
0 0 one
1000 1000 one
comments
400 400 zero
600 600 zero
1000 0 one
this code is considered as BBCAB

Runtime environment

The environement consist of single semi-infinite linear memory with 64bit integer cells and header which is on pointer 0 initially. Every pair of command alphabets are executes followings:

AA move header left 12 times.
AB move header right 17 times.
AC If value of memory cell header pointing is 0, jump to closest next BC command. Otherwise, jump to BC command in that numerical order value of memory cell header pointing to.
BA increase memory cell value 70 header pointing.
BB decrease memory cell value 89 header pointing.
BC Ignored.
CA Get input as ASCII code and write value memory cell header pointing.
CB Print a value of memory cell header pointing as ASCII code.
CC If value of memory cell header pointing is 0, back to next to last excuted AC command.

Compiler analysis

Compiler have to compute convex hull of code. If three or more points are on a single line of convex hull, compiler must cause a compile error. Compiler should be executed in O(NlgN) time.

If code have odd command alphabets, code is invalid. If single isolated value converted to 0 or 1 is ignored.