DOBELA

From Esolang
Jump to: navigation, search

DOBELA: DOt-Based Esoteric LAnguage. This is a language made by User:asiekierka in 2008.

Idea and Pronouncing

Idea came up one day on #esoteric. I thought about a language having dots, walls and I/O. Then we all extended it. DOBELA is now quite surely (on #esoteric) 99% TC (due to the command set), but we're not sure about the remaining 1%.

You pronounce it like "do-BEE-lah" where BEE is pronounced like the english "Bee", and "do" is pronounced like the "do" in "don't".

Overview

DOBELA is based on binary dots and commands, all placed on a two-dimensional grid. Dots travel on the grid, whereas commands stay still. Most commands are interacted with solely by having dots collide with them.

Additional storage is provided in the form of the global FIFO, a queue.

Specification

This is version v13 of the specification.

Commands

Command Description
, A Zero dot.
. A One dot.
# A wall. Dots turn on contact: Zeroes turn 90 degrees clockwise, Ones turn 90 degrees counter-clockwise.
| By default, if struck from the east or west, behaves like a #. If struck from the south or north, it changes modes: if the last north/south collision was from the south, dots colliding from the east or west turn north, and vice versa. The dots that collide from the south or north are destroyed.
= On contact, a Zero dot becomes a One dot, and vice versa. The flipped dot jumps over the =. For example, .= turns into =, (if the One was moving east).
: A generator. If its emission setting is enabled, emits a dot according to its setting east every other cycle.

If struck from the north, its emission setting is toggled. If struck from the south, its dot type is toggled: Zeroes to Ones and vice versa.

By default, the emission setting is enabled and it outputs Ones.

Colliding dots are destroyed.

+ A fork instruction: any colliding dot is duplicated at the sides perpendicular to its delta, and is then destroyed. The forked dots' deltas are equal to the direction they were created relative to the fork.

For example:

######                                   ######
#    #  On the next cycle this will be:  #  . #  With the dot to the north moving north
# .+ #                                   #  + #   and the dot to the south moving south.
#    #                                   #  . #
######                                   ######
_ Provides access to the standard input stream (stdin). Each incoming octet (or whatever unit the OS deals with) is transformed into binary, and corresponding Zero and One dots are emitted south, least significant bit first.

If there is a single _ in the program, it emits a dot every two cycles, starting from the first. If there is more than one, a dot is emitted every cycle, but only one _ emits one. The northwesternmost _ emits a dot on the first cycle; on the second cycle, the next one (first columnwise, then linewise); and so on, until the last _ has emitted a dot. On the following cycle, the northwesternmost _ is the one to emit again.

Any colliding dots are destroyed.

$ Colliding dots have their bit value (Zero or One) enqueued into the global FIFO and are destroyed.
^ Behaves differently depending on which direction it is struck from:
West  
All generators have their emission setting toggled.
East  
All generators have their dot type toggled.
North 
The global FIFO is emptied.
South 
The global FIFO is output to the standard output stream (in FIFO order) and then cleared.

Output is done at the binary level, like input. The bits in the FIFO are collected into OS-level units (most likely octets) and output as such. If there are not enough bits to fill a unit, the remaining space is zero-filled with the bits in the FIFO taking up the least significant bits. For instance, if $ was struck with first a Zero and then two Ones, the octet 00000110 is output.

Colliding dots are destroyed.

v Behaves differently depending on which direction it is struck from:
West  
A dot is dequeued from the FIFO and emitted to the east.
East  
A dot is dequeued from the FIFO and emitted to the west.
North 
A dot is dequeued from the FIFO and emitted to the south.
South 
A dot is dequeued from the FIFO and discarded.

Colliding dots are destroyed.

Rules

Conceptually, every dot moves simultaneously in a cycle. After the dots have moved, collisions are handled and commands are executed in order, from the northwesternmost to the next, first columnwise and then linewise.

Dot-dot collision rules (using arrows, <>^v, to show the direction dots are moving in):

  • If two dots of different types moving in opposite directions collide, they are both destroyed.
  • If two dots of the same type moving in opposite directions collide such that they enter the same space, they are destroyed and a wall is created in that space. For example:
##########                                   ##########
#>. .< vv#                                   #  #     #
#>, ,< ,.#                                   #  #     #
#        #  On the next cycle this will be:  #      ###
#      ,.#                                   #        #
#      ^^#                                   #        #
##########                                   ##########
  • If a Zero and a Zero moving in opposite directions collide such that they pass over each other, they are destroyed and a wall is created where the northwesternmost dot was. For example:
########                                   ########
#>,,< v#                                   # #    #
#     ,#                                   #     ##
#     ,#  On the next cycle this will be:  #      #
#     ^#                                   #      #
########                                   ########
  • If a One and a One moving in opposite directions collide such that they pass over each other, they are destroyed and a wall is created where the southeasternmost dot was. For example:
########                                   ########
#>..< v#                                   #  #   #
#     .#                                   #      #
#     .#  On the next cycle this will be:  #     ##
#     ^#                                   #      #
########                                   ########
  • If two dots that are not moving in opposite directions collide, the southeasternmost dot is blocked from moving, but neither is destroyed. For example:
########                                   ########
#>.   v#                                   # >.   #
#  ,  ,#                                   #  ,  v#
#  ^>. #  On the next cycle this will be:  #  ^>.,#
#      #                                   #      #
########                                   ########
  • If a dot moves onto a dot which then finds that it cannot move that cycle, both dots are destroyed and a wall is put in their place. For example:
########                                   ########
#      #                                   #      #
# >,.# #                                   #   ## #
# >..# #  On the next cycle this will be:  #   ## #
#      #                                   #      #
########                                   ########

Multiple dot collisions are resolved starting from the northwesternmost, as described previously.

Miscellaneous rules that don't pertain to any command in particular:

  • Dots, by default, move one space to the east.
  • If dots venture outside the bounds of the initial source file, they are destroyed.
  • The program ends when there are no more dots moving and no more dots will be emitted from any _, i.e. standard input has reached EOF.
  • A proper DOBELA program must have at least two lines and one column.
  • Non-command characters in the initial source file are ignored: they do not exist, as far as the program is concerned.
  • If a dot would be created on top of a # or |, it is destroyed instead. There is one exception to this: for =, the dot instead reverses direction and ends up on the other side of the =. For instance, .=# with the One moving east turns into ,=#, with the Zero now moving west.

History

21st October 2008 
DOBELA docs v1-v9 created, wiki entry published.
22nd October 2008 
DOBELA docs v10-v11 created.
7th March 2009 
DOBELA spec v11b released, thanks to akiross's interest in DOBELA.
21st March 2009 
Specification version v12 released by User:Deewiant, thanks to many clarifications from User:asiekierka. See the logs of #esoteric on 2009-03-20 for the discussion which prompted this.
9th April 2009 
Specification version v13 (added +!) released by User:Deewiant due to more clarifications: see discussion at #esoteric on 2009-04-05.

Examples

Hello!

,,,,.,.,,,.,,,,.,..,....,..,..,,,..,..,,,..,,.,.,.,,.,,,$^
.                                                         #
  

This outputs just "Hello!" and a line feed.

More complicated version, same output:

                                                                  # #+            #
  #                                                                         #
                                                                          #  ^
,,,,.,.,,,.,,,,.,..,....,..,..,,,..,..,,,..,,.,.,.,,.,,,$              #    ^
$
:v                                                                      #
   ,                                                                #
 #                                                          = = == +     #
 $                                                                       #
                                                                       #   #
                                                                 #          #
                                                                        #        #

Cat

These cat programs don't actually work since they never flush output using ^. They do, however, collect the input into the queue in the correct order.

  (|, x and - show the path, 0 shows the way 0 goes, and 1 shows the way 1 goes.)
   
       _   $ Ones end up here.
       |   |
  #x--0-1--x#
   |   #
   $ Zeros end up here.

Uncommented:

         $
      _
  #       #
      #
   $

Short version:

  _
  
  $

Implementations

dobelx64, interpreter written in x86-64 asm. Source and ELF binary available.