Semiconkéfalos

From Esolang
Jump to navigation Jump to search

Semiconkéfalos is a portmanteau of "semicolon" and "enkéfalos" (brain). It is a variant of brainfuck created by User:TheCanon2, but the only valid symbols are the semicolon and Greek question mark.

Commands

Command Unicode values Brainfuck equivalent
;;; U+003B U+003B U+003B >
;;; U+003B U+003B U+037E <
;;; U+003B U+037E U+003B +
;;; U+003B U+037E U+037E -
;;; U+037E U+003B U+003B .
;;; U+037E U+003B U+037E ,
;;; U+037E U+037E U+003B [
;;; U+037E U+037E U+037E ]

These commands behave exactly the same way as their brainfuck counterparts.

The only computational difference is that Semicónkefalos handles text in UTF-8. The only purpose of this was to allow for quines.

Examples

Hello, World!

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;

Cat

;;;;;;;;;;;;;;;

Implementations

The following is a Python script for converting brainfuck to Semiconkéfalos.

brainfuck = input('>prgm ')
semico = [""]
def text(bits):   # Reduces the amount of lines used #
    for c in range(0, 3):
        if bits[c] == "0":
            semico.append(chr(59))
        else: semico.append(chr(894))
for i in range(0, len(brainfuck)):   # Converts #
    if brainfuck[i] == "<":
        text("000")
    elif brainfuck[i] == ">":
        text("001")
    elif brainfuck[i] == "+":
        text("010")
    elif brainfuck[i] == "-":
        text("011")
    elif brainfuck[i] == ".":
        text("100")
    elif brainfuck[i] == ",":
        text("101")
    elif brainfuck[i] == "[":
        text("110")
    elif brainfuck[i] == "]":
        text("111")
    else:
        print("Invalid syntax.")
        break
semico = ''.join(semico)
print(semico)

The following program converts Semiconkéfalos to brainfuck.

replacements = {
    "\u003B\u003B\u003B": ">",
    "\u003B\u003B\u037E": "<",
    "\u003B\u037E\u003B": "+",
    "\u003B\u037E\u037E": "-",
    "\u037E\u003B\u003B": ".",
    "\u037E\u003B\u037E": ",",
    "\u037E\u037E\u003B": "[",
    "\u037E\u037E\u037E": "]"
}

program = input("Enter program: ")
for semiconkefalos, brainfuck in replacements.items():
    program = program.replace(semiconkefalos, brainfuck)

print(program)