dbaumgarten / yodk

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

Add lerp and inverselerp #97

Closed louga31 closed 2 years ago

louga31 commented 2 years ago

What this PR does / why we need it**:

This PR adds the lerp and inverselerp function to the math stdlib

Which issue(s) this PR fixes**:

Fixes NONE

Checklist:

dbaumgarten commented 2 years ago

Hi, thanks for the PR. I think that will be a good addition to the stdlib. The code and it's test look fine. The only thing I find strange is how much has changed in bindata.go. What command and what version of go-bindata did you use to generate it? (I don't think you did anything wrong here, after all the tests show that nothing broke. I just would like to understand whats going on here)

louga31 commented 2 years ago

I used this command: go-bindata -pkg stdlib -prefix src/ ./src

I'm using go-bindata version 3.0.7 on Windows (maybe that's why a lot have changed)

louga31 commented 2 years ago

Found the issue, I was using the old unmaintained bindata repo, I reuploaded bindata with the new one and it look a lot more like the old one

dbaumgarten commented 2 years ago

That looks a lot better. The only question now is, why did the parts for logic and string change in bindata.go? I really have to change how this whole bindata stuff is handled. In it's current state it makes creating and reviewing PRs for the stdlib unnecessarily difficult.

louga31 commented 2 years ago

I have no idea of why they changed, I didn't touch these files, so it should be safe to only include the math modification of bindata and discard the logic and string

dbaumgarten commented 2 years ago

So, I have re-generated bindata.go with my version of go-bindata and now everything looks like it should. I will pin the bindata-version in the go.mod and write some instructions on how to use this, to simplify future PRs for the stdlib.

This PR is now ready and I will merge it right away. Thanks for the PR!