{
(set: $pos7 to 0)
(set: $pos6 to 0)
(set: $pos5 to 0)
(set: $pos4 to 0)
(set: $pos3 to 0)
(set: $pos2 to 0)
(set: $pos1 to 0)
(set: $pos0 to 0)
(set: $num to 0)
(goto: "Start")
}
<table align="center"; style="margin:1em auto;">
<tr>
<th colspan="17">Binary Calculator</th>
</tr>
<tr>
<td>(link-repeat:"[$pos7]<pos7|")[{
(replace:?pos7)[
(if: $pos7 is 0)[(set: $pos7 to 1)(replace: ?p7)[128](replace: ?p7e)[2^^7^^]]
(else-if: $pos7 is 1)[(set: $pos7 to 0)(replace: ?p7)[0](replace: ?p7e)[0]]
(display: "calc")
$pos7]
}]</td>
<td class="color"></td>
<td>(link-repeat:"[$pos6]<pos6|")[{
(replace:?pos6)[
(if: $pos6 is 0)[(set: $pos6 to 1)(replace: ?p6)[64](replace: ?p6e)[2^^6^^]]
(else-if: $pos6 is 1)[(set: $pos6 to 0)(replace: ?p6)[0](replace: ?p6e)[0]]
(display: "calc")
$pos6]
}]</td>
<td class="color"></td>
<td>(link-repeat:"[$pos5]<pos5|")[{
(replace:?pos5)[
(if: $pos5 is 0)[(set: $pos5 to 1)(replace: ?p5)[32](replace: ?p5e)[2^^5^^]]
(else-if: $pos5 is 1)[(set: $pos5 to 0)(replace: ?p5)[0](replace: ?p5e)[0]]
(display: "calc")
$pos5]
}]</td>
<td class="color"></td>
<td>(link-repeat:"[$pos4]<pos4|")[{
(replace:?pos4)[
(if: $pos4 is 0)[(set: $pos4 to 1)(replace: ?p4)[16](replace: ?p4e)[2^^4^^]]
(else-if: $pos4 is 1)[(set: $pos4 to 0)(replace: ?p4)[0](replace: ?p4e)[0]]
(display: "calc")
$pos4]
}] </td>
<td class="color"></td>
<td>(link-repeat:"[$pos3]<pos3|")[{
(replace:?pos3)[
(if: $pos3 is 0)[(set: $pos3 to 1)(replace: ?p3)[8](replace: ?p3e)[2^^3^^]]
(else-if: $pos3 is 1)[(set: $pos3 to 0)(replace: ?p3)[0](replace: ?p3e)[0]]
(display: "calc")
$pos3]
}] </td>
<td class="color"></td>
<td>(link-repeat:"[$pos2]<pos2|")[{
(replace:?pos2)[
(if: $pos2 is 0)[(set: $pos2 to 1)(replace: ?p2)[4](replace: ?p2e)[2^^2^^]]
(else-if: $pos2 is 1)[(set: $pos2 to 0)(replace: ?p2)[0](replace: ?p2e)[0]]
(display: "calc")
$pos2]
}] </td>
<td class="color"></td>
<td>(link-repeat:"[$pos1]<pos1|")[{
(replace:?pos1)[
(if: $pos1 is 0)[(set: $pos1 to 1)(replace: ?p1)[2](replace: ?p1e)[2^^1^^]]
(else-if: $pos1 is 1)[(set: $pos1 to 0)(replace: ?p1)[0](replace: ?p1e)[0]]
(display: "calc")
$pos1]
}] </td>
<td class="color"></td>
<td>(link-repeat:"[$pos0]<pos0|")[{
(replace:?pos0)[
(if: $pos0 is 0)[(set: $pos0 to 1)(replace: ?p0)[1](replace: ?p0e)[2^^0^^]]
(else-if: $pos0 is 1)[(set: $pos0 to 0)(replace: ?p0)[0](replace: ?p0e)[0]]
(display: "calc")
$pos0]
}] </td>
</tr>
<tr>
<td class="color">[0]<p7e|</td>
<td class="color">+</td>
<td class="color">[0]<p6e|</td>
<td class="color">+</td>
<td class="color">[0]<p5e|</td>
<td class="color">+</td>
<td class="color">[0]<p4e|</td>
<td class="color">+</td>
<td class="color">[0]<p3e|</td>
<td class="color">+</td>
<td class="color">[0]<p2e|</td>
<td class="color">+</td>
<td class="color">[0]<p1e|</td>
<td class="color">+</td>
<td class="color">[0]<p0e|</td>
</tr>
<tr>
<td class="color">[0]<p7|</td>
<td class="color">+</td>
<td class="color">[0]<p6|</td>
<td class="color">+</td>
<td class="color">[0]<p5|</td>
<td class="color">+</td>
<td class="color">[0]<p4|</td>
<td class="color">+</td>
<td class="color">[0]<p3|</td>
<td class="color">+</td>
<td class="color">[0]<p2|</td>
<td class="color">+</td>
<td class="color">[0]<p1|</td>
<td class="color">+</td>
<td class="color">[0]<p0|</td>
</tr>
<tr>
<th colspan="17">[0]<num|</th>
</tr>
</table>{
(set: $num to ($pos0 + $pos1 * (2) + $pos2 * (2*2) + $pos3 * (2*2*2) + $pos4 * (2*2*2*2) + $pos5 * (2*2*2*2*2) + $pos6 * (2*2*2*2*2*2)) + ($pos7 * (2*2*2*2*2*2*2)))
(replace: ?num)[$num]
}