-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to provide consistent boilerplate on Lua track - or at the least better instructions how to submit solutions. #345
Comments
Can you help me understand what you mean when you say that the setup for testing looks different? I'm not a beginner so this may be a blind spot for me, but all of the exercises you mentioned have test suites that look very similar to me. |
Look at the solution side of things.
Hamming:
House
Leap
Difference of Squares:
And now Matrix:
So while some problems bear some resemblance you setup class and functions on class or you create one or more functions - it s not obvious at all how to handle Matrix - I suppose I need a |
It sounds like your biggest obstacle is that Matrix is the first "object-oriented" exercise and you're assuming that you need to create much more structure than is actually necessary. For example, a solution can look like this: return function(s)
-- some local variables
local function row(...)
end
local function column(...)
end
return {
row = row,
column = column
}
end If we were to provide something looking a bit like that in the skeleton, would that address the issue you're running into? |
Correct - Lua seems to have "there is more than one way to do it" aspect. I solved the problem on my own but not before seeing closure type of code in one of the tutorials online:
No big deal - but it would make it a bit easier for a beginner to clear the hurdle if you add couple code skeletons as examples. Or perhaps just a hint. Thanks for the reply and the pattern. Just to elaborate - what confused me was these two lines in test file:
So when I saw |
I guess this is something which can wonderfully explained in a concept. I wanted to start writing these for some time, but unfortunately I haven't had the time yet... |
Thanks! Once I am more advanced in Lua and I will start contributing too. |
On most other tracks once you get through setting up the language and running "Hello World" - and maybe one or two more problems - you pretty much know how to test. But on Lua track the boilerplate evolves without any explanation. I solved "Hello World", "Hamming", "House" "Difference of Squares" and "Leap" and for each one the setup for testing looks slightly different. Perhaps it is obvious once you progress in Lua a bit but it is really confusing for beginner.
The text was updated successfully, but these errors were encountered: