It would be useful to be able to name flags and not have to keep track of numbers.. For instance in The Count, flag #2 is used to signify "sleep", and it would make the code easier to understand if the command set_flag 2 could instead (optionally) be written as set_flag sleep.
This extended behavior should be possible to activate using a commandline switch like --skplus (or something like that).
It would not require you to explicitly define which flag number corresponds to what flag “name” and it would all be handled “under the hood”. This is how I would probably do it:
Initially, when parsing a source code file you would have a “flag reservation table” that’s predefined to look like this:
Once all the actions have been read, all the “undefined” values in the table will be assigned the first unique available value, and the final table would look like this:
It would be useful to be able to name flags and not have to keep track of numbers.. For instance in The Count, flag #2 is used to signify "sleep", and it would make the code easier to understand if the command
set_flag 2
could instead (optionally) be written asset_flag sleep
.This extended behavior should be possible to activate using a commandline switch like
--skplus
(or something like that).It would not require you to explicitly define which flag number corresponds to what flag “name” and it would all be handled “under the hood”. This is how I would probably do it:
Initially, when parsing a source code file you would have a “flag reservation table” that’s predefined to look like this:
When an action/occurrence containing flag statements is encountered, entries are added to this table.
…and the “flag reservation table” would look like this:
Once all the actions have been read, all the “undefined” values in the table will be assigned the first unique available value, and the final table would look like this:
When the time comes to translate the code to an old-fashioned Scott Adams DAT file, any instances of “sleep” will be translated to “1”.
Possibly, flag 0 should be possible to utilize freely for allocations, unless commands
set_flag0
orclear_flag0
have been used in any actions.