TwimpLanguage is another EsotericProgrammingLanguage. ---- == TWIMP document == * All commands are converted to uppercase before being executed * Forced constants (c) are always in Roman * Command (x) you can put another command * Stacks (s) are stacks that can have only 3 kinds of values inside: program-line-references, stack-haf-references, and duck-sos. * You never need to use the shift key to write a program. * Execute-counter is increased by 1 every line of program (even if it does nothing) * ABREV c x = Runs before the programs runs. It does for all .. 1 to c will change .. in x to that number and insert those commands in that order in the program * RET s = Go to the program-line referenced by the top of the stack (does not remove items from the stack) * PUSHL s = Push this line onto the stack * PUSHLN s = Push the line after this line onto the stack * OUT n = Output 1 byte (8 bits) * POP s n = Pop n elements from s and discard them * MOVE s s = Move 1 top element from first stack onto top of second stack * COPY s n = Pop top element of the stack and push it n times. POP s 1 does the same things as COPY s 0. * STOP = Stop the program * ON s = Turn on the line of top element of stack * OF s = Turn off the line of top element of stack. Lines is of is - at the beginning stop from execute (except ABREV and STEP) * SWAP s = Swap this line with line indicated by top of stack * NEW s = Make a new stack, blank * MAKE s = Push this line onto stack if stack is empty * FORGET = Reset execute-counter to zero * DIVIDE n = Set divider to number (default 10) * STEP c = Increase execute-counter by number * \ z = Any text. Put on stderr * DUCK s = Push duck-sos onto top of stack * REF s = Push 2 haf-references to the stack on top of itself * PULL s = Pop 2 haf-references off the stack, and move the top element of the reference stack onto this stack * LINE z = Push this text made of any characters onto the waiting line * DRINK n = Makes the program drunk * NO = Does nothing Expressions: * n = Any number (positive or negative) * [] = Take 1 nibble (4 bits) from input * [n-n] = Subtract * [n=n] = Binary numbers AND * [\] = Take first character off of waiting line and insert into equation * [n] = Look at top element of stack. If is empty stack or pointer to line is on, or to haf-reference it will be 1, if is line is of, it will be 2, if the top of the stack is duck-sos, the whole equation will be replaced with zero. * [=] = The execute-counter divided by the divider rounded down * [======] = How many equal signs you put after the first, will multiply by 2^number. Example: [==] change into [[=]--[=]] and [=====] change into [[====]--[====]] which will do again, again until stop ---- I also want to add a KNOT command to tie knots in the stack and in the program. Can you tell me how exactly would that work, please? ''(Please type more in here)'' I want you to make a new manual, something like the INTERCAL manual. I am no good at making manuals. Look at source-code and make manual. ''I've tried to correct spelling on this page, probably with less than 100% success. For example, what are "duck-sos" and "haf-reference"?'' (You will have to look at the source-code to figure that out. The document I wrote is not very clear.) But it still isn't a full manual yet. Now I added more commands and more stuff, you download it and look, and write a manual like INTERCAL manual. Please, I need more suggestions! (PleaseComment) I added more commands now, now you need to make some useful programs using this! ---- See also: http://zzo38computer.cjb.net/esoteric/twimp/ for downloads ---- CategoryProgrammingLanguage