|
|
|
+ |
PUSH is an esoteric programming language created by [[User:Expliked]] in November 2020. It uses a memory tape that can be appended (pushed) to, and removed (pulled) from. |
|
+ |
PUSH can be stored in a normal <code>*.txt</code> file. |
|
+ |
|
|
+ |
==Syntax== |
|
+ |
|
|
+ |
{| class="wikitable" style="text-align:center" |
|
+ |
|- |
|
+ |
! Keyword |
|
+ |
! Meaning |
|
+ |
|- |
|
+ |
| <code><nowiki>PUSH: (value);</nowiki></code> |
|
+ |
| Appends the value to the memory tape. |
|
+ |
|- |
|
+ |
| <code><nowiki>PULL;</nowiki></code> |
|
+ |
| Removes the last value from the memory tape. |
|
+ |
|- |
|
+ |
| <code><nowiki>OUTPUT;</nowiki></code> |
|
+ |
| Outputs the last value of the memory tape as an ASCII character. |
|
+ |
|- |
|
+ |
| <code><nowiki>INPUT;</nowiki></code> |
|
+ |
| Prompts for user input, and for each character entered, it will be appended to the memory tape. |
|
+ |
|- |
|
+ |
| <code><nowiki>EMPTY;</nowiki></code> |
|
+ |
| "Empties" the memory tape. Prints out all values individually as ASCII chars. Clears the memory tape. |
|
+ |
|- |
|
+ |
| <code><nowiki>CLEAR;</nowiki></code> |
|
+ |
| Clears the memory tape. |
|
+ |
|- |
|
+ |
| <code><nowiki>"</nowiki></code> |
|
+ |
| Denotes the start and end of a comment. |
|
+ |
|} |
|
+ |
|
|
+ |
==Examples== |
|
+ |
|
|
+ |
"Hello, World!" program: |
|
+ |
|
|
+ |
"Hello, " |
|
+ |
PUSH: 72; |
|
+ |
PUSH: 101; |
|
+ |
PUSH: 108; |
|
+ |
PUSH: 108; |
|
+ |
PUSH: 111; |
|
+ |
PUSH: 44; |
|
+ |
PUSH: 32; |
|
+ |
|
|
+ |
"World!" |
|
+ |
PUSH: 87; |
|
+ |
PUSH: 111; |
|
+ |
PUSH: 114; |
|
+ |
PUSH: 108; |
|
+ |
PUSH: 100; |
|
+ |
PUSH: 33; |
|
+ |
PUSH: 10; |
|
+ |
|
|
+ |
EMPTY; |
|
+ |
|
|
+ |
Cat program: |
|
+ |
INPUT; |
|
+ |
EMPTY; |
|
+ |
|
|
+ |
99 Bottles of Beer: (it works!) |
|
+ |
https://pastebin.com/WdpYzSVx |