1

I'm looking to dip my toes into coding with Lua - I'm trying to find something to teach my 11-year-old son some programming skills (he's already mastered Scratch :) ). I'm completely new to Lua myself, but I have some background in other languages.

I've downloaded and installed ZeroBrane (v0.80 running on OS X 10.9.5); however, when I try to compile/run any of the sample files the test program turtle.lua, I get a crash:

enter image description here

The same happens if I choose Lua 5.2 as the interpreter. Any ideas as to the possible cause and fix?

EDIT: I was a bit hasty when testing this before; simple Lua code appears to run fine, as do the sample programs in the turtle-samples folder.

The sample code spirograph.lua runs without crashing, but doesn't appear to actually do anything. Turtle.lua still crashes: by stepping through the code, it appears to crash when exiting the loop between lines 543 and 555:

enter image description here

If I press F10 at this breakpoint, I get the Lua crash.

5
  • Does it happen on all scripts, even a simple one-liner with print 'Hello World'? Does it happen when you try to Run or Debug? Commented Sep 27, 2014 at 17:06
  • I tested v0.80 on OX 10.9.5, but don't see any issues and there hasn't been other similar reports. You may want to open a ticket on github. Commented Sep 27, 2014 at 17:18
  • @PaulKulchenko: apologies, I should have tested more thoroughly. See my edits above, it's only some sample code that crashes (or, in the case of spirograph.lua, doesn't appear to do anything). Commented Sep 28, 2014 at 8:39
  • Added an answer; also the title is a bit misleading as it's the lua application that crashes and not the IDE itself. Commented Sep 28, 2014 at 15:47
  • Agreed, I've updated the title. Commented Sep 28, 2014 at 16:55

1 Answer 1

1

Both turtle.lua and spirograph.lua files are modules, so you don't need to "run" them as they don't do anything by themselves. You can run all the included examples, and those that use those modules run without issues.

Thank you for debugging it; I'll check what may be causing a crash on turtle.lua, but you can continue using it as a module without issues.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks - I'm afraid I'm completely new to Lua so didn't appreciate the distinction between modules and the examples.
That's not your fault as it shouldn't crash even when loaded as an example; I'll see if this can be fixed. Thank you for the report.
@KenD, I added a message when you try to load these modules as examples; this eliminates the crash as well. The changes will be included in the next version and are available from github.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.