ImTooLazyToMakeAnActuallyGoodEsolang

From Esolang
Jump to navigation Jump to search

ImTooLazyToMakeAnActuallyGoodEsolang or Laziness is an esolang but the creator, User:Evylah got lazy to make a half-decent language. It is not Turing-complete and is output only. One possible use case could be to send messages to other people (even though they'd be very long).

Overview

This language is pretty useless unless you want to output text. It is made up of one queue, which can hold values either 1 or 0. The current bit (which gets flipped with -) is also stored. The current bit is initialized to 0, and the queue is initially empty.

Commands

Opcode Description
- Flips the current bit
. Adds the current bit to the output queue
, Read the entire queue as a binary number and output it as a character. (Pop every value and add it to a temporary string, then convert that string from binary to Unicode and print it.)

Every other character is ignored and can be used as a comment.

Examples

XKCD Random Number

The Unicode character for "4" in binary is 1100002.

-..-....,

Pushes 1, 1, 0, 0, 0 and 0, in that order. Then it outputs 1100002 or "4"

Hello!

Not Hello, World! because I'm too lazy to write a program or make a generator.

-.-..-.-...,  H
-..-..-.-.-., e
..-.-..-..,   l
-..-.-..-..,  l
-..-.-....,   o
.-....-.,     !

Computational class

Laziness is obviously not Turing-complete. Since I'm not smart, some of these other classes could be inaccurate.

  • Laziness is a Push-down automaton, because it uses a single stack (although not very useful)
  • Laziness always halts.

Interpreters

Python

def laziness(code: str) -> None:
    bit = 0
    queue = "" # xd

    for char in code:
        if char == "-": bit = ~bit
        elif char == ".": queue += str(abs(bit))
        elif char == ",": print(chr(int(queue, 2)), end=""); queue = ""

laziness(input())