• Kangae_Hishiryo@scribe.disroot.org
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    In Horse64:

    import horses from horses.horse64.org
    
    func main {
        var my_horse = horses.Horse(color="brown")
    }
    

    And in Horse64 Root:

    import horses from horses.horse64.org
    
    func main -> bool {
        var my_horse <- horses.Horse
        my_horse.init("brown")
        if failed(my_horse.init) {
            return no
        }
    
        defer my_horse.destroy()
    
        my_horse.run()
        if failed(my_horse.run) {
            my_horse.stop()
            return no
        }
    
        my_horse.stop()
        if failed(my_horse.stop) {
            return no
        }
    
        my_horse.eat("hay")
        if failed(my_horse.eat) {
            return no
        }
    
        return yes
    }