FOO
- Not to be confused with Foo.
FOO is an esolang made on scratch once again, it is made by Hajunsheng. visit it
Instructions
"A", ah yes the a, simple, it sets the only variable e.g. "A2" "A3" "AG" and adds it to the list.
"B", another command, takes user input of any amount of characters and gets the next one its supposed to and ofc print it.
"C", the simple if statement for checking if next character is the last printed thing e.g. "CD" "Cl", if yes it will add that character to the list.
"D", just checks if next character is... ok basically ontop and when true just skips next four characters.
"E", well loops everything.
"F", well it deletes the last one.
"G", it takes the first of the list and puts it to the end.
Command | Effect |
---|---|
Ac |
push c to the stack, unless c is \ , in which case push the last A-pushed value (starts as ! )
|
B |
push a character from the input buffer |
Cc |
if c is equal to TOS, push c |
Dc |
if c is equal to TOS, skip 4 characters |
E |
jump to start |
F |
pop from stack |
G |
rotate, move the bottom of the stack to the top |
And
ok, basically B will take all input, store it all continuously, and later if you do it and the user entered more than one last time, it will not get user input just uses the next character in the sequence of the stored. "A" will just reprint the current variable if it's given \.
Computational class
User:Dadsdy has provided a translation scheme from cyclic tag to FOO.
Note that there are no single character no-ops. However, Dc
can be used as a two character no-op assuming the c is a character which is never pushed to the stack. Dadsdy's scheme uses underscore.
Dadsdy uses brackets to denote alternate paths. Simply remove the brackets to make the code valid.
Every bit b of each word in the original program is replaced with [AbDb][D_Dv][AvDv][D_Dv]
. Each word is then prepended with GD0[A1D1][A0D0][FFDv][FFDv]
and appended with D_D_GF
, with the converted bits in the middle. All of the words are concatenated together and a final E
is added at the very end.
The stack is initialized with the starting word, with a v on the very top. Each word prepares the stack for conditional execution by pulling up the bottom element (start of the word) then either executing an "even" or "odd" path, which will eventually join together.
Example translation (top-most stack element on the right, front of the queue on the left):
From 1;101 (inital state 1)
GD0[A1D1][A0D0][FFDv][FFDv][A1D1][D_Dv][AvDv][D_Dv]D_D_GF GD0[A1D1][A0D0][FFDv][FFDv][A1D1][D_Dv][AvDv][D_Dv][A0D0][D_Dv][AvDv][D_Dv][A1D1][D_Dv][AvDv][D_Dv]D_D_GFE
With initial stack 1v.
Or, in canonical notation:
GD0A1D1A0D0FFDvFFDvA1D1D_DvAvDvD_DvD_D_GFGD0A1D1A0D0FFDvFFDvA1D1D_DvAvDvD_DvA0D0D_DvAvDvD_DvA1D1D_DvAvDvD_DvD_D_GFE