Help, WarDoq!

From Esolang
Jump to navigation Jump to search

Help, WarDoq! is an esoteric programming language created by Programming Puzzles & Code Golf user Dennis.

It was designed to address the plentiful shortcomings of Hello et al., which makes them unusable for code golf competitions.

While not Turing complete, Help, WarDoq! is capable of performing basic mathematical operations such as addition and primality testing.

Language Overview

Help, WarDoq! has 23 basic commands:

Command Description
H Print Hello, World!.
h Print Hello, World.
E Print Hello, world!.
e Print Hello, world.
L Print Hello World!.
l Print Hello World.
O Print Hello world!.
o Print Hello world.
W Print hello, World!.
w Print hello, World.
R Print hello, world!.
r Print hello, world.
D Print hello World!.
d Print hello World.
, Print hello world!.
! Print hello world.
A Read two whitespace separated integers from input. Output their sum.
a Read two whitespace separated integers from input. Output their binary sum without carry (XOR).
P Read a whitespace separated integer from input. Output 1 if it is a positive prime and 0 otherwise.
p Read a whitespace separated integer from input. Output 1 if it is a positive or negative prime and 0 otherwise.
Q Print the program's source code.
q Print the program's reversed source code.
(space) Begin a comment. The next non-space character ends the comment and is interpreted as usual.

All other characters are ignored.

The source code is executed character by character. The outputs of all individual commands are separated by single linefeeds.

Implementation

The following in a reference implementation in CJam, to be used with the official Java interpreter:

ea0=:Q{"HhEeLlOoWwRrDd,!AaPpQq"Q|["Hh""ello"a[',L]Sa"Ww""orld"a['!L]]:m*:`[{riri+}{riri^}{rimp}{rizmp}Q`QW%`L]+er:~N*}:H~

It reads the program's source code as a single command-line argument and the program's input from STDIN.

Due to technical limitations, this online interpreter reads the source code from the first line and the input from the subsequent lines.