Strang

From Esolang
Jump to navigation Jump to search

Strang is an esoteric programming language by User:FluixMakesEsolangs, the official interpreter is made in Python. The name is a mixture of strange and string but it sounds weird.

Functions

The language has 8 functions:

  • '?' - Replaces string such as
    ?::Foo|F|B
    would turn "Foo" into "Boo"!
  • '!' - Prints argument such as
    !::$1
    would print what is the output of line 1.
  • '+' - Concats 2 strings like
    +::$$| Concat
    would concat the thing on the previous line if it has an output
  • '-' - removes instance from string so
    -::FooBar|Bar
    becomes "Foo"!
  • '--' counts the number of a sub-string in a string
    --::***|*
    becomes 3, this function is to turn unary numbers into base-10.
  • '*' - replaces an existing instance of all strings that include a keyword like
    *::Foo|Keyword
  • '~' - loops until A is NOT in B
  • '@' - ends a loop

Syntax

# Comment (Comments are still counted as lines so if you have a line dedicated to a comment you must account for it)
foo:: # this is a function
f::this|is|how|you|get|multiple|arguments
!::%% # this is input
!::$$ # this grabs from the last line and errors out if the last line didint produce a string
!::$line number # this  is like $$ but $??? grabs from a specified line
!::Hello\nNewlines! # Newlines are supported

Examples

Hello, world! - Just a basic hello world program.

!::Hello, world!

Cat Program - Prints users input!

!::%%

Addition/Concat - Basic addition for unary, concats 2 strings.

 
+::*|**

Known Interpreters

Official Interpreter!