comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 03 Mar 2012 11:13 AM |
I was just testing tables and I got this in output:
t = {1, 2, 3, 4, 5} print(t[1] .. " " .. t[2] .. " " .. t[:1: attempt to call field 'remove' (a nil value)
Full command:
t = {1, 2, 3, 4, 5} print(t[1] .. " " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5]) table.remove(t, 4) print(t[1] .. " " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5])
table.concat wouldn't work either... |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 03 Mar 2012 11:45 AM |
| Have you defined table as a variable in that script? |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 03 Mar 2012 12:32 PM |
| No - and you don't need to. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 03 Mar 2012 12:33 PM |
I didn't say that you would need to.. That would be a thing which causes that :P |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 12:35 PM |
Add the following to the top of your script: local table_backup = table
Then replace all occurances of `table.` with `table_backup.`.
~+[CROOKITY BANDED SNAKES]+~ |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 03 Mar 2012 12:36 PM |
>Add the following to the top of your script: >local table_backup = table >Then replace all occurances of table. with table_backup..
It's a haaaax! :3 |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 03 Mar 2012 12:46 PM |
*Points finger to su*
Grapje...grapje :D (Jokes.....jokes) |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 03 Mar 2012 12:48 PM |
| It's rude to point a human with finger.. |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 03 Mar 2012 12:51 PM |
| I figured out how much all the stuff I was buying would cost - the things were priced on their weight, and there's a 15% tax - and got it correct within 2 cents. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 03 Mar 2012 12:57 PM |
@su: But pointers also point and they always betray my shelter when playing hide'n'seek. ;-;
@com: wat |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 03 Mar 2012 01:49 PM |
| Basically I can do pretty advanced math in my head in a matter of seconds. |
|
|
| Report Abuse |
|
|
pighead10
|
  |
| Joined: 03 May 2009 |
| Total Posts: 10341 |
|
|
| 03 Mar 2012 02:02 PM |
| As well as pointing, pointers cause horrific memory leaks |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 03 Mar 2012 02:36 PM |
"Basically I can do pretty advanced math in my head in a matter of seconds."
We learned how to do that in 6th grade ._. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 03 Mar 2012 02:39 PM |
t = {1, 2, 3, 4, 5} print(tostring(t[1]) .. " " ..tostring(t[2]).. " " ..tostring(t[3]).. " "..tostring(t[4]).. " "..tostring(t[5])) table.remove(t, 4) print(tostring(t[1]) .. " " ..tostring(t[2]).. " " ..tostring(t[3]).. " "..tostring(t[4]).. " "..tostring(t[5]))
If you use tostring() if it's nil it won't break. :P |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2012 03:06 PM |
I don't do math in my head, I don't see the use when I have computers, calculators, and whiteboards. If I need to do something and I don't have a computer, calculator or whiteboard I take out my notebook and do the calculations. (Pocket-sized notebooks, yay!)
~+[CROOKITY BANDED SNAKES]+~ |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
|
| 03 Mar 2012 06:05 PM |
"That's ridiculious popin."
Name one scenario in real life other than a test you'll ever _NEED_ to do mental calculations and not have access to a calculator or pen
Mmmm? |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 03 Mar 2012 06:20 PM |
@trapping,
Hmm.. you have gotten very annoying over the months you were away. That's probably the reason why my mind was at peace, these past few months..
Anyway, I think doing 10*5 in your head is a lot easier than doing it on paper if you were calculating the cost of 10 $5 posters at a store.
~Flurite |
|
|
| Report Abuse |
|
|
jon456456
|
  |
| Joined: 07 Aug 2009 |
| Total Posts: 483 |
|
| |
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 03 Mar 2012 06:21 PM |
Oh, and since you emphasize "need", give me one reason why you NEED to use pen and paper instead of doing it all in your head.
~Flurite |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 03 Mar 2012 06:28 PM |
| table.remove removes the fourth index and sets the fourth index to the fifth. Therefore, in your second print statement, it's trying to do this: (1 .. 2 .. 3 .. 5 .. nil) which it can't do because you can't use the ".." operator with nil. |
|
|
| Report Abuse |
|
|
pighead10
|
  |
| Joined: 03 May 2009 |
| Total Posts: 10341 |
|
|
| 04 Mar 2012 02:18 AM |
| Mental arithmetic is a lot more useful for most people than, say, algebra. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 04 Mar 2012 03:02 AM |
@poppin
You are hanging on a cliff, a bear stole your pants, and you don't know how much force/arc you need to get a rope over the top/around a tree, and you have 1 chance.
Drawing:
\\ // \\ // | // -- Tree. :P | / || || -- Rope needs to go around here. || || ------------ | | | | \ -- You are here w/ rope | | | | --The bear/pants are somewhere below here. | --(With pen, calculator, and pocket notebook | | | | | | | | -- Your calculator is around here | | | | | | -- Your math teacher and white board are here. | | \ | | |^^^^^^^^^ -- Spikey rocks are here. |
|
|
| Report Abuse |
|
|