dbaumgarten / yodk

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

integer comparison bug #116

Closed lizelive closed 2 years ago

lizelive commented 2 years ago

Describe the bug i think its a integer comparison bug

Example code a="1" :d=5*(a>4) :d+=2*(a>:d+1) :d+=a>:d :d+=a>:d goto1 should return 1 but it returns 4

a=1 b=2
goto 1

Ingame results 1 Yodk results 4 Additional context parsing strings

dbaumgarten commented 2 years ago

I looked into this and yodk's output seems to be correct.

:d=5*(a>4)   -> 0
:d+=2*(a>:d+1)   -> 4
:d+=a>:d   -> 0
:d+=a>:d  ->  0

Everything as expected. The second statement is (according to yolol's weird precedence) parsed as :d+=2*((a>:d)+1) , which correctly returns 4.

Is it possible that they finally fixed the weirdly broken operator-precedence ingame? Are there any patchnotes regarding this?

dbaumgarten commented 2 years ago

@lizelive I just tested your code ingame and it did return 4 for me.

Did you test this on the live-server (if yes, how exactly) or on the PTU?

dbaumgarten commented 2 years ago

Closed due to inactivity