Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --So this is Lua's commenting stuff. I think that GLua, what Garry Newman uses for Garry's Mod allows // as a prefix.
- function AddNumbers(number1, number2) --Simple, clean. I think you're allowed to specify returns, but it defaults to auto.
- io.write("String concatination is".." so fucking easy.".." You can even do it with numbers: "..500);
- local num = number1 + number2; --You don't need to specify any types ever.
- return num, num + 1; --Multiple return types; compacts it into an array before returning.
- end --This is like pseudocode. Fucking love it.
- --[[ Comment block syntax looks rad. ]]--
- for i = 0, 10 do --Don't need to define a second value type or name, just loops to the second number.
- io.write("Ay lmao"..i);
- end
- --Now.. My favourite. The 'Do while' loop.
- repeatVal = 0;
- repeat
- io.write("Repeating...");
- until repeatVal > 10;
- -- Repeat until. So sleek.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement