Skip to main content
2 of 10
added 47 characters in body
M L
  • 3.3k
  • 1
  • 19
  • 19

beeswax, 17 bytes

Non-competing answer, beeswax is from 2015.

beeswax is a new 2D esolang on a hexagonal grid. It is inspired by bees, honeycombs and by the Hive board game (which uses hexagonal gaming pieces). beeswax programs are able to modify their own code. Thanks to this ability it is not too hard to create a quine. But the program does not read its own source code, as my explanation shows.

The first beeswax quine in existence:

_4~++~+.@1~0@D@1J

Or equivalently:

*4~++~+.@1~0@D@1J

IPs are called bees, the program area is called honeycomb. Every bee owns a local stack called lstack, carrying 3 unsigned 64 bit integer values.

Explanation:

                                             lstack
                                     • marks top of stack

* or _  create bee(same result in this situation)[0,0,0]•
 4      1st lstack value=4                       [0,0,4]•
  ~        flip 1st/2nd lstack values            [0,4,0]•
   ++      1st=1st+2nd, twice                    [0,4,8]•
     ~                                           [0,8,4]•
      +                                          [0,8,12]•
       .         1st=1st*2nd                     [0,8,96]•
        @  flip 1st/3rd lstack values            [96,8,0]• 
         1     1st=1                             [96,8,1]•
          ~                                      [96,1,8]•
           0   1st=0                             [96,1,0]•
            @                                    [0,1,96]•
             D drop 1st at row=2nd,col.=3rd val. [0,1,96]•
       This drops ASCII(96)= ` beyond the left border.

Dropping a value at a coordinate outside the program—in this case at column 0—grows the honeycomb by 1 column to the left. The coordinate system gets reset, so this column becomes the new column 1. So, growing the honeycomb in ‘negative’ direction is only possible in steps of 1. The grown honeycomb is always a rectangle encompassing all code.

This modifies the program to:

`*4~++~+.@1~0@D@1J

continuing...

               @                                  [96,1,0]•
                1                                 [96,1,1]•
                 J jump to row=1st,column=2nd val.[96,1,1]•
`                  switch to character output mode.
 *4~++~+.@1~0@D@1J    the following characters are printed to STDOUT.

GitHub repository of the Julia package of the beeswax interpreter.

M L
  • 3.3k
  • 1
  • 19
  • 19