Search found 2259 matches

by zorg
Sun May 27, 2018 8:31 am
Forum: Support and Development
Topic: Arg returns directory path and nothing else
Replies: 2
Views: 39

Re: Arg returns directory path and nothing else

The answer lies in the fact that the vararg expression is not accessed through a variable called arg anymore (since lua 5.1+, but even that didn't really support that), and arg in löve is a global in the main thread having the command line arguments in it. You want to either use {...} or the select ...
by zorg
Sat May 26, 2018 8:11 pm
Forum: Support and Development
Topic: [Solved]For loop runnning longer than it's supposed to
Replies: 7
Views: 135

Re: [Solved]For loop runnning longer than it's supposed to

if it produces duplicates, then it doesn't do what you want it to; and again, to be honest i didn't 100% understood your intention, so if you want, you could Explain it Like I'm 5 (ELI5), maybe that way, we can help more.
by zorg
Sat May 26, 2018 7:16 pm
Forum: Support and Development
Topic: [Solved]For loop runnning longer than it's supposed to
Replies: 7
Views: 135

Re: For loop runnning longer than it's supposed to

it won't copy it as you might believe; tables are references; if you want to have two separate tables still, then you need to "deepcopy" the keys and values from one table into the other, one by one (preferrably in a loop), although in this case, doing another table.insert on the other table, and ge...
by zorg
Sat May 26, 2018 6:45 pm
Forum: Support and Development
Topic: [Solved]For loop runnning longer than it's supposed to
Replies: 7
Views: 135

Re: For loop runnning longer than it's supposed to

What do you expect this code to do exactly? Only after helping us understand it can we help you, since anything could be an issue.
by zorg
Sat May 26, 2018 5:32 pm
Forum: Support and Development
Topic: Cross-platformly deterministic to-the-power-of function
Replies: 19
Views: 461

Re: Cross-platformly deterministic to-the-power-of function

pgimeno wrote:
Sat May 26, 2018 3:19 pm
Yeah, but that doesn't really matter. It's tonumber that converts it to float. I used that because without string.format, I was getting -8.404105121027e+16. Using %d still outputs -84041051210270160.
And if you didn't tonumber it, just printed the ffi type with format %d ?
by zorg
Sat May 26, 2018 3:15 pm
Forum: Support and Development
Topic: Cross-platformly deterministic to-the-power-of function
Replies: 19
Views: 461

Re: Cross-platformly deterministic to-the-power-of function

Well, you did define print's format string to print a double-precision float with %g
by zorg
Sat May 26, 2018 2:18 pm
Forum: Support and Development
Topic: Cross-platformly deterministic to-the-power-of function
Replies: 19
Views: 461

Re: Cross-platformly deterministic to-the-power-of function

FFI won't help here. The data types in memory will be correct, but while they are in registers they are floating-point, and when dividing, they will be divided in floating point. Are you positive that using signed/unsigned integers and doing division on them doesn't actually do integer division due...
by zorg
Sat May 26, 2018 12:10 pm
Forum: Support and Development
Topic: Cross-platformly deterministic to-the-power-of function
Replies: 19
Views: 461

Re: Cross-platformly deterministic to-the-power-of function

Truncation removes the fractional part without modifying the part to the left of the decimal point. math.floor basically does that, for positive numbers; for negative, it would be math.ceil (and zero's already a whole number). Also, what was your logic behind making 32 equal 1? Wouldn't 100 = 1 make...
by zorg
Fri May 25, 2018 8:11 pm
Forum: Support and Development
Topic: need help !
Replies: 15
Views: 564

Re: need help !

Also, math.random(2) == 1 is just shorthand for if a random number is even, or odd; lua can do (condition) and ifTrue or ifFalse type branches; it will either return -100 or 100; the second one returns a number between -50 and 50. Is there any documentation about this? I wanna know more. I mean, it...
by zorg
Fri May 25, 2018 8:01 pm
Forum: Support and Development
Topic: Newbie question - Visual Novel type setup not working!
Replies: 4
Views: 113

Re: Newbie question - Visual Novel type setup not working!

To expand on a few things already observed: - The indentation might have been fine, the bigger issue was that they didn't paste all that code into [ code ] [ /code ] blocks. - You do not want to ever define any functions inside either love.update or love.draw, like how you are doing currently, since...