PythBrSc

From Esolang
Jump to navigation Jump to search

PythBrSc (Python with Brackets and Semicolons) is a esolang by Mihai Popa.

After seeing that Python is a little hard to program and not being C-like enough, he made this

Syntax

It's Python, but with brackets instead of indentation and semicolons at the end of the lines, just like in C, JavaScript, Java, etc... It's also for golfing.

Examples

Hello, world!

print("Hello, world!");

FizzBuzz

for num in range(1,101) {
    string = "";
    if num % 3 == 0 {
        string = string + "Fizz";
    }
    if num % 5 == 0 {
        string = string + "Buzz";
    }
    if num % 5 != 0 and num % 3 != 0 {
        string = string + str(num);
    }
    print(string);
}

Golfed

for num in range(1,101){string = "";if num % 3 == 0{string = string + "Fizz";}if num % 5 == 0{string = string + "Buzz";}if num % 5 != 0 and num % 3 != 0{string = string + str(num);}print(string);}