a terrible forth-like language for making memes https://szy.io/memeforth
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

7.2KB

FORTH words implemented in Memeforth.

Examples show the Memeforth code and the resulting stack.

Comparison/Logic Operators

All of these push either true or false onto the stack as their result.

  • == Equals
  • != Not-equals
  • > Greater than
  • < Less than
  • >= Greater than or equal
  • <= Less than or equal
  • TRUE Literal true
  • FALSE Literal false
  • NOT Boolean NOT
  • AND Boolean AND
  • OR Boolean OR

Flow Control

  • DO Performs looping based on a start and end value.

    Example: 10 0 DO I . LOOP outputs 0 1 2 3 4 5 6 7 8 9

  • I Used to access the current loop index value.

  • IF Performs based on the top value on the stack.

    Example: IF YEET ELSE NOYEET THEN will result in “YEET” being on the stack if the top stack value is true before the IF, and NOYEET otherwise.

  • : Defines a new word.

    Example: : DNSYEET yeet DNS ; compiles to a word DNSYEET that becomes DNS over yeet on the stack.

I/O Operations

NOTE: See JS docs for how output is handled and how to access it. It is not printed to the console!

  • TYPE Print the top item of the stack to output. Discards the top stack element.
  • . Synonym for TYPE.
  • .s Print the contents of the stack to output. Does not affect the stack.

Literals

  • Integers are automatically pushed onto the stack.

  • s" Starts defining a literal string and pushes it to the stack.

    Example: s" my string here""my string here"

    Note: The space after s" is necessary. Extra spaces will become leading spaces on the defined string.

  • BLANK Push an empty string to the stack.

  • SPACE Push a single space character to the stack.

  • \n Push a single newline character to the stack.

  • ( Starts a comment until a closing )

    Not sure why this is in literals, but there's nowhere else that it really fits, so who cares.

Math Operators

  • + Add the top two elements of the stack.

  • +! Add directly to a memory variable. For instance, if the variable X is 5: 3 X +! will result in X becoming 8 in memory.

    Example: 1 2 +3

  • - Subtract the top two elements of the stack.

    Example: 2 1 -1

  • * Multiply the top two numbers on the stack.

    Example: 2 2 *4

    Alternatively, can be used to multiply strings. For instance:

    test 3 *testtesttest

  • /MOD Perform division and modulus and place the results on the stack.

    Example: 10 3 /MOD1 3

  • / Divide the top two numbers on the stack, returning the integer quotient.

    Example: 7 2 /3

  • MOD Perform the modulus operation on the top two numbers on the stack.

    Example: 7 2 MOD => 1

  • RAND Generate a random integer between a min and a max.

    Example: 1 10 RAND => a random number between 1 and 10.

M E M E S

This is what you're really here for.

  • AAS Generates an “as a service” meme.

    Example: Yeet AAS"YaaS (Yeet as a Service)"

  • BIT Generates an “as a bit” meme.

    Example: s" yeeting" BIT"yeeting, as a bit"

  • B_EMOJI Pushes “🅱️” to the stack.

  • BMOJI Replaces the first letter of a string with 🅱️.

  • CLAP_EMOJI Pushes “👏” to the stack.

  • CLAP Converts a string into clapping👏text👏like👏this👏.

  • COOLKIDS yeet COOLKIDS"all the cool kids are getting into yeet"

  • DNS Generates a “DNS over” meme.

    Example: s" carrier pigeon" DNS"DNS over carrier pigeon

  • DRAKE Generate a Drake like/dislike meme with Mastodon :drake_like: and :drake_dislike: emotes.

  • FUCKING Pushes the text fuckign to the stack.

  • GOTEM Pushes the text lmao gottem to the stack.

  • HACKER Generates Mastodon Hacker Text emotes from a string.

    Example: s" yeet" HACKER":hacker_y: :hacker_e: :hacker_e: :hacker_t:"

  • HARDWORK Generate a “Just another hard day's work” meme.

    Example: s" meme" HARDWORK"Just another hard day's work at the 'meme' factory."

  • JORTS Generates a “jorts” meme.

    Example: s" yeet" JORTS"jeet (jean yeet)"

  • MORELIKELY Generate a “It's more likely than you think” meme.

    Example: s" Memes" s" FORTH" MORELIKELY"Memes? In my FORTH? It's more likely than you think"

  • OKGOOG Generates an “OK Google” meme.

    Example: s" run Memeforth" OKGOOG"OK Google, run Memeforth"

  • OWNING Generates an “owning the...” meme.

    Example: boomers weed smartphones OWNING"owning the boomers with weed and smartphones"

  • SUREHOPE Generate a “Sure hope it does” meme.

    Example: s" Markdown"Markdown? I sure hope it does!"

  • SM64 Generates Mastodon SM64 Text emotes from a string.

    Example: s" yeet" SM64":sm64_y: :sm64_e: :sm64_e: :sm64_t:"

  • XORTS Generates an arbitrary “jorts” meme with root and subject.

    Example: s" blob" s" cat" XORTS"bat (blob cat)"

Memory Operations

Keywords that operate on the program's memory array.

  • ! Stores a stack element into memory.

    Example: s" mystring" 42 ! ⇒ Stores "mystring" at address 42 in memory.

  • @ Fetches a memory location and puts it on the stack.

    Example: 42 @ given that memory location 42 = "test" will result in "test" being on the stack.

  • DEFVAR Defines variables.

    Example: DEFVAR MYVAR creates a variable called MYVAR that is a word that resolves to the memory location where MYVAR is stored.

  • DEFARR Defines arrays.

    Example: DEFARR MYARR 10 creates a variable called MYARR that resolves to a pointer to the start of the array, which is of length 10.

Stack Manipulation

  • DUP Duplicates the top element of the stack.

    Example: 1 DUP1 1

  • 2DUP Duplicates the top pair of elements on the stack.

    Example: 1 2 2DUP1 2 1 2

  • DROP Drops the top element from the stack.

    Example: 1 2 DROP1

  • 2DROP Drops the top two elements from the stack.

    Example: 1 2 3 2DROP1

  • OVER Copies the second element over the first.

    Example: 1 2 OVER1 2 1

  • SWAP Swaps the top two elements of the stack.

    Example: 1 2 SWAP2 1

  • ROT Rotates the stack.

    Example: 1 2 3 ROT2 3 1

  • -ROT Rotates the stack the other way.

    Example: 1 2 3 -ROT3 1 2

String operations

  • CONCAT Concatenates the top two strings on the stack.

    Example: s" string1" s" string2" CONCAT"string1string2"

  • LEN Replaces the top string on the stack with its length.

    Example: s" stringy" LEN7

  • SLICE Slices a string.

    Example: yeet 1 3 SLICE => ee.

  • SPLIT Splits a string into individual stack elements based on a delimiter. It also pushes the number of split elements to the stack for later rejoining.

    Example: s" split-me-up" s" -" SPLIT => split me up 4 (Each a separate word on the stack).

  • JOIN Joins multiple stack elements into a single string.

    Example: join me up 3 s" " JOIN => "join me up" (As a single string on the stack)

  • ISUPPER Test if the top string on the stack is entirely uppercase.

  • ISLOWER Test if the top string on the stack is entirely lowercase.

  • TOUPPER Convert the top string on the stack to uppercase.

  • TOLOWER Convert the top string on the stack to lowercase.