Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matronator committed Jul 26, 2024
1 parent 453e2f4 commit 77d86b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

**PIKOlang *(Porn Is Kinky Obviously)*** is a simple, interpreted, esoteric 2-Dimensional programming language. To write **PIKOlang *(Professionally Interpreted Kernel Operations)***, you need to write a program in a 2D grid, where each cell is a command. The program in **PIKOlang *(Probably Incomplete Kotlin Object)*** is executed by a cursor that moves around the grid, executing the commands it encounters. You can either execute the entire **PIKOlang *(Python Is Kinda Overrated)*** program at once or step through it one command at a time.

## Online playground

You can try out the language at the [Online Playground](https://matronator.github.com/PIKOlang).

## Syntax

The program starts with `#` symbol placed anywhere on the grid. The grid can be arbitrarily large. The cursor always starts facing right and moves in the direction it is facing, executing the commands in order as they are encountered (the cursor moves over them).
Expand Down
10 changes: 7 additions & 3 deletions SYNTAX.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Syntax

## Pointers

The program starts with `#` symbol placed anywhere on the grid. The grid can be arbitrarily large. The pointer always starts facing right and moves in the direction it is facing, executing the commands in order as they are encountered (the pointer moves over them). Currently, there can only be one pointer in the program, but in the future I want to implement concurrency with multiple pointers.

## Memory

The language has two memory registers and one output register:
Each pointer has two memory registers and one output register:

- **Register** - A single integer value that can be modified by the program.
- **String Register** - An array of characters that can be modified by the program. When in *String Mode™️*, any characters and symbols the pointer moves over are added to the string register.
- **Output Register** - Either a number or a string that is printed when the program exits. If the output register receives a string, the whole register gets converted to a string and any further number added will be appended as a string.

| Symbol | Description |
| ------ | ----------- |
| `#` | The pointer. Can only be once in the source file and always starts facing right |
| `#` | The pointer. Can only be once in the source file (at the current time, will change in the future) and always starts facing right |
| `;` | Exit the program and print the current value of the output register or if it's empty, print the current register value |
| `v` | Change the direction of the pointer downwards |
| `>` | Change the direction of the pointer to right. \**Different in Condition Mode* |
Expand All @@ -27,9 +31,9 @@ The language has two memory registers and one output register:
| `~` | Pop the last element from the string register and append it to the output register |
| `:` | Print the current value of the output register and clears it |
| `!` | Clear all registers |
| `\|` | Split the pointer into two, one going the original direction and the other one 90° rotated |
| `?` | Enter or exit condition mode |
| `[A-z0-9]` | If in string mode, add the character to the string register, otherwise set the register to the value if it's a digit, or to the Unicode value of the character if it's a letter |
| `\|` | **(Not yet implemented)** Split the pointer into two, one going the original direction and the other one 90° rotated. *Will be implemented in the concurrency update* |


## Condition mode
Expand Down

0 comments on commit 77d86b7

Please sign in to comment.