We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

If a==1:

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

If a==1: is esoteric programming language, where program ends correctly, if accumulator==1, but if accumulator!=1, program outputs f"ERR: {a}".

Commands

command description
+ inc
- dec
. out

Dont confuse commands with BittyLang

Interpreter in python

a=0
for c in input():
    if c==".":
        print(a)
    if c=="+":
        a+=1
    if c=="-":
        a-=1
if a==1:
    break
if a!=1
    print("ERR:", a)
    break

Stretching the rules a bit, you could interpret the output as ASCII, in which a Hello World program is possible.

Examples

XKCD Random Number

++++.

XKCD Random Number without ERR

++++.---

Hello world program without ERR (line breaks added for readability, they are NOP.)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
+++++++++++++++++++++++++++++.
+++++++.
.
+++.
-------------------------------------------------------------------.
------------.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
--------.
+++.
------.
--------.
-------------------------------------------------------------------.
--------------------------------