Snakel

From Esolang
(Redirected from Snakel (DifferentDance8))
Jump to navigation Jump to search
Official logo since 2005

Snakel is an alternative universe language created in 1989 by Tolly Edd in the gammaline universe

Tour

This section is still a work in progress. It may be changed in the future.

How to get Snakel

See Snakel/Compatibility methods

Syntax

Every program starts with a definition, to actually define a function, you can do this:

­ 1: def name[arguments]; !Used for augmented functions
­ 2: ­ ­ ­ ­ ignore !"ignore" will go to the end of the function
­ 3: def name:none; !Used for argumentless functions
­ 4: ­ ­ ­ ­ ignore

I/O in Snakel also exist:

­ 1: def main:none;
­ 2: ­ ­ ­ ­ tell["anything here"] !Prints "anything here" in one line
­ 3: ­ ­ ­ ­ user !Gets user input. No argument required

By the way. The strings are actually multi-liners so:

­ 1: def main:none;
­ 2: ­ ­ ­ ­ tell["multi
­ 3: line"] !Will print "multi\nline"

Now let's talk about the "ignore" and "end".

­ 1: !we already know that "ignore" goes to the end of the function, But did you know that you can also ignore errors with "ignore" and with "test"?
­ 2: test:1/0 !Will rasie a zero devision error
­ 3: ignore ZeroDevision:tell["inf"] !will print "inf" (or infinity) instead of raising zero devision error
­ 4: end !"end" just ends the program

Common mistakes

See Snakel/Errors

Examples

Hello, world!

­ 1: def main:none;tell["Hello, world!\n"]

Cat program

­ 1: def main:none;tell[user]

Truth-machine

­ 1: def truth:none;
­ 2: ­ ­ ­ ­ num i=user
­ 3: ­ ­ ­ ­ if i="1";ignore
­ 4: ­ ­ ­ ­ tell[0];end
­ 5: def main:none;
­ 6: ­ ­ ­ ­ truth[]
­ 7: ­ ­ ­ ­ while 1:tell[1]


See also

Bake - The language made before the first version of this language was uploaded