WARNING: you can't paste text into the game like usual if it comes from another place on your pc, or even from this page right here. To paste in text from outside, do this: click in app where you want to paste it, in your browser press EDIT->PASTE, then click again inside the app, and then press CTRL-V. Sorry about that.

WARNING: due to a bug, the app crashes when the length of deleted with ONCE command is bigger than the edited text. Paste some random letters to the edited text to it's always bigger than your biggest command.

TIP: you can step through the program with your "1" key after having clicked off text edits.

for cowboy8625's

Lang-Jam


To run the project, you can:


https://github.com/Derkune/Derkune-1984-lang

Click Menu button at the top right corner for language intro and sample programs.

The name refers to a puzzle game I would have liked to make with it originally, themed around George Orwell's 1984. You'd solve puzzles with this language.

The idea behind language is self modifying code: interpreter seeks for statements in text, then applies these statements to the same text. The goal of puzzles is to edit text in some way for each puzzle.

For example: count the number of letter N in each paragraph and append it to the end of psrsgraphs (puzzle 1 in the linked program), or to negate every word by adding or removing "UN" for each word in given dictionary (puzzle 2 in the linked program)

The code is executed until all commands in the document have failed. Then it stops, and the puzzle's objective should have been completed.

Sadly, I wasnt speedy enough to make a self modifying program, run out of deadline time

But program statements can insert or even modify it other program statements.


ADDITIONAL PROGRAM:

Program that counts the number of letters A in text and appends it to the end of the text.  Works for arbitrary numbers of letters.


Edited text:

abbbnabaabbbaaaaabbb

bbbaaaabbba

bbbbbnbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

aaaanabbnaaabbb

Program:

{FIND|A|DELETE|A|SEEK|END|APPEND|1}

//tallies the letter A and appends it to the end of document as sequence of 1s.

{FAILIFFOUND|A|FINDR|1+|SEEK|STARTOFSELECTION|APPEND|TLLD|ONCE}

//once tallying ended, inserts sentinel value T_L_L_D ("tallied") before 1s.

{FIND|TLLD|APPEND|0@|ONCE}

//@ represents the divider between tallied 1s and calculated base 10 number.

{FIND|0@1|REPLACE|1@}

{FIND|1@1|REPLACE|2@}

{FIND|2@1|REPLACE|3@}

{FIND|3@1|REPLACE|4@}

{FIND|4@1|REPLACE|5@}

{FIND|5@1|REPLACE|6@}

{FIND|6@1|REPLACE|7@}

{FIND|7@1|REPLACE|8@}

{FIND|8@1|REPLACE|9@}

{FIND|9@1|REPLACE|#0@}

// These count up to 10. Symbol # represents a carried 1.

{FIND|0#|REPLACE|1}

{FIND|1#|REPLACE|2}

{FIND|2#|REPLACE|3}

{FIND|3#|REPLACE|4}

{FIND|4#|REPLACE|5}

{FIND|5#|REPLACE|6}

{FIND|6#|REPLACE|7}

{FIND|7#|REPLACE|8}

{FIND|8#|REPLACE|9}

{FIND|9#|REPLACE|#0}

{FIND|TLLD#|REPLACE|TLLD1}

//these carry the carried 1 to previous digit to increment it.

{FIND|@|FAILIFFOUND|1|SEEK|BEGINNING|FIND|TLLD|DELETE|TLLD|SEEK|BEGINNING|FIND|@|DELETE|@|ONCE}

//cleanup.


Spoiler: if you don't care to find out, this program outputs 188 in Test Text 2.

Leave a comment

Log in with itch.io to leave a comment.