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

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post 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!
When I write def I mean function.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Awesome. But yeah, I don't install ruby from lua.org.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post by kikito »

Thanks for the feedback!

I've just fixed this.

READMEs are my weak point. :)
When I write def I mean function.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

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

Post by thelinx »

You should really post this to the Lua mailing list.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post 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.
When I write def I mean function.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

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

Post 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)
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

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

Post 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)
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post by kikito »

I've fixed those issues in string.lua

Thanks!
When I write def I mean function.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

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

Post by TechnoCat »

I think exercises.lua needs a fizzbuzz http://imranontech.com/2007/01/24/using ... ok-coding/
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests