Author Topic: Learning Lua... (Just a random post from a lua super noob.)  (Read 13853 times)

0 Members and 1 Guest are viewing this topic.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #15 on: January 24, 2014, 11:39:47 PM »
I think yours is just a bit too complicated for him.

I mean, I barely understood what it did.
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #16 on: January 24, 2014, 11:43:16 PM »
I think yours is just a bit too complicated for him.

I mean, I barely understood what it did.
Hmmmm... Really?
You sure it wasn't the math.randomseed() part that threw you off?
That was just for intimidation- it's nothing more than a simple math.random() seed that does some funky time to a Unix time stamp. Nothing too special, just makes things look scarier and work a bit better. Wasn't asking him to get what it actually does... :P
« Last Edit: January 24, 2014, 11:46:00 PM by Princess Twilight Sparkle »
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #17 on: January 24, 2014, 11:47:29 PM »
No, not that. Maybe it was just your lack of spacing.  ???
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #18 on: January 24, 2014, 11:48:36 PM »
Could be... It's difficult on mobile, though.
Especially a really laggy mobile device.
I'll edit it, though.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #19 on: January 24, 2014, 11:55:55 PM »
There we go. Any better?
bw81@ulysses-forums ~ % whoami
Homepage

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #20 on: January 25, 2014, 06:38:31 AM »
Code: [Select]
MEDAL[1] = { "Pasta Lover", "Obtain some yummy pasta.", 5 }
MEDAL[2] = { "Panty Thief", "Steal some underwear.", 10 }
MEDAL[3] = { "Pig Molester", "Bother a harmless pig.", 5 }
MEDAL[4] = { "Crisis", "Drop into crisis mode for the first time.", 5 }
MEDAL[5] = { "Error", "...", 20 }
Couldn't you technically do this for the table value definitions?
It's a bit more confusing, but...
Code: [Select]
MEDAL = {
{ "Pasta Lover", "Obtain some yummy pasta.", 5 },
{ "Panty Thief", "Steal some underwear.", 10 },
{ "Pig Molester", "Bother a harmless pig.", 5 },
{ "Crisis", "Drop into crisis mode for the first time.", 5},
{ "Error", "...", 20 }
}
That would create table rows, would it not?
I know it's slightly impractical... :P
Wasn't quizzing anyone, by the way...
I was just curious if I learned that correctly. :)
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #21 on: January 25, 2014, 09:02:51 AM »
That works, but I prefer cleaner and user friendly code.

Mine would be obvious to whoever uses it that "here's how you edit it".
Out of the Garry's Mod business.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Learning Lua... (Just a random post from a lua super noob.)
« Reply #22 on: January 25, 2014, 09:16:09 AM »
Good job Syn.

Guys, don't overwhelm him with 20 different ways to do tables.
One or two at a time.
Simple at first. Mine was simple enough, but had extraneous information to provide the challenge.
« Last Edit: January 25, 2014, 09:19:56 AM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given