• Stars
    star
    1,111
  • Rank 41,566 (Top 0.9 %)
  • Language
    Python
  • License
    GNU Affero Genera...
  • Created over 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Esolang inspired by ASCII art

AsciiDots - Esoteric Language

The esolang inspired by ascii art

                   _ _ _____        _       
    /\            (_|_)  __ \      | |      
   /  \   ___  ___ _ _| |  | | ___ | |_ ___
  / /\ \ / __|/ __| | | |  | |/ _ \| __/ __|
 / ____ \\__ \ (__| | | |__| | (_) | |_\__ \
/_/    \_\___/\___|_|_|_____/ \___/ \__|___/

codebeat badge Join the chat at https://gitter.im/asciidots/Lobby

Featured on Hacker News, Motherboard (slashdot comments), and i-programmer.

AsciiDots is an esoteric programming language based on ascii art. In this language, dots, represented by periods (.), travel down ascii art paths and undergo operations.

AsciiDots being run in debug mode

Table of Contents

Samples

Hello world:

 .-$"Hello, World!"

Quine:

 ($'.-#40-$_a#-#36-$_a#-#39-$_a#)

Counter:

     /1#-.
     |
   /-+-$#\
   | |   |
  [+]<1#-*
   |     |
   \--<--/
      |
      0
      #
      |
      .

Semi-compact factorial calculator:

 /---------*--~-$#-&
 | /--;---\| [!]-\
 | *------++--*#1/
 | | /1#\ ||
[*]*{-}-*~<+*?#-.
 *-------+-</
 \-#0----/

Code-golfed counter (15 bytes) by @ddorn:

/.*$#-\
\{+}1#/

Installing

Note: asciidots is available online via Try it Online (tio.run) and the Interactive Demo (ajanse.me).

Using pip (recommended):

pip install asciidots

Using Docker Hub (recommended):

Run sample program from this repo:

docker run -ti --rm aaronduino/asciidots samples/hello_world.dots

Run local file test.dots:

docker run -ti --rm -v $PWD:/data aaronduino/asciidots /data/test.dots

Using Local Dockerfile:

Build the image:

docker build -t asciidots ./docker

Run sample program from this repo:

docker run -ti --rm asciidots samples/hello_world.dots

Run local file test.dots:

docker run -ti --rm -v $PWD:/data asciidots /data/test.dots

From source:

git clone https://github.com/aaronjanse/asciidots
pip install -r requirements.txt
# and only if on windows:
python -m pip install windows-curses

Run it from source using:

python __main__.py [arguments]

or alias it to asciidots using:

# on Ubuntu, replace `.bash_profile` with `.bashrc`
echo "alias asciidots='python $(pwd)/__main__.py'" >> ~/.bash_profile
source ~/.bash_profile

Using the Interpreter

The interpreter for this language is the __main__.py file. It can be run from the terminal using the python command. The first argument is the dots file that you wish the interpreter to run.

Here's an example of running the counter sample program (the working directory is the dots repo folder):

$ asciidots ./samples/counter.dots

Here is the list of available flags:

-t [ticks]        Run the program for a specified number of ticks (Default to 0: no limit)

-o [output-limit] Run the program for a specified number of outputs (Default to 0: no limit)

-s                Run without printing ANYTHING to the console. Useful for benchmarking

-d                Run the program in debug mode. It shows the program and highlights the dots with red. Press enter to step the program once.

Some extra flags when debugging:
-a [delay]        Step the program automatically, using the specified delay in seconds. Decimal numbers are permitted, and so is 0.

-w                Run the program without using ncurses. This can fix problems related to Windows.

-l [line-count]   When not in compatibility mode, reserve the specified number of the lines for displaying the program

This is how one might debug the program found at samples/counter.dots for 300 ticks, while running it automatically with a delay of 0.05 seconds per tick:

$ asciidots samples/counter.dots -t 300 -d -a 0.05

Program Syntax

The documentation has been moved to its own page

More Examples

Hello, World!

.-$"Hello, World!"


Test if two input values are equal:

       /-$"Equal"
       |
.-#?-*-~-$"Not equal"
     | |
     \[=]
       |
       ?
       #
       |
       .


Counter:
     /1#-.
     |
   /-+-$#\
   | |   |
  [+]<1#-*
   |     |
   \--<--/
      |
      0
      #
      |
      .


Fibonacci Sequence Calculator:
/--#$--\
|      |
>-*>{+}/
| \+-/
1  |
#  1
|  #
|  |
.  .


Find prime numbers:

%$T

        .
        |
        #
        3
        |
        @
        1
        |
/--*--*-<--\
|  |  |   /+----\
|  #  |   v+-0@-~-\
|  2  | /->~*{%}/ |
|  |  | 1  |\-+---/
|  |  | @  ^\ |
\-{+}-+-*  01 |
      | |  ## |
      | v--*+-/
      | |  ||
    /-* |  *+--\
    | T |  ||  |
    # $ # /~/  |
    0 # 1 */   |
    | | | |    |
    \->-+-~----<-#$-2#-.
        \-/


 /--------\
 T        |
 *--------~
 |        |
 \-*----@[=]
   |      |
   \--#1--/


And a game!

/-""$-.
|
\--$"Pick a number between 1 and 255 (inclusive)"\
/------------------------------------------------/
\--$"I will correctly guess that number after no more than 8 tries"\
/---------------------------------------------------------------""$/
\--$"After each of my guesses, respond with: "\
/---------------------------------------------/
\--$"     '2' if I guess too high,"\
/----------------------------------/
\--$"     '1' if I guess too low,"\
/---------------------------------/
\--$"  or '0' if I guess correctly"\
/----------------------------------/
|
|                             /->-\
|         /--------------\ /-[-]| |
#         |           /#1\-~--+[+]|
6         |          /*-{-}*  | | |
4  /2#\   |     /----~-----+--+-+-+-#7-$a_#-$"I won! Good game!"-&
|/{/}-*---*     *----/     |/-~-/ |
||    |/--+-----+------\   \+-/   |
\>----~#  #     \-?#-*-+----/     |
      |1  1  /$""-$#-/ |          |
      \/  |  ~---------*----------<-821#-.
          \--/

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

More Repositories

1

3mux

Terminal multiplexer inspired by i3
Go
1,824
star
2

dns-over-wikipedia

Redirect `.idk` domains using Wikipedia
Rust
1,525
star
3

dotfiles

My dotfiles as a Nix flake
Nix
54
star
4

nix-eval-lsp

Nix language server that evaluates code
Rust
54
star
5

marble-complete

Design a turing-complete marble run with ascii/unicode art
Python
53
star
6

gcat

Like `cat` but for gemini
Python
21
star
7

snippet-manager

The dead-simple snippet manager
CSS
15
star
8

bootstrapOS

[WIP] Bootstrap your own OS: from machine code to web server
HTML
10
star
9

serverless-chat

A serverless javascript chat client for LAN
JavaScript
8
star
10

jay

Journal from the command line with privacy & security
Go
5
star
11

stick-bug-ml

Framework for supervised machine learning systems
Jupyter Notebook
5
star
12

idea-bin

A private place to keep track of your ideas
JavaScript
4
star
13

better-ic-grade-viewer

A better grade viewer for Infinite Campus
Python
4
star
14

digitize

Submission for 2018-10 Digitize Hackathon
JavaScript
4
star
15

gsed

Minimalistic stream text editor written in Go
Go
3
star
16

gemini-language-support

VS Code extension to highlight text/gemini
3
star
17

pogo

My first project using JS: a pogo-stick game
CSS
3
star
18

paste-fixer

vscode extension to remove line numbers from pasted code.
JavaScript
3
star
19

asciidots-demo-backend

Backend for the AsciiDots online demo
Python
3
star
20

fhe-cpu

Fully Homomorphic CPU proof-of-concept
Go
3
star
21

ic-desktop

Desktop client for InfiniteCampus
JavaScript
2
star
22

vscode-nix-lsp

OBSOLETE
TypeScript
2
star
23

upe-lang

Tiny esolang created for Upsilon Pi Epsilon
Rust
2
star
24

floxpkgs

Nix
1
star
25

aaronjanse.github.io

HTML
1
star
26

upa-website

HTML
1
star
27

interlocking-braces

The esolang where code like {(}) is the norm
Python
1
star
28

generator-chisel-hdl

Yeoman generator for Chisel projects
Scala
1
star
29

rust-os

Rust
1
star
30

zbak

Easily create & replicate zfs snapshots
Rust
1
star
31

barcode

Generate our school id barcodes
HTML
1
star
32

2020

HTML
1
star
33

genetic-drift-simulator

An educational, online tool to simulate genetic drift
JavaScript
1
star
34

rpi-os

This does nothing useful so far
C
1
star
35

marble-complete-demo-backend

Backend to MarbleComplete demo
Python
1
star
36

simple-edit

Super simple markdown editor; fork of github.com/jbt/markdown-editor
JavaScript
1
star
37

samsung-gear-totp

Use your Samsung Gear as a 2nd factor
JavaScript
1
star
38

aarch64-to-flowchart

Visualize branching in decompiled aarch64 code
Python
1
star