Pieces

From Esolang
Jump to: navigation, search

Pieces is an esoteric language with the same set of commands as brainfuck created by poiuy_qwert. The difference is each command is a puzzle piece. Adding up all the indents and outdents in the puzzle pieces determines which brainfuck command is used.

Commands

1-4       >
5-6       <
7-8       +
9-10      -
11-12     .
13-14     ,
15-16     [
17-20     ]

To calculate the numbers, you add up the indents and outdents of the piece. The left side of the piece is worth 1 per indent/outdent, the top is worth 2, right is 3, and bottom is 4. For example:

###        ##
 ##  and  ###  = 1
###        ##

# #        #
###  and  ### = 2
###       ###
                                #         #
###       ##        # #        ###       ###        # #
##   and  ###  and   ##  and  ####  and   ##  and  #### = 3
###       ##        ###        ###       ###        ###

...

  #
 ## #
  ####  == 20
####
 # ##
   #


Programs

The first piece in a program is found by scanning left to right, top to bottom, first piece found is the start of the program. The next piece has the be attached to the last piece by at least one indent/outdent on any side of the piece. No pieces can be attached to more then two pieces; the one flow came from and where its going.

Hello, World!

This is a direct conversion from the "Hello, World!" program on the brainfuck page

                                                                    #      #                                                             #                        #   +                                                +                     #      #                                                                            +                              #
###+++# #+++# #+++# #+++# #+++####+++###+ +###+ +###+ +###+ +###+ +## #+ +## #++###+ +###+ +###+ +###++++###+++# #+++# #+++# #++ +# #+++## #+++###+ +###+ +###+ +## #++ +###+ +###++ +###++###+++# #+++# #+++# #+++# #++ +# #+++# #+++# #+ +## #+ +## #+++##+++###+ +###+ +###+ +###+ +###+++####+++###+ +###+ +###+ +###+ +## #++ +# #+ +## #++ +####+++# #+ +## #+ +## #++ +## #++ +## #++++## #++ +## #++ +## #++ +## #++ +## #+++##+++####
####+++###+++###+++###+++###+++####+++###+++###+++###+++###+++##++++###+++####+++###+++###+++###+++###++++###+++###+++###++####+++###++++###++++###+++###+++###+++####++++###+++###++++##+++###+++###+++###+++###+++###++++##++####++####++####++++#####++###+++###+++###+++###+++###+++###+++####+++###+++###+++###+++###+++####+++###++++####++++####++###+++####++++####++++####++++####++++####++++####++++####++++####++++####++###+++####
###++####++####++####++####++####++++##++++##++++##++++##++++##+++####+++####+++##++++##++++##++++##++++####++####++####++###++++###++++###++++##++++##++++##++++####++++##++++##+++++##+++###++####++####++####++####++++####+++###+++###+++###++++###++###+++##++++##++++##++++##++++##+++####++++##++++##++++##++++##++++###++++###+++####++++####+++###+++####+++####++++####++++####++++####++++####++++####++++####++++#####++###++####
###+++###+++###+++###+++###+++# ##+++###+++###+++###+++###+++###+++# ##+++# ##++###+++###+++###+++###+ ++###+++###+++###+++###+ ++###+ +# ##+ +###+++###+++###+++# ##+ ++###+++###+ ++###++###+++###+++###+++###+++###+ ++###+++###+++###+++# ##+++# ##+++##+++###+++###+++###+++###+++###+++# ##+++###+++###+++###+++###+++####+ ++###+++####++++## #+++###+++# ##+++####++++####++++####+ ++####++++####++++####++++####++++# ##+++##+++# ##
                                #                                     #                                +                         +                                                                                      +                      #                                               #                                  +
 3  7  7  7  7  7  7  7  7  7  16  5  7  7  7  7  7  7  7  7  4  9  17  6  12 4  7  7  7  7  7  7  7  16  5  7  7  7  7  4  9  17  6  8  12  8  7  7  7  7  7  7  12  12  7  7  7  11  4 4  4  7  7  7  7  7  7  7  7  16  6  7  7  7  7  9  17  6  12  4 4  4  7  7  7  7  7  7  7  7  7  7  16  7  7  7  7  7  7  7  7  7   9  17  6  9  10  10  12  5  6  6  12  9  10  10  10  10  10  12  10  10  10  10  10  10  10  10  11  4 4  7  12

The numbers above are the values of each piece.