Astridec

From Esolang
Jump to navigation Jump to search
Logo by User:PixelatedStarfish
Astridec
Paradigm(s) Imperative
Designed by User:PixelatedStarfish
Appeared in 2021
Memory system Cell-based
Computational class Turing complete
Major implementations Java Interpreter
Influenced by Heck, Starstuff
File extension(s) .adec

Astridec is a programming language created by User:PixelatedStarfish. It is designed for Starstuff, such that any sequence of characters can be converted to runnable Astridec code. Astridec is designed to be extremely simple, with 10 instructions and virtually no errors. It is very similar to bf; memory is stored as bytes on a circular, unbounded tape (similar to a deque). Bytes wrap around such that all values must be between 0 and 255 inclusive.

To clarify, the tape is initially at a size of 64 cells. Incrementing to cells 65 and beyond extends the length of the tape. Decrementing to cell -1 causes the pointer to jump to the highest cell on the tape.

Commands

Command Desc.
0 Set cell to 0
1 Add one to byte
2 Subtract one from byte
3 Increment cell pointer
4 Decrement cell pointer
5 If cell is 0, go to previous 5, or to start if there is no previous 5.
6 If cell is 0, go to next 6, or to end if there is no next 6 (halt).
7 Take input as an ASCII character
8 Print ASCII char
9 Halt
*comment* A comment

Program Examples

Hello World

11111111111111111111111111111111111111111111111111111111111111111111111183                *H*
11111111111111111111111111111111111111111111111111111111111111111111183                   *E*
111111111111111111111111111111111111111111111111111111111111111111111111111183            *L*
111111111111111111111111111111111111111111111111111111111111111111111111111183            *L*
111111111111111111111111111111111111111111111111111111111111111111111111111111183         *O*
1111111111111111111111111111111183                                                        * * 
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111183 *W*
111111111111111111111111111111111111111111111111111111111111111111111111111111183         *O*
111111111111111111111111111111111111111111111111111111111111111111111111111111111183      *R*
111111111111111111111111111111111111111111111111111111111111111111111111111183            *L*
1111111111111111111111111111111111111111111111111111111111111111111183                    *D*
*the newlines are not required*

Truth Machine

72222222222222222222222222222222222222222222222226
501111111111111111111111111111111111111111111111111805
601111111111111111111111111111111111111111111111118
*prints '0' if input is '0', prints '1' forever otherwise. Newlines not required*

Cat

78

External Links