horrlang/README.md

39 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2022-10-31 15:39:41 +00:00
# Horrlang is an esoteric language, you should not try it.
2011-09-16 12:39:57 +00:00
2011-09-22 15:48:00 +00:00
In Horrlang, memory and instructions are mixed, so you can use old instructions
as new memory places, or do some metaprogramming rewriting your code as it runs.
2011-09-16 12:39:57 +00:00
Just like in LISP but ... without lists ... good luck ...
2011-09-22 15:48:00 +00:00
In Horrlang you have basically 2 pointers, a memory one and an instruction
one. Both start at 0. The instruction one follows instructions that can move
2022-10-31 15:39:41 +00:00
the memory pointer. Have a look at the instruction set:
2011-09-16 12:39:57 +00:00
2022-10-31 15:39:41 +00:00
Instruction set:
2011-09-16 12:39:57 +00:00
- Lx: `left`: Move memory pointer on the left for `x` chars (defaults to `1`).
- Rx: `right`: Move memory pointer on the right for `x` chars (defaults to `1`).
- Nx: `next`: Forward Jump: Move execution pointer to the first found `x` on the left of its current position.
- Px: `prev`: Backward Jump: Move execution pointer to the first found `x` on the right of its current position.
- O: `output`: Copy the current value under memory pointer to stdout.
- I: `input`: Copy from stdin to the current memory pointer.
- K: Decrement the value under the current memory pointer.
- H: Increment the value under the current memory pointer.
- Jx: `jump` If the value under the current memory pointer is not `0` (0x30): Move the instruction pointer to the previous `x` instruction (like `Px`). (Jumps to the beginning if no `x` char is found).
2011-09-16 12:39:57 +00:00
2022-10-31 15:39:41 +00:00
The Hello World:
2011-09-16 12:39:57 +00:00
python horrlang.py 'R9R9R9R4OROROROROROROROROROROROHello World.'
2011-09-16 12:39:57 +00:00
2022-10-31 15:39:41 +00:00
Or:
python horrlang.py 'Hello World0KORJK'
2022-10-31 15:39:41 +00:00
Writing a infinite serie of P:
2022-10-31 15:39:41 +00:00
R5OP5P or R3OP3
Write 123456789 using a loop:
R9R3:ROHLKJ:81