Assorted token golf in rope logic #25
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "kistaro/chameleonic:rope_golf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
These should be semantically equivalent.
In converting level:tug_crate to level_tug_crate (which allows for a substantially more efficient and modestly shorter foreach to replace a for loop elsewhere in the code), I chose to define
local self=level
to save four cycles at the cost of three tokens; using the globallevel
in all cases incurs an extra two global lookups (at two cycles each). Since this is called in a loop in code generally sus from a performance perspective I think that's the appropriate trade-off but you're welcome to overrule me on this.Most other changes are "pure wins", improving both performance and tokens, primarily by finding terser ways to express conditions.
I tested this by playing a few levels but please scrutinize this closely to make sure my permuations are as equivalent as I think they are.
As is required in Pico-8 Golf, I'm sacrificing some readability in favor of terseness.