﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?application progid="SMath Studio" version="0.95"?>
<regions>
  <settings>
    <calculation>
      <precision>4</precision>
      <exponentialThreshold>6</exponentialThreshold>
      <fractions>decimal</fractions>
    </calculation>
    <pageModel active="true" printAreas="true" simpleEqualsOnly="false">
      <paper id="1" orientation="Portrait" width="850" height="1100" />
      <margins left="39" right="39" top="39" bottom="39" />
      <header alignment="Center" color="#a9a9a9">&amp;[DATE] &amp;[TIME] - &amp;[FILENAME]</header>
      <footer alignment="Center" color="#a9a9a9">&amp;[PAGENUM] / &amp;[COUNT]</footer>
    </pageModel>
    <dependences>
      <assembly name="SMath Studio" version="0.95" guid="a37cba83-b69c-4c71-9992-55ff666763bd" />
      <assembly name="Text Region" version="1.8.4594.45" guid="485d28c5-349a-48b6-93be-12a35a1c1e39" />
      <assembly name="Special Functions" version="1.9.4594.42" guid="2814e667-4e12-48b1-8d51-194e480eabc5" />
      <assembly name="Math Region" version="0.95" guid="02f1ab51-215b-466e-a74d-5d8b1cf85e8d" />
    </dependences>
  </settings>
  <region id="0" left="0" top="18" width="577" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p bold="true" underline="true">Programming the song "99 bottles of beer on the wall" in SMath Studio</p>
    </text>
  </region>
  <region id="1" left="0" top="36" width="185" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>(preliminary version)</p>
    </text>
  </region>
  <region id="2" left="0" top="63" width="690" height="460" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand">n</e>
        <e type="function" args="1">BofB</e>
        <e type="operand">n</e>
        <e type="operand">0</e>
        <e type="operator" args="2">&gt;</e>
        <e type="operand">S1</e>
        <e type="operand" style="string"> bottles of beer</e>
        <e type="operator" args="2">:</e>
        <e type="operand">S2</e>
        <e type="operand" style="string"> on the wall</e>
        <e type="operator" args="2">:</e>
        <e type="operand">S3</e>
        <e type="operand" style="string">Take one out and pass it around, </e>
        <e type="operator" args="2">:</e>
        <e type="operand">S4</e>
        <e type="operand" style="string">Go to the store and buy some more, </e>
        <e type="operator" args="2">:</e>
        <e type="operand">j</e>
        <e type="operand">0</e>
        <e type="operator" args="2">:</e>
        <e type="operand">k</e>
        <e type="operand">n</e>
        <e type="operator" args="2">:</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">&gt;</e>
        <e type="operand">j</e>
        <e type="operand">j</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand">k</e>
        <e type="function" preserve="true" args="1">num2str</e>
        <e type="operand">S1</e>
        <e type="operand">S2</e>
        <e type="operand" style="string">, </e>
        <e type="operand">k</e>
        <e type="function" preserve="true" args="1">num2str</e>
        <e type="operand">S1</e>
        <e type="operand" style="string">.</e>
        <e type="function" preserve="true" args="7">concat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">j</e>
        <e type="operand">j</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand">S3</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">-</e>
        <e type="function" preserve="true" args="1">num2str</e>
        <e type="operand">S1</e>
        <e type="operand">S2</e>
        <e type="operand" style="string">.</e>
        <e type="function" preserve="true" args="5">concat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">-</e>
        <e type="operator" args="2">:</e>
        <e type="operand">5</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="7">line</e>
        <e type="function" preserve="true" args="2">while</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand" style="string">1 bottle of beer</e>
        <e type="operand">S2</e>
        <e type="operand" style="string">, 1 bottle of beer.</e>
        <e type="function" preserve="true" args="3">concat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="operand">2</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand">S3</e>
        <e type="operand" style="string"> no more bottles of beer on the wall.</e>
        <e type="function" preserve="true" args="2">concat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="operand">3</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand" style="string">No more bottles of beer on the wall, no more bottles of beer.</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">j</e>
        <e type="operand">4</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand">n</e>
        <e type="operand">1</e>
        <e type="operator" args="2">&gt;</e>
        <e type="operand">S4</e>
        <e type="operand">n</e>
        <e type="function" preserve="true" args="1">num2str</e>
        <e type="operand">S1</e>
        <e type="operand">S2</e>
        <e type="operand" style="string">.</e>
        <e type="function" preserve="true" args="5">concat</e>
        <e type="operand">S4</e>
        <e type="operand" style="string">1 bottle of beer</e>
        <e type="operand">S2</e>
        <e type="operand" style="string">.</e>
        <e type="function" preserve="true" args="4">concat</e>
        <e type="function" preserve="true" args="3">if</e>
        <e type="operator" args="2">:</e>
        <e type="operand">SS</e>
        <e type="operand">12</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="14">line</e>
        <e type="operand" style="string">Are you teetotal? Grab a beer and sing with us!</e>
        <e type="function" preserve="true" args="3">if</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="3" left="108" top="549" width="527" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>"No more bottles of beer on the wall, no more bottles of beer."</p>
    </text>
  </region>
  <region id="4" left="27" top="585" width="591" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p underline="true">Testing for n = 10 (n = 99 would produce a waaaay big amount of output)</p>
    </text>
  </region>
  <region id="5" left="18" top="612" width="700" height="404" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand">10</e>
        <e type="function" args="1">BofB</e>
      </input>
      <result action="numeric">
        <e type="operand" style="string">10 bottles of beer on the wall, 10 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 9 bottles of beer on the wall.</e>
        <e type="operand" style="string">9 bottles of beer on the wall, 9 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 8 bottles of beer on the wall.</e>
        <e type="operand" style="string">8 bottles of beer on the wall, 8 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 7 bottles of beer on the wall.</e>
        <e type="operand" style="string">7 bottles of beer on the wall, 7 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 6 bottles of beer on the wall.</e>
        <e type="operand" style="string">6 bottles of beer on the wall, 6 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 5 bottles of beer on the wall.</e>
        <e type="operand" style="string">5 bottles of beer on the wall, 5 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 4 bottles of beer on the wall.</e>
        <e type="operand" style="string">4 bottles of beer on the wall, 4 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 3 bottles of beer on the wall.</e>
        <e type="operand" style="string">3 bottles of beer on the wall, 3 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 2 bottles of beer on the wall.</e>
        <e type="operand" style="string">2 bottles of beer on the wall, 2 bottles of beer.</e>
        <e type="operand" style="string">Take one out and pass it around, 1 bottles of beer on the wall.</e>
        <e type="operand" style="string">1 bottle of beer on the wall, 1 bottle of beer.</e>
        <e type="operand" style="string">Take one out and pass it around,  no more bottles of beer on the wall.</e>
        <e type="operand" style="string">No more bottles of beer on the wall, no more bottles of beer.</e>
        <e type="operand" style="string">Go to the store and buy some more, 10 bottles of beer on the wall.</e>
        <e type="operand">22</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="24">mat</e>
      </result>
    </math>
  </region>
</regions>