Page 1 of 2

Malformed number error help

Posted: Sun Jun 06, 2021 11:12 pm
by chillyskull
Hey all,
I got this error for some binary I'm using, or perhaps a variable near it. Tried changing the binary to decimal values. No dice. This code functions on the pico8 engine just fine however. I appreciate your time! thanks!

here's the error:
Screen Shot 2021-06-06 at 7.07.22 PM.png
Screen Shot 2021-06-06 at 7.07.22 PM.png (11.35 KiB) Viewed 8823 times
here's the code:
Screen Shot 2021-06-06 at 7.08.31 PM.png
Screen Shot 2021-06-06 at 7.08.31 PM.png (12.5 KiB) Viewed 8823 times

Re: Malformed number error help

Posted: Mon Jun 07, 2021 12:11 am
by pgimeno
The decimal should work. What happens when you enter decimal? Do you get the same error? In the same line?

I can't post a converted version because you have posted an image instead of text, so I can't copy-paste to Python to fast-convert it. I suggest you post text next time.

Re: Malformed number error help

Posted: Mon Jun 07, 2021 7:30 am
by grump
PICO-8 is not really Lua. They added their own stuff to the language, making it incompatible with Lua. Binary literals with prefix 0b seems to be one of the changes they made.

Re: Malformed number error help

Posted: Mon Jun 07, 2021 11:28 am
by pgimeno
Oh right, I missed the pico8 bit. You can try running it with this: https://github.com/picolove/picolove

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:15 am
by chillyskull
pgimeno wrote: Mon Jun 07, 2021 12:11 am The decimal should work. What happens when you enter decimal? Do you get the same error? In the same line?

I can't post a converted version because you have posted an image instead of text, so I can't copy-paste to Python to fast-convert it. I suggest you post text next time.
yeah i get the same error message, in the same line, it acts like there is still binary there
here's the code in text: crv_sig={0b11111111,0b11010110,0b01111100,0b10110011,0b11101001}

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:18 am
by chillyskull
grump wrote: Mon Jun 07, 2021 7:30 am PICO-8 is not really Lua. They added their own stuff to the language, making it incompatible with Lua. Binary literals with prefix 0b seems to be one of the changes they made.
gotcha, very informative thank you. Any reason why it still won't run when I change it to decimals?

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:32 am
by MrFariator
How are you writing it down as decimals? What does the code do with the numbers? Perhaps share more code to show the context.

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:37 am
by chillyskull
MrFariator wrote: Tue Jun 08, 2021 12:32 am How are you writing it down as decimals? What does the code do with the numbers? Perhaps share more code to show the context.
i used a online converter to get decimals from binary. I popped in the values and ran it. same error message from before appears, it still thinks there is binary there for some reason...

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:49 am
by MrFariator
Please post the code, it'll make this easier. Without it, at best I can guess maybe you're still running the old code (with the 0b prefixed numbers) if it's the exact same error, unless there is some other form of number format error.

Re: Malformed number error help

Posted: Tue Jun 08, 2021 12:16 pm
by pgimeno
This is how the line should look like:

Code: Select all

crv_sig={255, 214, 124, 179, 233}