Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30f9cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evidently, Lua doesn't do hoisting, so I've rearranged the functions.
30f9cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to rearrange the functions, just write
local near_surface, add_shrooms, make_worms
on the beginning of the file and these are accessible and localized everywhere under this line.
function i() does the same as i = function()
local function i() does the same as local i = function()
30f9cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The reason I rearranged was so the function variables are declared and defined in a single location. This seems cleaner and clearer to me (and my OCD).