Malformed number error help

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
chillyskull
Prole
Posts: 9
Joined: Sun Jun 06, 2021 11:05 pm

Malformed number error help

Post 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 8706 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 8706 times
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: Malformed number error help

Post 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.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Malformed number error help

Post 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.
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: Malformed number error help

Post by pgimeno »

Oh right, I missed the pico8 bit. You can try running it with this: https://github.com/picolove/picolove
User avatar
chillyskull
Prole
Posts: 9
Joined: Sun Jun 06, 2021 11:05 pm

Re: Malformed number error help

Post 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}
Last edited by chillyskull on Tue Jun 08, 2021 12:19 am, edited 1 time in total.
User avatar
chillyskull
Prole
Posts: 9
Joined: Sun Jun 06, 2021 11:05 pm

Re: Malformed number error help

Post 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?
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: Malformed number error help

Post 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.
User avatar
chillyskull
Prole
Posts: 9
Joined: Sun Jun 06, 2021 11:05 pm

Re: Malformed number error help

Post 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...
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: Malformed number error help

Post 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.
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: Malformed number error help

Post by pgimeno »

This is how the line should look like:

Code: Select all

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

Who is online

Users browsing this forum: No registered users and 22 guests