#1
Posted 26 November 2013 - 07:51 PM
So, how did you learn Lua? Could you give links, videos, etc. because I am really trying to get into Lua, and I do not really know how.
Thanks!
#2
Posted 26 November 2013 - 10:09 PM
Personally I did 3 things:
1. I read the PIL
2. I read a few of the pages on lua-users.org.
3. I read other people's code and played around with it seeing what different things did and how the changes I made effected the program
#3
Posted 27 November 2013 - 02:40 AM
And I want to underline, like theoriginalbit, Google is your friend!
#5
Posted 27 November 2013 - 05:27 AM
Be aware, though, that not all commands will work the same in ComputerCraft as they're documented on those sites - their names or effects may vary. If a command has any documentation on the CC wiki, then pay attention to what that has to say.
Probably the largest percentage of what I've learned comes from reading forum posts in this board section. It's common to see people throwing out comments like "by the way, you could take this block of code and do the same thing faster and easier with this one", and that knowledge is very valuable - it's difficult to look up stuff about coding concepts if you don't even know those options exist, but simply reading manuals cover to cover tends not to reveal the most useful stuff very quickly.
Once I have a command, if I'm still unsure exactly how it behaves I'll write a short script for the sole purpose of playing with it. Passing it random-ish variables and confirming I get back the results I expect.
How I originally learned to program, however, was via library books - Usborne in particular, and about a year ago I even ordered some of the books from that series just for the sake of having them. Heh. Maybe I should try and get Island of Secrets running in ComputerCraft.
Once computing moved on a bit and Windows became more popular, I shifted to QBasic. There were not nearly as many interesting books on that language, and this was before internet access was common in the home, but the IDE includes a working code example for pretty much every command - you could literally type in "if", right click that word, and instantly get a page or two of info on it along with a commented example program (filled with other commands that you may or may not know, but could also right click, and so on...).
Eventually I started on Java. Still without much in the way of internet access, it was again just a case of relying on the official documentation of the language, but by then I was mostly just translating commands & concepts I already knew into a slightly different dialect. These days, when working with a language I'm not familiar with it's web searches all the way, command by command. Typically the first search is to determine what the "does not equal" sign is... <>, !=, ~=, I don't see why there are so many variants...
See, most higher-level languages look the same, at a glance - once you've got a semi-decent knowledge of a few (... and an internet connection), you can quickly learn to produce working code (not always "good" code, but "working") for just about any of the others.
Bah. You've got me rambling now.
#6
Posted 27 November 2013 - 05:56 AM
Edited by Elgriton, 27 November 2013 - 05:58 AM.
#7
Posted 27 November 2013 - 06:53 AM
theoriginalbit, on 27 November 2013 - 02:44 AM, said:
To still stay on topic, I want to say that experience is the best way of learning. That is because you come up with code that is more efficient than you had, so you remember the better code, to say it like that.
Also I want to say that you can certainly ask questions, but do your research first! Because there are a lot of questions which can be solved by a simple Google search.
#8
Posted 27 November 2013 - 12:08 PM
Edited by ZudoHackz, 27 November 2013 - 12:08 PM.
#9
Posted 24 April 2016 - 03:25 PM
Bomb Bloke, on 27 November 2013 - 05:27 AM, said:
Seems you can now download these as free PDFs from Usborne's own website, as of a couple of months ago. Totally out of date in the modern coding era, but still totally worth a look!
#10
Posted 25 April 2016 - 10:11 AM
I pretty much just worked on it for a couple of days until it worked.
#11
Posted 25 April 2016 - 11:38 AM
I learned Lua just by playing modded minecraft with CC on it. I wanted to do something, and I tried until I could make it.
I also tried to make everything portable between different computers, so I had to learn tables (which really isn't hard at all, I don't understand how people can't figure them out), I made sure that I wrapped each peripheral correctly, I made sure that each and every single thing I had would be fine without human interaction and not wanting to force someone if they used my code to change parts of the source itself. (Although I did start out that way).
I had a few railcraft ranks I wanted to monitor, I made a program. I wanted to make sure that each tank when it got full or empty, had a system in place that it would message the other computers I connected to either drain or fill the tanks. I expanded my program and learned a bit of rednet along the way.
I wanted to know which buttons on the Tardis mod I've used to save to, I made a button display.
I wanted a message system for me and the person I shared my base with to communicate easier without having to worry about making down or placing signs, I made a message system.
Any other thing I learned about Lua I did by just either lurking, or helping out here in the AaP section or of course ASKING in the AaP section. (Yay patterns, or as I much more commonly call them Regular Expressions)
Nowadays I go to college for a game design programming degree though, so no more Lua really for me. However it sort of opened my eyes to how much Lua is different from other languages and how much I like C# more than Lua or most other languages. Also it showed me that both I don't know everything, and that ternary is done quite a bit different in other languages
Edited by Dragon53535, 25 April 2016 - 11:45 AM.
#12
Posted 25 April 2016 - 07:43 PM
#13
Posted 29 April 2016 - 05:36 PM
#15
Posted 29 April 2016 - 07:20 PM
After the server closed, I started playing more seriously with CC on a singleplayer world, making many classical "first programs" like doorlocks, screensavers, remote controlled turtles, etc...
I pretty much learned by trial and error with the help of the CC wiki.
#17
Posted 29 April 2016 - 08:52 PM
#18
Posted 01 May 2016 - 12:53 AM
mrpoopy345, on 26 November 2013 - 07:51 PM, said:
So, how did you learn Lua? Could you give links, videos, etc. because I am really trying to get into Lua, and I do not really know how.
Thanks!
experimenting
looking at other code
and watch dire his vids and also funshine
and if you don't get how something works or how you could do something you can always ask a pro or ask me
maybe look into computecraft edu
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users