mruby on Lua.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Makefile
README.md
mruby.c
mruby_on.lua
sample.lua
test.mrb
test1.mrb

README.md

  • Install

      make
    
  • Example

    require "mruby"
     
    mruby.run([[
     
    def tak(x, y, z)
     
        if y >= x
            z
        else
            tak(tak(x - 1, y, z),tak(y - 1, z, x),tak(z - 1, x, y))
        end
    end
     
    print tak(20, 12, 7)
     
    ]])
  • Test

    require "mruby"
     
    file = "./test.mrb"
     
    print(">> mruby file run ./test.mrb")
    mruby.run_file(file)
     
    print(">> mruby code run")
    mruby.run("puts 'mruby code run on Lua!!'")
  • Run

      lua sample.lua
      lua mruby_on.lua
    
      >> mruby file run ./test.mrb
      mruby file run on Lua!!
      >> mruby code run
      mruby code run on Lua!!