Page 1 of 2

Lua missions (AKA Lua Koans) - Learn Lua while programming

Posted: Wed Jun 08, 2011 10:43 pm
by kikito
I wasn't sure about putting this on the projects forum, since it's really only tangentially related with LÖVE, so I'm putting it here.

I've created a Lua Koans project. It's called Lua missions. It's here:

https://github.com/kikito/lua_missions

What are Koans?

Basically, they are tests (functions) that fail - at least initially. You have to fix them. In the process of fixing them, you learn a tiny bit of a language. It starts with the very basic and gradually moves up.

Yesterday I presented these to some people and they were quickly hooked up - they didn't want to leave the keyboard when time run out! :D

Disclaimer: This is not a finished thing, I'm aware that not the whole PiL is covered. (But a significant chunk already is). Feedback of any kind is encouraged and appreciated (as well as pull requests and forks).

Regards!

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Thu Jun 09, 2011 12:43 am
by bmelts
Looks neat! Though I think you missed swapping a few instances of Ruby to Lua in the readme:
README.rdoc wrote:nil is covered in nil.rb
README.rdoc wrote:Each mission builds up your knowledge of Ruby and builds upon itself.
README.rdoc wrote:If you do not have Ruby setup, please visit www.lua.org/download.html for operating specific instructions.

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Thu Jun 09, 2011 6:32 am
by bartbes
Awesome. But yeah, I don't install ruby from lua.org.

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Thu Jun 09, 2011 7:55 am
by kikito
Thanks for the feedback!

I've just fixed this.

READMEs are my weak point. :)

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Thu Jun 09, 2011 8:17 am
by thelinx
You should really post this to the Lua mailing list.

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Thu Jun 09, 2011 11:13 am
by kikito
Yeah, the thought has crossed my mind. Maybe tonight. I spent the last week preparing it and a small activity for a group I'm in, and now I've got a considerable backlog. But yeah. I have to get in touch with those people at some point.

EDIT - Sent.

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Fri Jun 10, 2011 1:48 pm
by vrld
Awesome. I'll be using those.
kikito wrote:What are Koans?

Basically, they are tests (functions) that fail - at least initially.
Mumon Ekai would disagree. But then, he probably won't. Zen is confusing. (But then it isn't)

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Fri Jun 10, 2011 2:34 pm
by TechnoCat
string is using the # table operator before it is taught. strings.lua:54,59

also, test_numbers_must_be_converted_to_strings_before_concatenation at strings.lua:76. I don't know this to be true. Seems you can just concat numbers in Lua.

strings.lua:105 should be string.upper(str)

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Fri Jun 10, 2011 3:28 pm
by kikito
I've fixed those issues in string.lua

Thanks!

Re: Lua missions (AKA Lua Koans) - Learn Lua while programmi

Posted: Mon Jun 13, 2011 8:44 pm
by TechnoCat
I think exercises.lua needs a fizzbuzz http://imranontech.com/2007/01/24/using ... ok-coding/