smotslang

From Esolang
Jump to navigation Jump to search
Note that smotslang is typically written in lowercase.

Smotslang is a programming language designed around using commands with names related to smots gaming, a niche cultural phenomenon from the modded community of the indie game Celeste. It uses various smots-related words seperated by whitespace to simulate various I/O commands, loops, and memory cells.

List of valid commands

  • Anything with -- as the first 2 characters: skip until the next command that includes a --. Effectively makes -- a comment.
  • campaign [path] executes the file given by the path as smotslang
  • crumble [number] to store that number in the current memory cell.
  • climb adds 1 to the current memory cell
  • dash [number] Sets the current memory location to the number.
  • debug sets output mode to numbers (for example, outputting 65 would output "65" to console)
  • fall subtracts 1 from the current memory cell
  • jump [number] sets a jump marker with index of the number
  • reload sets output mode to characters (for example, outputting 65 would output "A" to console)
  • retry outputs current memory cell (see debug and reload)
  • run outputs current memory cell with a newline after it
  • smots5 terminates the program
  • spike [number] if the current memory cell is 0, skip all instructions until you hit a jump instruction with number as the argument
  • spinner has a 1/3rds chance of setting current memory cell to 1 and a 2/3rds chance of setting it to 0
  • spring [number] if the current memory cell is nonzero, jump to the last jump marker with the value equal to the provided number.
  • triggerspike [val] [addr] if the current memory cell is not equal to val, skip all instructions until you reach a jump marker with addr as its argument
  • trigspike alias of triggerspike
  • wind [number] copies the value from the current memory cell to the provided location.

examples

Hello, World!

   reload
   crumble 'H retry
   crumble 'e retry
   crumble 'l retry
   crumble 'l retry
   crumble 'o retry
   crumble ', retry
   crumble ^32 retry
   crumble 'W retry
   crumble 'o retry
   crumble 'r retry
   crumble 'l retry
   crumble 'd retry
   crumble '! retry

the following examples were taken from the examples folder in the official interpreter github repo

truth machine

 -- by: nilrem --
 crumble @madeline
 spike 8
     jump 7
         run
     spring 7
 jump 8
 run

coin flip algorithm, prints either heads or tails (gives fair 50/50 odds instead of the 33.(3)/66.(6) odds given by spinner)

   -- made by cosmnik_ --
   dash ^2 crumble ^1
   jump ^101
       dash ^0 spinner dash ^1 spinner
   trigspike $^0 ^102
       dash ^2
       spring ^101
   jump ^102
   dash ^0
   -- printing --
   reload
   trigspike ^0 ^102
       dash ^3 crumble 'H retry crumble 'e retry crumble 'a retry crumble 'd retry crumble 's retry
       dash ^0
   jump ^102
   trigspike ^1 ^102
       dash ^3 crumble 'T retry crumble 'a retry crumble 'i retry crumble 'l retry crumble 's retry
   jump ^102

External Resources