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.

Tommy

From Esolang
Jump to navigation Jump to search

Tommy is a stack-based esoteric programming language (esolang) invented in 2026 by User:Huge

Command Befunge equivalent Description
0-9 0-9 Push corresponding number onto the stack
+ or a + Addition: Pop two values a and b, then push the result of a+b
- or s - Subtraction: Pop two values a and b, then push the result of b-a
* or m * Multiplication: Pop two values a and b, then push the result of a*b
/ or d / Integer division: Pop two values a and b, then push the result of b/a, rounded down. According to the specifications, if a is zero, ask the user what result they want.
. or o Output the stack (example: [7, 4, 3])
' or p $ Pop top of stack and discard
?n or fn If: Pop the top value from the stack. If it equals n, execute the next command; otherwise, print 0 and halt.
<n or rn Repeat last command n times
, or i Request input, if input is 0-9 push it to stack
# or j # Bridge: jump over next command in the current direction of the current PC
& or h @ End program

Direction is always >

Other commands do nothing

Examples

almost Truth Machine


0
i                                                                      #ASK FOR INPUT
f1 #IF TOP OF THE STACK #(INPUT) EQUAL #1 #DO NEXT COMMAND #(OUTPUT #1)
#ELSE OUTPUT #0 AND #HALT

. #OUTPUT #1
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9
<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<9<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