Skip to content

Comment on My newest invention: The Glas Language (A Pythonic offshot)

Comments

bhdzOP
    a space adventure = space ship, blasters, rockets, lasers, *, **:  -> Space Ship:
        space ship ~ attach weapons: blasters, rockets, lasers:
            {{ "Eeeekkrrrrgh! Weapons attached successfully!" }}
            {{ "listing:" }}
            for weapon in *: #all arguments of attach weapons
                 {{ "Weapon:", weapon }}
        else:
            {{ "WARNING! WARNING! Ship weaponry attachment FAILED }}
            {{ "You're defenseless!" }}

        detach weapons: -> space ship:
            {{ "Weaponry detached, seek cover!" }}
        else:
            {{ "Weaponry detachment FAILED!" }}
            {{ \t, "AUTODESTRUCT SEQ. INITIATED" }}
            {{ \t, "EJECT EJECT EJECT!" }}
            auto destruct: 20s -> space ship
bhdzOP

Ah yes!

    {{ \t, "eject eject eject!" }}
    auto destruct: 20s -> space ship
    {> user ejected % wait: 20s, any -> input <}

    {{ "Your ship explodes in a gigantic fireball!" }}

    if: empty: -> input ->> user ejected
        {{ "You fail to eject, Ouch!" }}
        space ship ~ pilot ~ die: "massive splosion"
    space ship ~ destruct: "massive splosion"
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.