We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

котята-арбузята

From Esolang
Jump to navigation Jump to search

котята-арбузята is an esoteric programming language created by User:Dragoneater67.

Overview

The esolang is made out of 2 smaller esoteric programming languages that run in parallel using round-robin scheduling, operate on a shared deque of 8-bit unsigned integers and communicate with each other through signals. Both systems execute commands sequentially from start until there are no more commands left, after that they listen for signals from the other system, the program fully halts after both systems halt. Popping from an empty deque or sending an unhandled signal results in a NOP. Commands and arguments are separated by newlines and whitespaces. A program consists of a котята program and an арбузята program, both programs must have the same filename, but must have different file extensions due to being written in different languages.

котята

котята is an input-only write-only esoteric programming language. It uses the .ктя file extension.

Commands
Command Description
( <val> Push <val> to deque front, replace | with to push character input.
! <val> Push <val> to deque back, replace with \ to push character input.
' <val> Send signal code <val> to арбузята, replace with & to send character input.
} <val> [ <code> ] (Re)Define a signal handler for code <val>, the <code> is executed when receiving a signal from арбузята with code <val>.
. Halt the program.

(NOTE: <val> is an 8-bit unsigned integer)

арбузята

арбузята is an output-only read-only esoteric programming language. It uses the .абя file extension.

Commands
Command Description
: <val> Output <val>, replace with # to pop front from deque and output the value, replace with * to pop back from deque and output the value.
^ <val> Send signal code <val> to котята, replace with % to pop front from deque and send the value, replace with ? to pop back from deque and send the value.
< <val> [ <code> ] (Re)Define a signal handler for code <val>, the <code> is executed when receiving a signal from котята with code <val>.
, Halt the program.

(NOTE: <val> is an 8-bit unsigned integer)

One file mode

A program can also be written in a single .ка file with this format:

<котята program>
+
<арбузята program>

Examples

XKCD Random Number

Contents of 4.ктя:

' 0
.

Contents of 4.абя:

< 0 [
  : 52
  : 10
  ,
]

Hello, world!

Contents of hello.ктя:

( 72
( 101
( 108
( 108
( 111
( 44
( 32
( 119
( 111
( 114
( 108
( 100
( 33
( 10
' 0
.

Contents of hello.абя:

< 0 [
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  : *
  ,
]

Cat program

Contents of cat.ктя:

} 0 [
  ( |
  ' 0 
]

Contents of cat.абя:

< 0 [
  : *
  ^ 0
]
^ 0

(NOTE: Does not halt on EOF)

Truth machine

Contents of tm.ктя:

} 0 [
  ' 49
]
' &
.

Contents of tm.абя:

} 48 [
  : 48
  ,
]

} 49 [
  : 49
  ^ 0
]

Infinite loop

Contents of loop.ктя:

} 0 [
  ' 0
]
' 0

Contents of loop.абя:

} 0 [
  ^ 0
]

Computational class

Neither котята nor арбузята are Turing-complete, but котята-арбузята itself is Turing-complete. See котята-арбузята/Turing-completeness proof.

See Also