12-03-2020, 03:09 PM
(This post was last modified: 12-04-2020, 03:43 AM by Splints. Edited 4 times in total.
Edit Reason: formatting
)
Inspired by qwertyquerty's fantastic CHEMFARD, I've made a ChemiCompiler compiler that runs in your browser.
ChemiAssembler is a javascript based program that converts code from a human readable assembly-like language to chemfuck. All of the code runs locally on your browser, so you can download the website or the code from the github to run it offline.
Here is the tool: https://112358sam.github.io/ChemiAssembler/
Here is the github repo: https://github.com/112358sam/ChemiAssembler
The tool page includes most of what you need to operate it including some examples.
Here is one of them. The lines beginning with # are comments.
Input:
Output:
+}>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'$>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'>++}>+++)@>++++++++++++++++++++++++++++++++++++++++++++++++++'<<<<<}@>>>>}>>)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'$
For fun, here's Hello World!
Input:
Output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<.>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<<<.>>>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++.
Here is the list of commands the tool accepts. This is also on the tool's page.
mov #a, #s, #t moves #a amount from #s source container to #t target container
movall #s, #t moves all the contents of #s source container to #t target container
temp #s, #v sets the temperature of #s source to #v value
iso #a, #r, #s, #t isolates #a amount of #r reagent from #s source to #t target
pill #s makes the contents of #s into pills. Identical to movall-ing the contents to 11
vial #s makes the contents of #s into vials. Identical to movall-ing the contents to 12
dump #s dumps the contents of #s. Identical to movall-ing the contents to 13
compile this line anywhere in the code indicates that the resulting program should have ~ appended
print #text prints #text to the ChemiCompiler screen (this adds a lot of code to the output)
sfor #i simple for loop, iterates the code below until end #i times. If #i <= 0 the code is skipped
end markes the end of a loop
Please let me know any changes you would like to see or bugs you encounter! I have tested many cases, but I'm certain bugs remain.
ChemiAssembler is a javascript based program that converts code from a human readable assembly-like language to chemfuck. All of the code runs locally on your browser, so you can download the website or the code from the github to run it offline.
Here is the tool: https://112358sam.github.io/ChemiAssembler/
Here is the github repo: https://github.com/112358sam/ChemiAssembler
The tool page includes most of what you need to operate it including some examples.
Here is one of them. The lines beginning with # are comments.
Input:
Code:
#Example script showing how to make charcoal with chemgroup inputs
#Makes 100 charcoal
#Load slot 1 with 50+ paper
#Load slot 2 with water=25;chlorine=25;sodium=25
#Load slot 3 with an empty beaker
temp 1, 424
mov 50, 2, 3
mov 50, 1, 3
temp 3, 374
Output:
+}>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'$>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'>++}>+++)@>++++++++++++++++++++++++++++++++++++++++++++++++++'<<<<<}@>>>>}>>)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'$
For fun, here's Hello World!
Input:
Code:
print Hello World!
Output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<.>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<<<.>>>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++.
Here is the list of commands the tool accepts. This is also on the tool's page.
mov #a, #s, #t moves #a amount from #s source container to #t target container
movall #s, #t moves all the contents of #s source container to #t target container
temp #s, #v sets the temperature of #s source to #v value
iso #a, #r, #s, #t isolates #a amount of #r reagent from #s source to #t target
pill #s makes the contents of #s into pills. Identical to movall-ing the contents to 11
vial #s makes the contents of #s into vials. Identical to movall-ing the contents to 12
dump #s dumps the contents of #s. Identical to movall-ing the contents to 13
compile this line anywhere in the code indicates that the resulting program should have ~ appended
print #text prints #text to the ChemiCompiler screen (this adds a lot of code to the output)
sfor #i simple for loop, iterates the code below until end #i times. If #i <= 0 the code is skipped
end markes the end of a loop
Please let me know any changes you would like to see or bugs you encounter! I have tested many cases, but I'm certain bugs remain.