AnyGolf

From Esolang
Jump to navigation Jump to search

AnyGolf is an esolang invented by User:None1, you can add anything to it as long as:

  • Your edits make the esolang remain computable and implementable in a practical language
  • Your edits make the esolang more suitable for code golf, or add new features to the esolang (e.g.: a stack)
  • Your edits don't delete anyone else's work (but fixing is allowed)
  • Your edits don't make the esolang a joke esolang, for example, commands like "Bluescreen the user's computer" or "If the current cell is 123 then print qieuhwqehwqiuhiuedwiweudhw" are not allowed
  • Your edits make the esolang remain platform independent, for example, commands like "Compile an ELVM IR code using the ELVM toolchain (which only works in UNIX)" or "use MessageBoxA to create a message box" are not allowed. However, commands like "Load a dll" or "create a message box" are allowed because almost every operating system can do that.
  • New commands in your edits have your username in the Author column.

If an edit doesn't follow the rules, it will be reverted. Reverting edits that don't follow the rules are welcomed.

Specifications

This esolang uses a 1-D tape with 8-bit unsigned wrapping integers and a pointer. It also uses 32-bit(default) signed integer variables. It also has a stack.

Integers are in base-42 with alphabet 0123456789+-!@ÈÉÊËÌÍÎÏÐÑɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫ (Example: 123 means 1*422+2*421+3 = 1851)

Commands

Commands
Command Meaning Author
i Increment current cell User:None1
d Decrement current cell User:None1
r Input an ASCII character and store into current cell User:None1
w Print current cell as ASCII User:None1
l Input an integer and store into current cell User:None1
p Output current cell as integer User:None1
z Move pointer to the left User:None1
x Move pointer to the right User:None1
av1,v2; Add variable v1 by v2 User:None1
tv1,v2; Subtract variable v1 by v2 User:None1
mv1,v2; Multiply variable v1 by v2 User:None1
Lv1; Input an integer and store into v1 User:None1
Pv1; Output v1 as integer User:None1
Sv1; Store v1 to current cell User:None1
Rv1; Set v1 to current cell User:None1
h Hello, World! User:None1
c Cat program User:None1
d Disan Count User:None1
T Truth Machine User:None1
[CODE] While current cell is nonzero, run CODE User:None1
(CODE) While current cell is zero, run CODE User:None1
{CODE} Run CODE forever User:None1
s Square current cell User:Cleverxia
b intepret brainfuck, end at a null byte User:Cleverxia
qv1,v2; divide v1 by v2, store quotient at v1, remainder at v2 User:Cleverxia
jv1,v2; if v1 equals 0 jump to line v2 User:Cleverxia
ya; FizzBuzz till a User:Cleverxia
Y FizzBuzz till 100 User:Cleverxia
* 99 bottles of beer User:Cleverxia
#v1 add current cell by v1 User:Cleverxia
u..." print everything up to the ending quote User:Cleverxia
P..." push everything up to the ending quote onto the stack User:Cleverxia
I push current cell onto the stack User:Cleverxia
: duplicate top of stack User:Cleverxia
~ discard top of stack User:Cleverxia
$ swap top 2 of stack User:Cleverxia
% rot top 3 of stack clockwise User:Cleverxia
^ print top of stack as a number, discards it User:Cleverxia
\ print top of stack as ASCII, discards it User:Cleverxia
' print top of stack as 0-ended string, discards them User:Cleverxia
~ go to character (top of stack) in the program. User:Cleverxia
Q Output the program's source code User:None1
z Infinite loop User:None1
F Infinite Fibonacci sequence User:None1
Bx; x is an integer literal, translate it as binary, interpret it as Binaryfuck User:None1
`"lang"; runs the code from user input in the provided language (must be implemented and computable) User:Cleverxia
Γ shuffles the stack randomly User:OrangeDied
Š Self intepreter User:Cleverxia
?"x""y" append x to the contents of the file named y User:Qawtykit
!"x""y" replace the contents of the file named y with x User:Qawtykit
;"x""y" Preform a Regex(x) substitution(y) on the top of the stack User:Qawtykit
e End program User:Qawtykit
(a tab) get a line of input and push onto the stack, string ends with ascii 0 User:Cleverxia
Σ,Τ Refers to the tape pointer and stack top, respectively User:Cleverxia
¦n¦CODE¦ define a function named n User:Qawtykit
&n& call the function named n User:Qawtykit
.y" push the contents of the file named y to the stack as a literal string User:Qawtykit
_ concatenate the top two values of the stack User:Qawtykit
=n" push the character at index n(number) of the value at the top of the stack User:Qawtykit
v change the amount of bits in variable v to the value of the cell at the pointer. User:Qawtykit
⟨CODE⟩n# repeat the code inside the brackets n(number) times User:Qawtykit

Examples

Hello, World!

h

or:

uHello, World!"

or even:

bÊɠɟ9ɜɤÏ@Êɧ73ɣÎɛɛËɟɜ2ɚɚɥ4Í9!ɩ8Ê57ɘɤ!ɧ3ÐɢÈɚÊË!ɥ3ɡÌ+4ɜɘɣÈ28Ð!ÈɠÎɜ;

Cat program

c

Disan Count

d

Truth Machine

T

Or:

B1ɡ-ɥÌɞəÏÊ+ɣ;

A+B problem

La;Lb;aa,b;Pa

FizzBuzz

Y

or:

y2Ê;

Infinite loop

{}

Or:

z

Cheating Quine

Q

99 bottles of beer

*

Infinite Fibonacci sequence

F

Self intepreter

Š

Regex substitution example

IP1232132133131332332";"1+[23]+\d""a";

Prints "x32x3x".