Dot's

From Esolang
Jump to navigation Jump to search

introduction

dot's is or dots is a codeing language I kyle/Ilikecreepers (talk) made that is heavily inspiered by asciidots but I desinged it so that it be faster and more functional than the orignal asciidots however in order to do this I did have to sacrifice some elements of the orignal asciidots but I feel like what I added in place of thoese elements is far more better once you wrap you head around the working of stuff like [+] once again.

Also because dot's is based of asciidots I recommend you have a look at that page first because it is far better at explaining the simple stuff than I am and sorry about that as well.

Last but not least this codeing is faster but it dose not like endless loops that much so if you do have endless loops expect a bit of performance hit and this also dose support strings, floats, bools and ints and it will auto identify which of these you are useing when storing or useing data.

download

latest version of dot's

latest version of dot's highlighter (for notepad++)

oparations guide

The operations as I like to call them are the stuff that react with the dots and these reactions can build up into a full program

basics

  • The '' operation is used to line comment.
  • The .• operations is used to create dot entities(AKA the things that actually react with the operations) before everything starts to run and it can also be used as path. if there is no path next to the dot entity when it has been created the dot entity will will be destroyed before logic starts to run.
  • The # operation can be used to store stuff to a dots memory note like this: .-#nil#-#reset# oh and if you type nil it will delete the memory and reset will delete memory stored in operations like [000] or ~ or }{ and the dot will also be deleted if the operation isn't one of }{.
  • The ? operation can be used to request a input from the user and this input will then be saved to the dots data.
  • The $ can be use to print stuff to the console like this: .-?-$hello-world$--$hello world$--$I-hate #$ oh and # in a print command should print the dots data.
  • The -|+.• operations can and are used as paths for the dot to move along however the line paths only support the direction thay go along.
  • The <^v> operations are use the make the dot move in the direction thay point and thay work at all times with all incoming directions.
  • The /\ operations reflect the dot like a laser pointing to a mirror at a 45 or 315 degrees angle.
  • The & operation ends the program also the program will end if there are no more dot entities left.
  • If your useing $#() operations you can type ` to make sure the system reads the next letter along as non editable text only and with that you can do things like:
.->-$I-made-`$40$--v '' it will print "I made $40" oh and this will have abnormal effect of spaces vertically oh and the system wont read 
  ^----------------< '' the ` part

control flow

  • If a dot enters a ~ from under it and that dot has some amount of data and that data dosent equal false then the next dot to come along after will move upwards.
  • The : operation makes any dot that moves over it go up if that dot has data that dosent equal false if not the dot will continue onwards.
  • The ! operation can be used to invert control flow requirments.

the complcated stuff

  • The * operation duplcates the dots for all directions that has a -| path next to the operation and as long as the duplcated dots direction is not the inverse of our main dots direction.
  • The = operation will freeze all dots apart from the one that past over it and the dots will remain frozen untill the unfrozen dot passes over it again and btw and the $#() operations secretly call this.
  • The }{ operations will frezze all dots that pass over one of these operations from the closed side but if a dot passes over from the open side all dots frozen by gates will be unfrozen if allowed. (dots can only be unfrozen one at a time so if two dots are at the same gate that gets opened only one will move but you can open the gate again for the other dots.)
  • The ABCDEFGHIJKLMNOP operations can be used in conjuction with gates by puting it on the side of the dot approching the gate and with that you can make it so that other gates that put the same letter on that side of the incoming dots will be the only ones that open for example:
    .--A}
    .-A{--$gate A was opened$ '' gate A should be the only one that opens because of the A next to the gate on line one and two
    .-B{--$gate B was opened$
    .-C{--$gate C was opened$
  • The @ operation passes the dots data to any dots frozen at gates if our dot that passes a gate from the open side afterwards all dots that were able to move past the gate will have it's data replaced with our dots data.
  • The 2345678 makes the dot jump that number of spaces along in the direction its going.
  • The () operations are used to support a function like system that works like this:
    .--(c main)-\ '' if the first letter in the brackets is c then it will register the x,y,direction of the dot (once it left the brackets)
    /---#wow#---/ '' to memory under the text entered one space after c and after the dot will be destroyed
    |
    \-(r main) '' r takes the dots data and puts it in memory then destroyes 
.----(e main)  '' e teleports the dot to the x,y posistion that was registered for the func or gives an error if there is nothing
 
.-------------------------------(g main)--$#$ '' gets the data put in memory and replaces the dots memory with it then prints it
.--(l print`( "wow it a lua print test"`)) '' puting l at the start will make everything one space after exacute as lua code

the hold on to your stuff it's going to get more complcated stuff/multi operation

Multi operation are done in brackets like this [*] or this [apl] and these and thay normally require two dots to work a list of all multi ops is below all operations are done in the reverse the order dots go in for example(dot[2] /dot[1]) also dots can enter in any direction thay want but the returned dot will have the direction of the last dot to enter oh and only go through the middle if going vertically.


[*] muiltyplys

[/] divides

[+] add

[-] takeaway

[%] modulas

[^] power of

[&] and gate

[!] not gate (this one only needs one dot)

[o] or gate

[x] xor gate

[>] more than

[<] less than

[=] equals

[~] dosent equal

[=>=] equals or is more than

[=<=] equals or is less than

[apl] append start of tring

[apr] append end of string

[fir] find text right(Find the right most posistion of some text in text like so: dot one has "I am gay but I don't like rainbows", dot two has "gay", returned dot will have "9".)

[fil] find text left (like fir but it find it finds left most posistion which for the above example would be 6)

[rep] string replace (Takes in three inputs like so: dot one is the replace text,dot two is the text you want to replace, dot three equals the string you want to replace something in.)

[sub] string sub (This also takes three inputs like so: dot one the right part of sub, dot two the left part of sub, dot three string you want to sub.)

[rnd] random number (first dot is the low number, last dot is high number)

[ton] tostring (one dot)

[tos] tonumber (one dot)

[toc] to char (Takes ascii number i think turns it to a letter.)

[tob] to byte (Takes a letter or the first letter in a sequance of letters and turns it into a ascii number I think.)

[upp] string upper (one dot)

[low] string lower (one dot)

[000] dot counter (Replace the number inside brackets with a three digit number like 002 or 888 then the multi operation will count and then destroy the dots that pass over it untill the count equals the number in the brackets at which point the count is insted reset and the last dot sent to satisfy the count will not be destroyed oh and cont has to be over 2 and lower than 888.)

lua code you can use

  • onclose() this is a function that runs when the program is at its end.
  • operationout( dot, op, x, y ) --can be used to make fake oparations just return true
  • getuit() returns the user input text by defult this would be "enter input: " (ONLY EXACUTE)
  • changeuit( text ) changes the user input text (ONLY EXACUTE)
  • var( k, v ) to create and get vars safely without worry you could break something and to get a var just make v = nil and use varnil to remove a var but do not put brackets at the end of varnil
  • getdotkv( k ) gets key value data of the dot that ran the lua code data like: dir(direction), x, y and data(info put in the dot)
  • setdotkv( k, v ) sets info in the dot
  • removedot() removes the current dot

programs made in this

hi world:

.-$hello world!$

calculator:

.--------(l changeuit`( "enter math symbol: "`))-(e main)

.-(c main)-?-*-7      -*-*-*-------=-#reset#---------------------------------------------\
             |         | | |                                                             |
             |         2 4 6                                                             |
             |                                                                           |
             |         |          /--(l changeuit`( "enter number: "`))-(e add)          |
             *-#+#----[=]---------:--------------------------------------------------\   |
             |           |        /--(l changeuit`( "enter number: "`))-(e tak)      |   =
             *-#`-#-----[=]-------:------------------------------------------------\ |   |
             |             |      /--(l changeuit`( "enter number: "`))-(e mul)    >->-[004]------$Invaild-Input-Restarting-Main-Function$-(e main)
        /-=--*-#*#--------[=]-----:------------------------------------------------/ |
        |    |                    /--(l changeuit`( "enter number: "`))-(e div)      |
        |    >-#/#-----------[=]--:--------------------------------------------------/
        \-------------------=-/


.--(c add)-*--?-4   -v
           |       [ton]
           >-?-[ton][+]--$#$--(l changeuit`( "enter math symbol: "`))-(e main)

.---(c tak)-*--?-4   -v
            |       [ton]
            >-?-[ton][-]--$#$--(l changeuit`( "enter math symbol: "`))-(e main)
	   
.----(c mul)-*--?-4   -v
             |       [ton]
             >-?-[ton][*]--$#$--(l changeuit`( "enter math symbol: "`))-(e main)

.-----(c div)-*--?-4   -v
              |       [ton]
              >-?-[ton][/]--$#$--(l changeuit`( "enter math symbol: "`))-(e main)


fizzbuzz (to 2999):

.-(l function onclose`(`) os.execute`( "pause"`) end) '' pause the program insted of closeing it right away so you can see result (only on windows)

'' fun fact even know this program is bigger in 2D size compared to the asciidots fizzbuzz it should be faster unless you got a really bad computer

            /--------*--#0#---\
            |        |        |
.--(c fizz)-*-#3#-F{->-F}-[%]->-[=]----E}-(r fizz)
             /--------*--#0#---\
             |        |        |
.---(c buzz)-*-#5#-B{->-B}-[%]->-[=]--------A}-(r buzz)
.----(c loop)-\
 /------------/ /---=-#reset#-----------------------=-*-*-=---------------------------------------------\
 |              |                                     | |                                               |
 *-(e fizz)     |                                     3 5                                               |
 |              *----------------------------------------------------------------------------~---$#$    |
 *-(e buzz)     |                                                                            |          |
 |              |           /-------------------------~-=-----------------------=-----$fizz$-^-=--------/
 \--------E{-A{-*--(g fizz)-:                         |                                      |
                |           /---------------------------~-=---------------------=-----$buzz$-^
                *--(g buzz)-:                         2 |                                    |
                |                                     | |                                    |
                |                     /---$fizzbuzz$--*-*-=--------------------------------=-/
                |          /-(g buzz)-:
                *-(g fizz)-:
                |
                \-----------------------------------------------------------------------------------------------------------------------------------------P}
        /-#1#-\
        |     |
.----->-*----->-[ton]-[+]--\
      \----------------}P--*-(e loop)
                           |
             &-[006]-[500]-/  '' change numbers here to affect how long the program runs for

fizzbuzz (endless):

            /--------*--#0#---\
            |        |        |
.--(c fizz)-*-#3#-F{->-F}-[%]->-[=]----E}-(r fizz)
             /--------*--#0#---\
             |        |        |
.---(c buzz)-*-#5#-B{->-B}-[%]->-[=]--------A}-(r buzz)
.----(c loop)-\
 /------------/ /---=-#reset#-----------------------=-*-*-=---------------------------------------------\
 |              |                                     | |                                               |
 *-(e fizz)     |                                     3 5                                               |
 |              *----------------------------------------------------------------------------~---$#$    |
 *-(e buzz)     |                                                                            |          |
 |              |           /-------------------------~-=-----------------------=-----$fizz$-^-=--------/
 \--------E{-A{-*--(g fizz)-:                         |                                      |
                |           /---------------------------~-=---------------------=-----$buzz$-^
                *--(g buzz)-:                         2 |                                    |
                |                                     | |                                    |
                |                     /---$fizzbuzz$--*-*-=--------------------------------=-/
                |          /-(g buzz)-:
                *-(g fizz)-:
                |
                \-----------------------------------------------------------------------------------------------------------------------------------------P}
        /-#1#-\
        |     |
.----->-*----->-[ton]-[+]--\
      \----------------}P--*-(e loop)
                           |

rng number gemarator:

.----(e rnd)
.-(c rnd)-*-(l changeuit`( "enter lower number: "`))--?-4   ---*-(l changeuit`( "enter upper number: "`))
          |                                                    |
          |                                                  [ton]
          >-------------------------------------------?-[ton][rnd]--$#$-(e rnd)