User:PkmnQ/FWOTD Attempt 1
(Redirected from Final Word Of The Day/PkmnQ)
This is User:PkmnQ's attempt at a solution to Final Word Of The Day.
Execution
The program stores data in named miniprograms, which can be edited and ran inside the main program. All miniprograms start empty.
At the beginning of the program, the input is checked. If the input is equal to the program's code, a newline is outputted, otherwise a .
is outputted instead with no trailing newline.
Then, each line of the program is interpreted as a command:
Main Command | Short Commands | Description |
---|---|---|
NOP |
. |
Does nothing |
APPEND [miniprogram] [command] |
APPNOP [miniprogram] , APPDOT [miniprogram] , APPAPP [miniprogram] [miniprogram] [command] , APPCCT [miniprogram] [miniprogram] [miniprogram] , APPCLR [miniprogram] [miniprogram] , APPINT [miniprogram] [miniprogram] [miniprogram] , APPRUN [miniprogram] [miniprogram] , APPBNL [miniprogram] [line] , APPSNL [miniprogram] |
Appends the command to the miniprogram followed by a newline. The short commands each append the commands they correspond to. |
CONCAT [miniprogram] [miniprogram] |
None | Appends the second miniprogram to the first. |
CLEAR [miniprogram] |
None | Resets the miniprogram to an empty program. |
INTERPRET [miniprogram] [miniprogram] |
RUN [miniprogram] |
Interprets the first miniprogram with the second miniprogram as input. Miniprograms whose name starts with "_" are initialized as blank and reset to whatever they were before interpreting once finished, all other miniprograms are conserved entering and exiting miniprograms. RUN uses an empty input.
|
BRANCHNL [line] |
SKIPNL |
Jumps to the specified line number (0-indexed, runs command that was jumped to) if the last character outputted was a newline. SKIPNL skips the next line.
|
As a solution to Final Word Of The Day
This fails to be a solution for a few reasons, but the important one is that while the Looping counter requires self-interpreting to run, the main program does not have to be run in a self-interpreter to function.