DragonLang/Example

From Esolang
Jump to navigation Jump to search

Back to DragonLang

Hello, World!

I should take into account many people who don't know how to code.

print("Hello, World!")

Collatz Sequence

let x <- int(input());
while x != 1:
    if x.odd() = true:
        print(f"3×{x}+1={x*3+1}");
        x <- x*3+1;
    else:
        print(f"{x}/2={x/2}");
        x <- x/2;