generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: The five elements of Lua code

Previous Thread :: Next Thread 
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
20 Sep 2011 05:23 PM
I came up with five different things that anything in Lua code can be categorized in.

1) Literals
Things like 5, "Hello", true, false, or tables defined by {}

2) Identifiers
Names of things, like "print", "a", "Workspace", etc.

3) Operators
Symbols, mostly. +, -, *, /, %, ., parenthesis, etc.

4) Keywords
Language constructs for changing the flow of a program.

5) Comments
Stuff that is not executed.

The thing I'm asking YOU all, is to point out some other category that I may have missed. I think everything in Lua code can be categorized in one of those 5 things though. Bonus points if you subdivide these categories.

tl;dr: What did I miss?

Why: I'm going to try writing a more effective tutorial, and see how this works out.

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
ThisIsSCRIPTERS is not online. ThisIsSCRIPTERS
Joined: 15 Sep 2011
Total Posts: 334
20 Sep 2011 05:25 PM
Y U NO METATABLE
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
20 Sep 2011 05:27 PM
Metatables are created with literals, of course.

Can you make a table with a metatable without defining a table literal in code?

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
ThisIsSCRIPTERS is not online. ThisIsSCRIPTERS
Joined: 15 Sep 2011
Total Posts: 334
20 Sep 2011 05:27 PM
Y U NO ADD INSTANCES
Report Abuse
ThisIsSCRIPTERS is not online. ThisIsSCRIPTERS
Joined: 15 Sep 2011
Total Posts: 334
20 Sep 2011 05:28 PM
INSTANCE AS

INT = INSTANCE.NEW("HINT")
x.PARENT = WORKSPACE
x.TEXT = "THIS IS IN WORKSPACE TROLOLOLOLOLO"
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
20 Sep 2011 05:30 PM
It's about the actual code symbols and stuff, not what they do.

Think of this as the nouns, verbs and adjectives of Lua.

Also...this is why we can't have nice things.

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 05:30 PM
Operators;
  - Math operators;
    + - ^ * / %

  - Logical operators;
    ~= == > < <= >=


Literals;
  - Integers; -3, -2, -1, 0, 1, 2, 3...
  - Floats; 1.001, 2.5, 1.337
  - Booleans; true, false
  - Characters; 'a', 'b', 'c'
  - Strings; 'Hello World!'

Maybe? c:
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
20 Sep 2011 05:32 PM
@Spectrumw
I'm thinking of having that as a different list. The elements of Lua code and the types of values in Lua, you know?

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 05:33 PM
Wait... Were you talking about subdividing the categories you already had or... ? D:
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
20 Sep 2011 05:36 PM
@Ozzy

"Literals"
I prefer to call it, Values.
Report Abuse
ThisIsSCRIPTERS is not online. ThisIsSCRIPTERS
Joined: 15 Sep 2011
Total Posts: 334
20 Sep 2011 05:36 PM
Keywords
-----------

- Loops -
While, repeat, for

- if then -
if 1 == 1 then

- local -
local variable = 'variable'

Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
20 Sep 2011 05:38 PM
@gigakid

No, literals are values that are written in code.

a = workspace.Name

`a` has a value of string type, but there are no string literals in the code.

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
InsertObjectScript is not online. InsertObjectScript
Joined: 19 Sep 2011
Total Posts: 101
20 Sep 2011 05:41 PM
@thisiscripters

noob y u no shorten srip

INSTANCE AS

INT = INSTANCE.NEW("HINT",workspace)
INT.TEXT = "THIS IS IN WORKSPACE TROLOLOLOLOLO"
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
20 Sep 2011 05:44 PM
Break apart Keywords a bit, since it's a little ambiguous.

"Scope" would be better than identifiers, since identifiers are really just
getfenv(0)[variable_name].
Especially since you aren't describing scope there.

You could also point out recursion / iteration, or other fundamental ideas of _computing_ on a related note.
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
20 Sep 2011 05:55 PM
Would functions be considered literals too?


~ pwnedu46 ~
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
20 Sep 2011 06:08 PM
6) innapropreate comments.

i seem to have a lot of those.
Report Abuse
TigerBloodd is not online. TigerBloodd
Joined: 24 Oct 2010
Total Posts: 2430
20 Sep 2011 06:10 PM
@InsertObjectScript
Y U NO MAKE SKRIPT SHORTER?

 h=Instance.new("Hint",workspace).Text = "umad?"

TigerBloodd | Programmer | Developer
Report Abuse
Noobster5oo is not online. Noobster5oo
Joined: 18 Aug 2011
Total Posts: 2975
20 Sep 2011 06:50 PM
Teh sixth element.

-The naked old man who is possibly chocolate...
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 06:52 PM
@Tiger
What? That won't work;
Instance.new("Hint",workspace).Text = "umad?"

@Noobster
Are you talking about Mina Hovovich?
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
20 Sep 2011 06:57 PM
whitespace

i win
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 06:58 PM
Whitespace;
  Spacebars;

  Tab;  

I actually included an example of each. c:
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
20 Sep 2011 07:00 PM
u forgot return/enter/newline c:
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 07:02 PM
Enter is beetween 'Spacebar' and 'Tab' c:
ucwutididther
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
20 Sep 2011 07:03 PM
u didnt list it like u did th other 2
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
20 Sep 2011 07:09 PM
Whitespace;
Spacebars;
  Enter;

Tab;
  Newline; '/n'

c:
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image