Skip to content

Goofy-ass language for goofy-ass things like games and etc.

License

Notifications You must be signed in to change notification settings

yakupcemilk/Cruft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cruft

Goofy-ass language for goofy-ass things like games and etc.

Example

package mathematics

var y: i32, 
    z: i32 

const a, b, x: i32

pub fn add(y: i32, z: i32): i32
    ret (y + z)
end

pub fn arithmetic(a: i32, b: i32, x: i32): i32
    x: i32 = add(a, b)
    ret x: i32
end 

if (x: i32 > 0)
    print(x)
else (x: i32 < 0)
    print('x is smol')
end

An example for game

package npc_walk 

import std 
import linear

pub fn walk(directions: array, npcID: i32): void
    const directions: array = [x, y]
    npcID: i32 = Math.random(100)
      
    pri fn direct(directions: array, speed: f16): void
        const speed: f16 = 0.5
        TO_FORWARD = while(W_PUSHED == true) { x + speed }
        TO_BACK= while(S_PUSHED == true) { x + speed * -1 }
        TO_LEFT = while(A_PUSHED == true) { y + speed }
        TO_RIGHT = while(D_PUSHED == true) { y + speed * -1 }
    end

    direct(directions, 0.5)
end

Backend provided by QBE, frontend provided by flex/bison

About

Goofy-ass language for goofy-ass things like games and etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published