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.

Noisychicken

From Esolang
Jump to navigation Jump to search

noisychicken or gallusgallus is an esolang derivative of Chicken by Torbjörn Söderstedt.

elements

a nc script is made from this table:

table for noisychicken
Name If Lowercase If Uppercase (with optional exclamation mark)
bok add (add reg[register pointer] to reg[register pointer+1]) sub (same with add but subtracts)
krok instantly set the value of reg[register pointer] to instances NOP
bawk move register pointer so that it points too to reg[instances-1 % 8] move stack pointer to instances-1 % stack size
bok? / bawk? get input into reg[register pointer] (one character only) read output into reg[register pointer] (one character only)
cluck pop to reg[register pointer % 4] push the value in reg[register pointer % 4] to stack
tuc-tuc move the PC to the 16-bit address stored in reg[6-7] (please do not say it) compare, select a flag from the value in reg[4] (leaving 3 registers for the program, with 8 flags in reg[5]), if true, then move the PC to the address in reg[6-7] (please do not say it)
peep start loop end loop block (repeats stack[stack pointer] times)
squawk pick a bitwise operation (not, or, and, xor, shift left, shift right, chosen with instances counter) between stack[stack pointer] and stack[stack pointer+1] (doesnt zero stack[stack pointer+1]), store the result in stack[stack pointer] same as lowercase squawk but between reg[register pointer] and reg[register pointer+1] and stores it in reg[register pointer]
cuck-a-doodle-doo exit print stack values as one single string

model

There are 8 registers (that was obvious), specifically 8-bit registers, all initialized to 0

The stack is essentially a box for 8-bit values, the structure is Last-In-First-Out (LIFO, which is a common stack structure, if structure is the right word, i hope)

The stack pointer is a pointer for the stack, it starts at 0

The register pointer is a pointer for registers, it starts at 0 (pointing to reg[0])

Execution is done sequentially line by line, if the program has a line that is long, make sure it actually changes opcodes

An exclamation mark doesnt change anything, just an aesthetic choooice

Opcodes are separated with a space, Opcodes are one token, because.

Invalid chickens are skipped

instances is the number of times the current opcode has appeared consecutively on the current line

examples

hi

krok krok krok krok krok krok krok krok krok 
bawk bawk krok krok krok bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK CLUCK
bawk bawk krok bawk
SQUAWK SQUAWK CLUCK
CUCK-A-DOODLE-DOO cuck-a-doodle-doo

Nope. interpreter

bok?
krok krok krok krok krok krok krok
bawk bawk krok bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK
bawk bawk bawk krok krok krok krok krok krok bawk bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK bawk
bok CLUCK
bawk bawk krok bawk
bawk bawk bawk krok krok krok krok krok bawk bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK bawk bawk bawk krok bawk bawk
SQUAWK SQUAWK bawk
SQUAWK SQUAWK CLUCK
bawk bawk krok bawk
bok CLUCK
krok krok krok
bawk bawk krok krok krok krok krok bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK
bok CLUCK
krok krok krok krok krok krok krok
bawk bawk krok bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK
bawk bawk bawk krok krok krok krok krok bawk bawk
SQUAWK SQUAWK SQUAWK SQUAWK SQUAWK bawk
bok CLUCK
CUCK-A-DOODLE-DOO cuck-a-doodle-doo