Back Alley

From Esolang
Jump to navigation Jump to search

Back Alley

Have you ever wanted to worry about your program getting jumped by a criminal? Ever wanted to juggle programming with constantly not getting arrested?

Great! Welcome to Back Alley a programming language with the goal of acting as if everything went on in a dark alley.

Github: [1]

Hello, World

Since Back Alley is transpiles into C++ you have to make a main function that can be done as so.

hire yourself int
	say "Hello, World"
pay 0

hire creates a function and yourself becomes main, you can't type main because I said so and so does the compiler.

Fizz Buzz

hire yourself int
    crime 2
    say "Welcome to a Fizz Buzz program in back alley!\n"

    trip i 30
         ask criminal i != 0
            ask criminal i%3 == 0
                say "Fizz "
            stop asking

            ask criminal i%5 == 0
                say "Buzz"
            stop asking

            ask criminal i%3 != 0 and i%5 != 0
                say I
            stop asking

            say ", "
        stop asking
    stop tripping
pay 0

In Back Alley you have a heat level if it get's to high your program will get caught. If your heat get's to low your program will leave the Back Alleys and become a good citizen.

Syntax

Back Alley doesn't care about indentation or new lines so the "Hello, World" program can also look like this

hire
yourself
int
say 
"Hello, World"
pay
0
Command Description
say Will print the next value given
buy Will make a variable with the given type name and value buy int var1 0
mug Gets input and puts it into the variable give mug var1
hide Will reduce heat by value given hide 2
crime Will increase heat by value given crime 2
ask Starts an if state ment can be followed by a person for if by another person for elif and no-one for else ask person "e" == "e" say "true"
skip Acts as continue
end Acts as break
stop After tripping or asking you must stop the activities stop asking
trip A for loop starts at 0 goes to the number given current number stored in the variable given trip i 10 say i stop tripping
whisper Everything at compile time will be in lowercase, so strings and variable names unlike say it will not increase heat whisper "HELLO, WORLD"
use Allows you to change variables use var1 69
hire Creates a function hire zing int
pay ends a function and determines what it will return pay 69
call calls the function all arguments after the name of the function will be considered arguments for the function call zing
hang-up Must be put after a call statement so the program knows what is a function argument or not

Note: task can be put after a function call to allow for arguments

Opposite number Function

hire opp_n int task int num
	say num*-1
pay 0

hire yourself int
	call opp_n 69 hang-up
pay 0

Currently functions can't be pased as arguments, and as this is being typed I'm working on allowing the user to actually get input back from function's.

External resources