MikuLang

From Esolang
Jump to navigation Jump to search

This language was only made because there wasn’t any vocaloid themed esolangs! Im the first one to do it!!! Yeah! Yeah! Yeah! Yeah! Yeah! Yeah!

IMPORTANT THING

This programming language uses the names of Vocaloid characters as commands. This “programming language” uses an accumulator.

ANOTHER THING

I added this part for no reason! (^_^)

Commands

  • “Miku”-Increments accumulator a set amount based on the user. Ex) Miku 10 increments accumulator 10 times
  • “Teto”-Decrements accumulator a set amount based on the user. Ex) Teto 10 decrements accumulator 10 times
  • “Neru”-Outputs accumulator as number.
  • “Gumi”-Outputs accumulator as ascii character.
  • ”Adachi Rei”-Sets accumulator to 0.
  • ”Luka”-Outputs new line.
  • ”Kaito”-Requests input from user and puts it in accumulator.
  • ”Zundamon”-Halts program.

Examples

Hello, World!

Miku 72
Gumi
Adachi Rei
Miku 101
Gumi
Adachi Rei
Miku 108
Gumi
Gumi
Adachi Rei 
Miku 111
Gumi
Adachi Rei
Miku 44
Gumi
Adachi Rei
Miku 32
Gumi
Adachi Rei
Miku 87
Gumi
Adachi Rei
Miku 111
Gumi
Adachi Rei
Miku 114
Gumi
Adachi Rei
Miku 108
Gumi
Adachi Rei
Miku 100
Gumi
Adachi Rei
Miku 33
Gumi
Zundamon

Cat Program

Kaito
Gumi

Errors

When a invalid command appears, World is mine should play at 60 decibels and will only stop until you fix the program.

Interpreters

Micropython Interpreter

program = """
#insert code here
"""
# The Interpreter Logic
def interpret_miku(code):
   acc = 0
   # Process each line of the provided source
   for line in code.split('\n'):
       line = line.strip()
       if not line:
           continue
           
       # Adachi Rei: Clear the accumulator
       if line == "Adachi Rei":
           acc = 0
       # Neru: Output accumulator as a number
       elif line == "Neru":
           print(acc, end="")
       # Gumi: Output accumulator as an ASCII character
       elif line == "Gumi":
           print(chr(acc), end="")
       # Luka: Print a new line
       elif line == "Luka":
           print()
       # Kaito: Receive numeric input
       elif line == "Kaito":
           try:
               acc = int(input("Enter Number: "))
           except:
               acc = 0
       # Zundamon: Halt the program
       elif line == "Zundamon":
           return
       
       # Handle commands with values (Miku, Teto)
       else:
           parts = line.split()
           if len(parts) >= 2:
               cmd = parts[0]
               try:
                   val = int(parts[1])
                   if cmd == "Miku":
                       acc += val
                   elif cmd == "Teto":
                       acc -= val
               except:
                   pass
# Calling the defined function at the end
interpret_miku(program)