A lot of projects ported from the old metanohi site.
This commit is contained in:
86
site/projects/bito/README
Executable file
86
site/projects/bito/README
Executable file
@@ -0,0 +1,86 @@
|
||||
▄▄▄▄▄ ▀ ▄ █ ▄█▀█▄ ▀▀▄ ▀▀█▀▀ ▄▀▀▀▀█
|
||||
█ █ ▄▄▄ ▄▄█▄▄ ▄▄▄ █ █ █ █ █ █ █
|
||||
█▄▄▄▄▀ █ █ █▀ ▀█ █ █▄ ▄█ █ █ ▄▀▀▀▀█
|
||||
█ █ █ █ █ █ █ ▀▀▀ ▀▀█▀▀ ▀▀▀ █ █
|
||||
█▄▄▄▄▀ ▄▄█▄▄ ▀▄▄ ▀█▄█▀ █ ▀ ▄ ▀▀▀▀▀
|
||||
|
||||
|
||||
Bito is a programming language that aims to be easy to work with. Bito only
|
||||
accepts ones and zeroes. All other characters will be ignored. A command in
|
||||
Bito consists of two parts, the first part consisting of 1 bit and the second
|
||||
part consisting of three bits. All first parts must be written from left to
|
||||
right, while all last parts must be written from right to left. A last part
|
||||
consisting of 011 must thus be written 110.
|
||||
Bito saves data in a list containing an infinite numbers of memory cells. A
|
||||
cell can hold only any number above or equal to 0. There are no limits on how
|
||||
large numbers can be.
|
||||
|
||||
Tip: Writing comments with ones and zeroes will make code more difficult to
|
||||
understand. Try to replace ones with uppercase "i"s and zeroes with
|
||||
uppercase "o"s.
|
||||
|
||||
Available commands:
|
||||
0 xxx Append xxx to current memory cell (as a string)
|
||||
1 000 Print current number
|
||||
1 001 Print current number as ASCII
|
||||
1 010 Increment memory cell index
|
||||
1 011 Decrement memory cell index
|
||||
1 100 Start loop
|
||||
1 101 Restart or end loop
|
||||
1 110 Add value of previous cell to current cell (as an integer)
|
||||
1 111 Write input from stdin to next cells and write length to current cell
|
||||
|
||||
Trying to print an unset number will result in an error. Trying to print a
|
||||
number not in the ASCII range as ASCII text will also result in an error.
|
||||
Loops will run the times specified by the current cell. If the value of the
|
||||
current cell is either unset, 0 or 1, the loop will run only once, i.e. it will
|
||||
not act as a loop. Specifying the value 2 or above will thereby make it a loop.
|
||||
Because infinite loops are not possible in Bito, Bito does not suffer from the
|
||||
Halting Problem.
|
||||
Ending a loop when no loop has been started will not result in an error, nor
|
||||
will starting a loop without ending it do so (though the loop will, in those
|
||||
cases, not function as a loop). Also, nested loops cannot exist. When a loop
|
||||
has been started, all subsequent attempt to start a new loop will be ignored,
|
||||
until the loop has ended.
|
||||
Trying to add the value of a previous cell to the current cell will result in
|
||||
an error if the current cell is unset. If a previous cell is unset, its value
|
||||
is -1, which makes it ideal for use in subtracting numbers.
|
||||
|
||||
How to print an "N" (ASCII 78, binary ASCII 1001110):
|
||||
Short version:
|
||||
0001100011100100
|
||||
Long version:
|
||||
0 Current cell: OOI
|
||||
0 Current cell: OOIOOI
|
||||
0 Current cell: OOIOOIIIO (i.e. IOOIIIO)
|
||||
1 Print ASCII 78 (N)
|
||||
100
|
||||
011
|
||||
100
|
||||
100
|
||||
|
||||
Saving ones and zeroes as ASCII is meaningless, as it takes up much more space
|
||||
than needed. It is therefore recommended to convert every 8 characters into a
|
||||
byte. This will greatly reduce filesizes. If the number of characters in a file
|
||||
isn't directly dividable with 8 (4, 12, 132, etc.), just append a command that
|
||||
does not affect the the script too much -- like ending a loop (1 101). If this
|
||||
command is called outside a loop, nothing will happen.
|
||||
The above N-printing program would, in byte-form, take up two bytes instead of
|
||||
its current 16 bytes. It would save the first byte with 24 as its value and the
|
||||
second byte with 224 as its value (this is theoretically speaking -- as
|
||||
compressed Bito files are basically still text files, it is normal to have a
|
||||
newline character appended at the end of a file).
|
||||
|
||||
To run Bito programs, you can use the bitopret.py interpreter found in the
|
||||
'interpreter' directory. This interpreter also functions as a Bito file packer,
|
||||
i.e. it can compress Bito files.
|
||||
You will find a set of example programs in the 'examples' subdirectory.
|
||||
|
||||
|
||||
The Bito programming language was created by Niels Serup (metanohi.org). You
|
||||
can contact Niels a <ns@metanohi.org>.
|
||||
Updates to Bito are likely to appear at <http://metanohi.org/projects/bito/>.
|
||||
|
||||
This readme was written by Niels and was put into the public domain by him.
|
||||
Date: 27 July 2009
|
||||
|
||||
BIN
site/projects/bito/bitopret.tar.gz
Executable file
BIN
site/projects/bito/bitopret.tar.gz
Executable file
Binary file not shown.
BIN
site/projects/bito/img/bito-logo.png
Executable file
BIN
site/projects/bito/img/bito-logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
691
site/projects/bito/img/bito-logo.svg
Executable file
691
site/projects/bito/img/bito-logo.svg
Executable file
@@ -0,0 +1,691 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="154"
|
||||
height="60"
|
||||
id="svg3029"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.46"
|
||||
version="1.0"
|
||||
sodipodi:docname="bito-logo.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/niels/Programming/Esoteric/Bito/bito-logo.png"
|
||||
inkscape:export-xdpi="344.80521"
|
||||
inkscape:export-ydpi="344.80521">
|
||||
<defs
|
||||
id="defs3031">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective3037" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.4805195"
|
||||
inkscape:cx="77"
|
||||
inkscape:cy="30"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="mainlayer"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1255"
|
||||
inkscape:window-height="975"
|
||||
inkscape:window-x="24"
|
||||
inkscape:window-y="0" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="mainlayer"
|
||||
font-size="10"
|
||||
style="font-size:10px;font-family:monospace"
|
||||
transform="translate(2.5,-20)">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:7.65052413999999992px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#51797a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:DejaVu Sans Mono;-inkscape-font-specification:DejaVu Sans Mono;opacity:0.9"
|
||||
x="-2.8715544"
|
||||
y="26.73325"
|
||||
id="text3210"
|
||||
transform="scale(1.0527564,0.9498873)"><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="26.73325"
|
||||
id="tspan3254">00100010001000100010001001001000</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="36.296406"
|
||||
id="tspan3283">10001000100010001001111110110110</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="45.859558"
|
||||
id="tspan3285">01100011011000100001001000101010</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="55.422714"
|
||||
id="tspan3287">01100010001101100010001101100010</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="64.98587"
|
||||
id="tspan3289">11110110001000110101000000101011</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="74.549026"
|
||||
id="tspan3291">10101000101111011000100100111000</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="-2.8715544"
|
||||
y="84.112183"
|
||||
id="tspan3293">10001101100010001001100010100001</tspan></text>
|
||||
<g
|
||||
id="g4065"
|
||||
style="fill:#69578b;fill-opacity:1">
|
||||
<g
|
||||
style="opacity:0.84999999999999998;fill:#69578b;fill-opacity:1"
|
||||
transform="matrix(1.1476463,0,0,1.1554864,-2.6476463,-12.283424)"
|
||||
id="g2947">
|
||||
<rect
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="48.5"
|
||||
width="6"
|
||||
height="10"
|
||||
id="rect193" />
|
||||
<rect
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="58.5"
|
||||
width="6"
|
||||
height="10"
|
||||
id="rect249" />
|
||||
<rect
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="68.5"
|
||||
width="6"
|
||||
height="10"
|
||||
id="rect305" />
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="1.0976562"
|
||||
y="36.5"
|
||||
id="text453">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="7.0976562"
|
||||
y="36.5"
|
||||
id="text455">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="13.097656"
|
||||
y="36.5"
|
||||
id="text457">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="19.097656"
|
||||
y="36.5"
|
||||
id="text459">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="25.097656"
|
||||
y="36.5"
|
||||
id="text461">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="36.5"
|
||||
id="text463">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="79.305992"
|
||||
y="36.5"
|
||||
id="text465">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="1.0976562"
|
||||
y="46.5"
|
||||
id="text467">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="31.097654"
|
||||
y="46.5"
|
||||
id="text469">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="43.097656"
|
||||
y="46.5"
|
||||
id="text471">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="49.097656"
|
||||
y="46.5"
|
||||
id="text473">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="46.5"
|
||||
id="text475">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="67.305992"
|
||||
y="46.5"
|
||||
id="text477">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="73.305992"
|
||||
y="46.5"
|
||||
id="text479">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="79.305992"
|
||||
y="46.5"
|
||||
id="text481">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="85.305992"
|
||||
y="46.5"
|
||||
id="text483">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="91.305992"
|
||||
y="46.5"
|
||||
id="text485">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="109.32681"
|
||||
y="46.5"
|
||||
id="text487">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="115.32681"
|
||||
y="46.5"
|
||||
id="text489">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="121.32681"
|
||||
y="46.5"
|
||||
id="text491">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="1.0976562"
|
||||
y="56.5"
|
||||
id="text493">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="7.0976562"
|
||||
y="56.5"
|
||||
id="text495">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="13.097656"
|
||||
y="56.5"
|
||||
id="text497">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="19.097656"
|
||||
y="56.5"
|
||||
id="text499">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="25.097656"
|
||||
y="56.5"
|
||||
id="text501">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="31.097654"
|
||||
y="56.5"
|
||||
id="text503">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="56.5"
|
||||
id="text505">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="79.305992"
|
||||
y="56.5"
|
||||
id="text507">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="103.32681"
|
||||
y="56.5"
|
||||
id="text509">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="109.32681"
|
||||
y="56.5"
|
||||
id="text511">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="121.32681"
|
||||
y="56.5"
|
||||
id="text513">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="127.32682"
|
||||
y="56.5"
|
||||
id="text515">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="1.0976562"
|
||||
y="66.5"
|
||||
id="text517">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="31.097654"
|
||||
y="66.5"
|
||||
id="text519">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="66.5"
|
||||
id="text521">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="79.305992"
|
||||
y="66.5"
|
||||
id="text523">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="103.32681"
|
||||
y="66.5"
|
||||
id="text525">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="127.32682"
|
||||
y="66.5"
|
||||
id="text527">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="1.0976562"
|
||||
y="76.5"
|
||||
id="text529">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="7.0976562"
|
||||
y="76.5"
|
||||
id="text531">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="13.097656"
|
||||
y="76.5"
|
||||
id="text533">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="19.097656"
|
||||
y="76.5"
|
||||
id="text535">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="25.097656"
|
||||
y="76.5"
|
||||
id="text537">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="31.097654"
|
||||
y="76.5"
|
||||
id="text539">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="43.097656"
|
||||
y="76.5"
|
||||
id="text541">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="49.097656"
|
||||
y="76.5"
|
||||
id="text543">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="55.097656"
|
||||
y="76.5"
|
||||
id="text545">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="61.097656"
|
||||
y="76.5"
|
||||
id="text547">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="67.097656"
|
||||
y="76.5"
|
||||
id="text549">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="79.305992"
|
||||
y="76.5"
|
||||
id="text551">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="85.305992"
|
||||
y="76.5"
|
||||
id="text553">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="91.305992"
|
||||
y="76.5"
|
||||
id="text555">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="103.32681"
|
||||
y="76.5"
|
||||
id="text557">▀</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="109.32681"
|
||||
y="76.5"
|
||||
id="text559">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="115.32681"
|
||||
y="76.5"
|
||||
id="text561">▄</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="121.32681"
|
||||
y="76.5"
|
||||
id="text563">█</text>
|
||||
<text
|
||||
style="fill:#69578b;fill-opacity:1"
|
||||
x="127.32682"
|
||||
y="76.5"
|
||||
id="text565">▀</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
142
site/projects/bito/index.org
Normal file
142
site/projects/bito/index.org
Normal file
@@ -0,0 +1,142 @@
|
||||
#+title: Bito
|
||||
#&summary
|
||||
A poor but simple programming language along with an interpreter
|
||||
#&
|
||||
#+license: cc0, text
|
||||
#+license: bysa, logo
|
||||
#+license: gpl 3+, interpreter
|
||||
|
||||
* Bito
|
||||
|
||||
#&img;url=img/bito-logo.png,center
|
||||
|
||||
*Bito* is a programming language. I already wrote a readme about it, which you
|
||||
can either see below or download [[README][here]]. To run Bito
|
||||
programs, you will need a Bito interpreter.
|
||||
|
||||
[[bitopret.tar.gz][Download Bito interpreter, Bito interpreter README and Bito code examples]].
|
||||
|
||||
** Bito README
|
||||
|
||||
#&pre
|
||||
▄▄▄▄▄ ▀ ▄ █ ▄█▀█▄ ▀▀▄ ▀▀█▀▀ ▄▀▀▀▀█
|
||||
█ █ ▄▄▄ ▄▄█▄▄ ▄▄▄ █ █ █ █ █ █ █
|
||||
█▄▄▄▄▀ █ █ █▀ ▀█ █ █▄ ▄█ █ █ ▄▀▀▀▀█
|
||||
█ █ █ █ █ █ █ ▀▀▀ ▀▀█▀▀ ▀▀▀ █ █
|
||||
█▄▄▄▄▀ ▄▄█▄▄ ▀▄▄ ▀█▄█▀ █ ▀ ▄ ▀▀▀▀▀
|
||||
|
||||
|
||||
Bito is a programming language that aims to be easy to work with. Bito only
|
||||
accepts ones and zeroes. All other characters will be ignored. A command in
|
||||
Bito consists of two parts, the first part consisting of 1 bit and the second
|
||||
part consisting of three bits. All first parts must be written from left to
|
||||
right, while all last parts must be written from right to left. A last part
|
||||
consisting of 011 must thus be written 110.
|
||||
Bito saves data in a list containing an infinite numbers of memory cells. A
|
||||
cell can hold only any number above or equal to 0. There are no limits on how
|
||||
large numbers can be.
|
||||
|
||||
Tip: Writing comments with ones and zeroes will make code more difficult to
|
||||
understand. Try to replace ones with uppercase "i"s and zeroes with
|
||||
uppercase "o"s.
|
||||
|
||||
Available commands:
|
||||
0 xxx Append xxx to current memory cell (as a string)
|
||||
1 000 Print current number
|
||||
1 001 Print current number as ASCII
|
||||
1 010 Increment memory cell index
|
||||
1 011 Decrement memory cell index
|
||||
1 100 Start loop
|
||||
1 101 Restart or end loop
|
||||
1 110 Add value of previous cell to current cell (as an integer)
|
||||
1 111 Write input from stdin to next cells and write length to current cell
|
||||
|
||||
Trying to print an unset number will result in an error. Trying to print a
|
||||
number not in the ASCII range as ASCII text will also result in an error.
|
||||
Loops will run the times specified by the current cell. If the value of the
|
||||
current cell is either unset, 0 or 1, the loop will run only once, i.e. it will
|
||||
not act as a loop. Specifying the value 2 or above will thereby make it a loop.
|
||||
Because infinite loops are not possible in Bito, Bito does not suffer from the
|
||||
Halting Problem.
|
||||
Ending a loop when no loop has been started will not result in an error, nor
|
||||
will starting a loop without ending it do so (though the loop will, in those
|
||||
cases, not function as a loop). Also, nested loops cannot exist. When a loop
|
||||
has been started, all subsequent attempt to start a new loop will be ignored,
|
||||
until the loop has ended.
|
||||
Trying to add the value of a previous cell to the current cell will result in
|
||||
an error if the current cell is unset. If a previous cell is unset, its value
|
||||
is -1, which makes it ideal for use in subtracting numbers.
|
||||
|
||||
How to print an "N" (ASCII 78, binary ASCII 1001110):
|
||||
Short version:
|
||||
0001100011100100
|
||||
Long version:
|
||||
0 Current cell: OOI
|
||||
0 Current cell: OOIOOI
|
||||
0 Current cell: OOIOOIIIO (i.e. IOOIIIO)
|
||||
1 Print ASCII 78 (N)
|
||||
100
|
||||
011
|
||||
100
|
||||
100
|
||||
|
||||
Saving ones and zeroes as ASCII is meaningless, as it takes up much more space
|
||||
than needed. It is therefore recommended to convert every 8 characters into a
|
||||
byte. This will greatly reduce filesizes. If the number of characters in a file
|
||||
isn't directly dividable with 8 (4, 12, 132, etc.), just append a command that
|
||||
does not affect the the script too much --- like ending a loop (1 101). If this
|
||||
command is called outside a loop, nothing will happen.
|
||||
The above N-printing program would, in byte-form, take up two bytes instead of
|
||||
its current 16 bytes. It would save the first byte with 24 as its value and the
|
||||
second byte with 224 as its value (this is theoretically speaking -- as
|
||||
compressed Bito files are basically still text files, it is normal to have a
|
||||
newline character appended at the end of a file).
|
||||
|
||||
To run Bito programs, you can use the bitopret.py interpreter found in the
|
||||
'interpreter' directory. This interpreter also functions as a Bito file packer,
|
||||
i.e. it can compress Bito files.
|
||||
You will find a set of example programs in the 'examples' subdirectory.
|
||||
|
||||
|
||||
The Bito programming language was created by Niels Serup (metanohi.org). You
|
||||
can contact Niels at <[[mailto:ns@metanohi.org][ns@metanohi.org]]>.
|
||||
Updates to Bito are likely to appear at <[[http://metanohi.name/projects/bito/]]>.
|
||||
|
||||
This readme was written by Niels and was put into the public domain by him.
|
||||
Date: 27 July 2009
|
||||
#&
|
||||
|
||||
** Bito interpreter README
|
||||
|
||||
#&pre
|
||||
█ ▀ ▄ ▄
|
||||
█▄▄▄ ▄▄▄ ▄▄█▄▄ ▄▄▄ ▄▄▄▄ ▄ ▄▄ ▄▄▄ ▄▄█▄▄
|
||||
█▀ ▀█ █ █ █▀ ▀█ █▀ ▀█ █▀ ▀ █▀ █ █
|
||||
█ █ █ █ █ █ █ █ █ █▀▀▀▀ █
|
||||
██▄█▀ ▄▄█▄▄ ▀▄▄ ▀█▄█▀ ██▄█▀ █ ▀█▄▄▀ ▀▄▄
|
||||
█
|
||||
An interpreter for the Bi ▀ to programming language
|
||||
|
||||
Though a creating a compiler might have been the best way to be able to run
|
||||
files written in the Bito programming language, it's easier to create an
|
||||
interpreter. The standard interpreter for Bito files, bitopret, works
|
||||
flawlessly, though naturally it's not lightning fast. To use bitopret, run
|
||||
bitopret.py. If you run bitopret.py without any arguments, it will display some
|
||||
hopefully historically helpful help.
|
||||
|
||||
To understand the Bito language, you should have a look at the original README
|
||||
describing it. You can fetch a copy at <[[http://metanohi.name/projects/bito/]]>.
|
||||
|
||||
There are example programs in the 'examples' directory.
|
||||
|
||||
Niels Serup (metanohi.name) created this interpreter along with the Bito
|
||||
language. You can contact Niels at <[[mailto:ns@metanohi.org][ns@metanohi.org]]>.
|
||||
|
||||
Version information:
|
||||
bitopret 0.9
|
||||
Copyright (C) 2009 Niels Serup
|
||||
License GPLv3+: GNU GPL version 3 or later <[[http://gnu.org/licenses/gpl.html]]>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
#&
|
||||
|
||||
Reference in New Issue
Block a user