dbaumgarten / yodk

Development Kit for Starbase's ingame programming language YOLOL
MIT License
57 stars 16 forks source link

Exponentials and Hexadecimals #124

Open Oloneus opened 2 years ago

Oloneus commented 2 years ago

Describe the bug Yolol accepts hexadecimal and exponential constants. Yodk does not.

Example code

a=1e6 b=0xF4240
a=1000000 b=1000000

Yodk results Yodk marks these as errors, even tho, Yolol can use it

dbaumgarten commented 2 years ago

Well, that's a fascinating discovery. It seems like nobody else has ever noticed before that yolol supports hex and scientific notation for number-constants.

You are right, York should support this. I won't have the time for this in the next few days, but maybe in a week or so I'll give it a try.

dbaumgarten commented 2 years ago

Support for hex and exponential numbers has been added with v0.1.13. I am pretty sure that there are some edge-cases where the game behaves differently, but it's a start. If you find any issues with this, just reply here and I will reopen the issue.

martindevans commented 2 years ago

It looks like you haven't added support for hexadecimal exponentials? e.g. 0x1AFP2 == 0x1AF * 2^2 == 1724

See documentation here for atof which is what we assume it's using.

Here's a screenshot from the game as proof:

Code Result

dbaumgarten commented 2 years ago

You got to be kidding me... Hexadecimal exponent-notation?! What the actual fuck?!

I am absolutely sure that his was never an intended feature in YOLOL. They just used atof and never bothered to read it's documentation...