Is it the precision of the float to string? Ya get 0.1234567
etc..but the actual value has more precision i think.
As soon as ya read the data the value is different...
The aryop, the comparison, the sub is gonna give ya the difference...
I maybe ya just getting lucky sometimes of the array having a less precise values that can survive the string conversion.
Have ya tried just putting the str$() into an array$
Then putting the val() of that into array b.... probably get the same results... i cant prpve it but im guessing READ gives ya the val() of the DATA
Yeah, I think the way to go for all parties involved here is to figure out what precision exactly these values are. Converting the floats to strings is a giant red flag; this bug could just end up being "the basic output of STR$ doesn't have enough precision".
Even with these, I can't reproduce the bug. I ran Nathaniel's updated program for about five minutes, but the loop didn't terminate. I ran incvoid's program for 10,000,000 loop iterations, but C was still 0 at the end. I typed both programs exactly as written, so I'm not sure what the problem is.
Have you had SmileBASIC running for a long time? If you close SmileBASIC and start a new session, then load these programs and run them, without doing anything extra, does the bug still happen?
If you power off your Switch entirely, then turn it back on, does the bug still happen?
Could it be some sort of hardware difference? I bought my Switch at launch. Was it the same for you?
Mine's American, launch, completely up-to-date (system 8.1.0, SB 4.0.3). It's odd that I can't get it to happen at all... it must really be something subtle.
When the values don't match, what do they end up being, anyway?
Honestly I have no idea why unreproduceable glitches occurnin programs. It happens everywhere, not just smileBasic.
Okay! Finally got it to happen myself with Nathaniel's latest code, after restarting my Switch.
The result it gives is a float that's either 0 or the first digit of the number, no matter how large that number is. The result also keeps the sign of the original number. For instance, -8000.123 can yield either -0 or -8.
My guess is that this is some sort of race condition. VAL probably has an internal loop where it shifts in each individual digit, but for some reason it's on a different thread, and doesn't always yield the right number in time. It could always be something else, though.
I’m having some trouble with how the layers work. I’m trying to use GBOX to outline collision areas but it appears under sprites and background characters. I think back on the 3DS I used something like GPRIO to set the screen priority of graphics. I don’t see anything like that in the function guide.
Did you try some 3ds programs that work that way on the switch to see if they act differently?
P.S. great tutorials btw