Search found 16 matches

by AaronV
Sun Jul 29, 2012 4:01 am
Forum: Support and Development
Topic: Anyone wanna help me work out some math?
Replies: 2
Views: 1844

Re: Anyone wanna help me work out some math?

Well that sure sounds like it will work, thanks Xugro! So like if it were .6 I would need to loop it 5 times to get a whole number - 3.0. .6*((2*5)^1) 2^(1-1==0) * 3^(1-0==1) * 5^(0-1>>0) == 1*3*1 == 3 I think I get the concept. So do I just have to brute force check for primes then? That's gonna be...
by AaronV
Thu Jul 26, 2012 7:52 am
Forum: Support and Development
Topic: Anyone wanna help me work out some math?
Replies: 2
Views: 1844

Anyone wanna help me work out some math?

Okay so I'm going to be looping through some number between 0 and 1, adding it over and over until it becomes some whole number. Probably won't be anything too complicated in reality - something that will work itself out on the first pass of 1 or 2 - but I don't want it to break years down the road ...
by AaronV
Wed Jul 18, 2012 5:38 pm
Forum: Support and Development
Topic: Nesting troubles
Replies: 5
Views: 2109

Re: Nesting troubles

both of those are what i figured might be the case. it just frustrates me that i either have to avoid calling the function or call it by its full name math.sine.approximateSine() outside of a place that i want it in. i want to use the table's variables math.sine.samples within the table math.sine ou...
by AaronV
Tue Jul 17, 2012 6:27 am
Forum: Support and Development
Topic: Nesting troubles
Replies: 5
Views: 2109

Nesting troubles

I'm pretty sure I don't know what I'm doing. I'm trying to construct a math namespace, so I can call math.section.function(). inside my math namespace is the sine section. so i can call math.sine.function(). my function is approximateSine(). so like math.sine.approximateSine(). THIS FUNCTION IS DONE...
by AaronV
Mon Jul 16, 2012 11:12 pm
Forum: Support and Development
Topic: [SOLVED] two more beginner lua questions
Replies: 10
Views: 4289

Re: two more beginner lua questions

Oh thanks! now i get it. one is the location in the table and the other is the value in that location. still fumbling my way around this thing. got to improve the structure of my sine approximating program. it's pretty messy, but it works. it's a lot faster than math.sin(). i'm getting it. see he se...
by AaronV
Mon Jul 16, 2012 7:55 pm
Forum: Support and Development
Topic: [SOLVED] two more beginner lua questions
Replies: 10
Views: 4289

Re: two more beginner lua questions

your code says for a,v.
mine said for a,b.

does that mean that mine will only loop twice?

starting number in table, variable representing number in table

right?

or is it starting location in table?
by AaronV
Mon Jul 16, 2012 7:47 pm
Forum: Support and Development
Topic: Math.Random making same output every time...
Replies: 13
Views: 5283

Re: Math.Random making same output every time...

Meh, you're probably right. I build my own sometimes so I've studied a couple of non standard ones. Guess I got some crazy idea in my head. Forget I brought it up.
by AaronV
Mon Jul 16, 2012 4:22 pm
Forum: Support and Development
Topic: [SOLVED] two more beginner lua questions
Replies: 10
Views: 4289

Re: two more beginner lua questions

oh my god now i'm even more confused.
sorry sorry sorry i'm super bad at programming i guess!

Code: Select all

a = 1
b = 2
for a,b in ipairs{1.0,2.0,3.0} do
 print (a)
 print (b)
end
would print out
1, 1.0 or
1.0, 1.0 or
1.0, 2?

also does anyone know of an IDE with a debug button for LUA?
by AaronV
Mon Jul 16, 2012 4:01 pm
Forum: Support and Development
Topic: Math.Random making same output every time...
Replies: 13
Views: 5283

Re: Math.Random making same output every time...

Oh so it adds the number for you. Well never mind then! ;) Assumed it was like the ones where YOU have to tell it what the seed it. Should've known better. This is a scripting language, not the other kind . Of course it works the way a sane person would have it work. More TERRIBLE advice: I would ge...
by AaronV
Mon Jul 16, 2012 6:11 am
Forum: Support and Development
Topic: Math.Random making same output every time...
Replies: 13
Views: 5283

Re: Math.Random making same output every time...

THE FOLLOWING IS BAD ADVICE BUT KEPT FOR HISTORIC REASONS I was trying to help... :cry: Careful with using system time, it's entirely possible to get the same result twice in other languages. Like if you wanted to pump out a ton of random numbers in once update step, you could easily get a lot of t...