how to use


the first thing you'll be greeted with upon creating a new file or opening one, is the code editor. on the top you can see the path to the file you're editing, if it has been saved since the last change or not and, most importantly, the current writing mode, we'll get into that later. your recent words will show on the bottom bar, and to add a word to that bar you'll need to open the dictionary by pressing 'C'. the selected dictionary will change depending on the context, as branch will detect where you are in your code. to move through your code, use the up and down arrows. this will automatically scroll the view if needed. to move faster, you can use the page up/down keys. you can choose a word from the recent words bar by using the left and right arrows. to run your program, you can press 'Q', and to save it press 'W'.

note: the paths may be regular paths, but filenames must be composed of words in the dictionary, as otherwise it would kinda break the theme, plus this allows the editor to be fully usable with a controller

next on the list are modes. basically, the editor can be in four different modes, which we'll cover one by one. the first(and default except on empty/new files) is called "edit line", and it lets you add words to the currently selected line by pressing 'Z', and to delete a word by pressing 'X'. if a line is left without any words, it will be deleted automatically. the first word of a line is always a keyword, and the rest is always either english words or numbers. the next mode is called "new line inside block", and it is the default on empty files. to manually enter it, you can press 'V' from within the "edit line" mode. upon entering it, you'll be prompted to choose a keyword from the recent words bar or from the dictionary(by pressing 'C'). to enter it just press 'Z', or alternatively you can press 'V' to return to the "edit line" mode. if you are selecting the head of a block(orange background), the new line will be placed inside, otherwise it will be placed after the selected line. if the selected line is the last line in a block, the block will be extended to fit that line inside. mode "new line outside block" can be entered or exited by pressing 'B' in edit mode and is really similar to the previous one, but here lines are placed after the end of the selected block if any, or outside the parent block if the selected line is the last one in that block. finally, we have the "edit compound word or string" mode, entered and exited with 'N', it lets you add words to the last word of the selected line, adding underscores('_') between them. it also lets you add digits to a number word you added previously. to add words, use 'Z' as with the "edit line" mode, and the same with removing with 'X'. removing the only word in a compound word or string will delete that entire word and enter "edit mode". if you enter the mode by pressing 'M', that last word will be turned into a string, and this cannot be reversed without first deleting the entire compound word.

finally, we'll briefly discuss the syntax:

- `let <name> <value>`: creates or sets a variable to a value, which can be a number, a string or another variable.

- `call <func>`: calls a function.

- `add/sub/mul/div/mod/and/or/xor/shl/shr <dest> <src>`: adds, subtracts, etc. src from dest and stores the result in dest.

- `not <name>`: negates a variable's value.

- `print <arg_1> <arg_2> ...`: prints out to the terminal all the specified arguments.

- `fetch <name>`: fetches a key from the keypress buffer to a variable in ASCII form.

- `func <name>`: declares a function.

- `push <value>`: pushes a value, let it be a variable, a number, a function or a string.

- `pop <name>`: pops a value in the stack to a variable.

- `loop`: loops back to the start of a block(turning an if statement into a while statement).

- `equal/not_equal/great/not_great <x> <y>`: runs the code inside if the condition is met.

Files

branch.tar 1 MB
May 04, 2022

Get branch!

Leave a comment

Log in with itch.io to leave a comment.