Skip to content

A tiny language with as few features as I could manage. (but with syntax sugar to spare!)

License

Notifications You must be signed in to change notification settings

TheIttyBittyGalaxy/tiny-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐛 tiny

A tiny language with as few features as I could manage. (but with syntax sugar to spare!)

Samples

Hello World

main() {
    console << "Hello"
}

Graph calculator

f(x, y) = 10sin(x/10) - y

inflection(x, y) {
    r = f(x + 0.5, y) > 0
    l = f(x - 0.5, y) > 0
    u = f(x, y + 0.5) > 0
    d = f(x, y - 0.5) > 0
    return r != l | u != d
}

size = 30

main() {
    for (y, -size..size) {
        for (x, -size..size) {
            console << if (inflection(x, y)) "X"
                elseif (x == 0 & y == 0) "+"
                elseif (x == 0) "-"
                elseif (y == 0) "|"
                else " "
        }
        console << "\n"
    }
}

About

A tiny language with as few features as I could manage. (but with syntax sugar to spare!)

Topics

Resources

License

Stars

Watchers

Forks

Languages