JunkLang

Stay Hungry.Stay Foolish.

pip install junklang

Made by @abhay

burger coke pizza

Playground

(note: The input "open your mouth and say" won't work here, that will be fixed in the future)

Output will appear here...

Documentation

JunkLang is a simple, esoteric programming language designed for fun! And I won't mind if you call it junk!

Usage:  junklang {filename}.jnk


Variables

Variables are defined using the keyword order.

Example:

1.order chicken = 5


Arithmetic

Arithmetic operations use the standard +, -, *, / with the keyword eat.

Example:

1.order chicken = 5

2.order fries = 2

3.order total = eat chicken + fries


Input

Input is taken using open your mouth and say.

Example:

1.order coke = 2

2.open your mouth and say burger

3.order total = eat coke + burger

4.whisper total


Output

Use whisper to print output.

Example:

1.whisper "I love junk food"


Functions

Functions are defined using reheat: name ... done. And then called using deliver()

Example:

1.reheat: doubleIt

2.order result = eat burgers * 2

3.done

4.order doubled = deliver(doubleIt)

5.whisper "Doubled burgers: " + doubled


Conditionals

Conditionals are written as if you like ... more than / less than / equal to ... else ... done.

Example:

1.if you like meal more than 5:

2.  whisper "That's a big meal!"

3.else:

4.  whisper "That's a snack."

5.done


Loops

Loops are defined using until thirsty ... done.

Example:

1.order counter = 0

2.until thirsty counter < 3:

3.  whisper "Still hungry " + counter

4.  order counter = eat counter + 1

5.done


Comments

Use hungry to add comments.

Example:

1.hungry This is not read!


Error Handling

Use barf("message") to raise errors.

Example:

1.barf("Oops! We dropped your sandwich.")