<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="12" minor="2"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false"></View-Properties>
<MapleNet-Properties elisiondigitsbefore="100" labelling="true" indentamount="4" elisiontermsthreshold="10000" ansi="false" errorbreak="1" useclientjvm="true" echo="1" imaginaryunit="I" labelwidth="20" plotdriver="openviz" elisiondigitsafter="100" plotoutput="terminal" rtablesize="10" elisiontermsbefore="100" elisiondigitsthreshold="10000" typesetting="standard" plotdevice="inline" verboseproc="1" showassumed="1" errorcursor="false" longdelim="true" plotoptions="" quiet="false" elisiontermsafter="100" screenwidth="79" preplot="" prettyprint="3" displayprecision="-1" warnlevel="3" screenheight="25" latexwidth="6.0" postplot="" prompt="&gt; " ShowLabels="true"/>
<Styles><Font name="Ordered List 1" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Annotation Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 2" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 3" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 4" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 5" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Author" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Annotation Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Warning" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Maple Input Placeholder" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[200,0,200]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="true"/>
<Font name="Maple Plot" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Code" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Line Printed Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Text Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Diagnostic" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[40,120,40]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Inert Output" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[144,144,144]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Normal" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,128,128]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" placeholder="false"/>
<Font name="Maple Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Dash Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Math" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Maple Input" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Input" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Header and Footer" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Error" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 1" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Bullet Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Equation Label" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 4" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 3" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="14" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 2" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="16" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Dictionary Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[147,0,15]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" placeholder="false"/>
<Font name="List Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Layout name="Maple Output" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.3" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 1" alignment="left" bullet="numeric" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Dash Item" alignment="left" bullet="dash" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 2" alignment="left" bullet="alphabetic" firstindent="0" leftmargin="36" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 3" alignment="left" bullet="roman" firstindent="0" leftmargin="72" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 4" alignment="left" bullet="ALPHABETIC" firstindent="0" leftmargin="108" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 5" alignment="left" bullet="ROMAN" firstindent="0" leftmargin="144" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Author" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="8" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Warning" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Annotation Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Maple Plot" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Error" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Line Printed Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 1" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="4" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Diagnostic" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Text Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="newline" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Bullet Item" alignment="left" bullet="dot" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 4" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Normal" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 3" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 2" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="2" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="List Item" alignment="left" bullet="indent" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Pencil-style name="Pencil 5" pen-color="[255,0,0]" pen-height="5.0" pen-width="5.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 4" pen-color="[0,0,255]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 3" pen-color="[0,0,0]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 1" pen-color="[0,0,0]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Highlighter-style name="Highlighter 2" pen-color="[255,204,0]" pen-height="14.0" pen-width="14.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 4" pen-color="[0,255,255]" pen-height="32.0" pen-width="32.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 3" pen-color="[51,255,0]" pen-height="24.0" pen-width="24.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 5" pen-color="[255,255,0]" pen-height="48.0" pen-width="48.0" pen-opacity="0.8"/>
</Styles>
<Task-table>
    <Task-category name="&lt;default&gt;">
    </Task-category>
</Task-table>
<Task>
</Task>
<Group labelreference="L145" drawlabel="true">
<Input>
<Text-field style="Text" layout="Normal">Four_in_a Row</Text-field>
<Text-field style="Text" layout="Normal">Erik Katzen &amp; Mitch Pace</Text-field>
<Text-field style="Text" layout="Normal">253 Honors Spring 2009</Text-field>
</Input>
</Group>
<Group labelreference="L85" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">restart:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L90" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">with(Maplets[Tools]): with(Maplets[Elements]): with(plots):with(plottools):
StartEngine();</Font></Text-field>
</Input>
</Group>
<Group labelreference="L68" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">vlines:=plot([[[0,0],[0,6]], [[1,0],[1,6]], [[2,0],[2,6]], [[3,0],[3,6]], [[4,0],[4,6]], [[5,0],[5,6]], [[6,0],[6,6]], [[7,0],[7,6]],[[0,0],[7,0]]], color=black, thickness=3, axes=none):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L72" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">hlines:=plot([[[0,1],[7,1]],[[0,2],[7,2]],[[0,3],[7,3]],[[0,4],[7,4]],[[0,5],[7,5]]],color=black, thickness=1, axes=none):  #, linestyle=dash</Font></Text-field>
</Input>
</Group>
<Group labelreference="L123" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">Pcolor[1]:=tan:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L122" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">Pcolor[2]:=cyan:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L126" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">ColorList:=[&quot;Maroon&quot;, &quot;White&quot;, &quot;Black&quot;, &quot;Blue&quot;, &quot;Red&quot;, &quot;Green&quot;, &quot;Orange&quot;, &quot;Yellow&quot;]:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L158" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">ColorTable:=table({<Font foreground="[0,128,0]">&quot;Maroon&quot;=maroon, &quot;White&quot;=white, &quot;Black&quot;=black, &quot;Blue&quot;=blue, &quot;Red&quot;=red, &quot;Green&quot;=green, &quot;Orange&quot;=orange, &quot;Yellow&quot;=yellow}</Font>):</Text-field>
</Input>
</Group>
<Group labelreference="L127" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">player[1]:=&quot;Player 1&quot;:
player[2]:=&quot;Player 2&quot;:
playercolor[1]:=</Font><Font foreground="[255,0,0]">ColorTable[</Font><Font foreground="[0,128,0]">&quot;Maroon&quot;]:
playercolor[2]:=</Font><Font foreground="[255,0,0]">ColorTable[</Font><Font foreground="[0,128,0]">&quot;White&quot;]:
chip[1]:=disk([-.5,-.5], .4, color=playercolor[1]):
chip[2]:=disk([-.5,-.5], .4, color=playercolor[2]):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L71" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">bkgd:=rectangle([0,0],[7,6],color=gray):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L81" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">enabledcols:={1,2,3,4,5,6,7}:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L82" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">gamegrid:=vlines, hlines, bkgd:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L70" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">gameplot:=display([gamegrid], scaling=constrained):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L84" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"><Font foreground="[0,128,0]">Balls:=Array(1..6,1..7):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L146" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,128,0]" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L150" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">TitlePic:=&quot;<Font foreground="[204,153,255]">Four_in_a_Row_Title.gif</Font>&quot;:</Text-field>
</Input>
</Group>
<Group labelreference="L148" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">GamePic:=&quot;<Font foreground="[204,153,255]">Four_in_a_Row_Game.gif</Font>&quot;:</Text-field>
</Input>
</Group>
<Group labelreference="L151" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L114" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">Color1:=proc()
global color, chip, playercolor;
playercolor[1]:=</Font><Font foreground="[255,0,0]">ColorTable[</Font><Font foreground="[0,0,255]">Get(P1color)];
chip[1]:=disk([-.5,-.5], .4, color=playercolor[1]):
Set(P2color(itemlist)=remove(has,ColorList,playercolor[1])):
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L113" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">Color2:=proc()
global color, chip, playercolor;
playercolor[2]:=</Font><Font foreground="[255,0,0]">ColorTable[</Font><Font foreground="[0,0,255]">Get(P2color)];
chip[2]:=disk([-.5,-.5], .4, color=playercolor[2]):
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L153" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L93" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">ColorButtons:=proc(who, whichcols)
local i;
for i in whichcols do
Set(cat(&quot;B&quot;,i)(background)=Pcolor[who]);
end do;
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L154" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L80" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">Turn1:=proc()
global  player, currplayer, enabledcols;
local Num1;
if Get(P1Init)&lt;&gt;&quot;&quot; then
player[1]:=Get(P1Init):
end if;
if Get(P2Init)&lt;&gt;&quot;&quot; then
player[2]:=Get(P2Init):
end if;
currplayer:=1;       
ColorButtons(currplayer, enabledcols);
Set(TFturn=cat(player[currplayer], &quot;'s Turn&quot;))
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L86" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">Turn:=proc(col)
global player, currplayer, Balls, gamegrid, gameplot, enabledcols;
local i;
for i from 1 to 6 do
if Balls[i,col]=0
  then Balls[i,col]:=currplayer;
  gamegrid:=translate(chip[currplayer],col,i),gamegrid;
  gameplot:=display([gamegrid], scaling=constrained):
  break;
end if;
end do;
Winner(i);
if i=6 then 
  Set(cat(&quot;B&quot;,col)(enabled)=false, cat(&quot;B&quot;,col)(background)=gray);
  enabledcols:=enabledcols minus {col};
end if;
if currplayer=1 then currplayer:=2 else currplayer:=1 end if;
ColorButtons(currplayer, enabledcols);
Set(TFturn=cat(player[currplayer], &quot;'s Turn&quot;));
Set(Board=gameplot);
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L152" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L99" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" foreground="[0,0,255]" layout="Normal"><Font foreground="[0,0,255]">Winner:=proc(i)
global cols, currplayer, row;
 for cols from 1 to 4 do 
  for row from 1 to 6 do
   if Balls[row,cols]=currplayer then
    if Balls[row,cols+1]=currplayer then
     if Balls[row,cols+2]=currplayer then
      if Balls[row,cols+3]=currplayer then
<Font encoding="UTF-8">       Set(WhoWins=cat(&quot;   Congratulations!\134n      &quot;, player[currplayer],&quot;\134n   Wins Horizontally!&quot;));
</Font>       Set(Win(run)=true);
      end if;
     end if;
    end if;
   end if;
  end do;
 end do;

for cols from 1 to 7 do 
  for row from 1 to 3 do
   if Balls[row,cols]=currplayer then
    if Balls[row+1,cols]=currplayer then
     if Balls[row+2,cols]=currplayer then
      if Balls[row+3,cols]=currplayer then
       Set(WhoWins=cat(<Font encoding="UTF-8">&quot;   Congratulations!\134n      &quot;, player[currplayer],&quot;\134n   Wins </Font>Vertically!&quot;));
       Set(Win(run)=true);
      end if;
     end if;
    end if;
   end if;
  end do;
 end do;

for cols from 1 to 4 do 
  for row from 1 to 3 do
   if Balls[row,cols]=currplayer then
    if Balls[row+1,cols+1]=currplayer then
     if Balls[row+2,cols+2]=currplayer then
      if Balls[row+3,cols+3]=currplayer then
       Set(WhoWins=cat(<Font encoding="UTF-8">&quot;   Congratulations!\134n      &quot;, player[currplayer],&quot;\134n   Wins </Font>Diagonally!&quot;));
       Set(Win(run)=true);
      end if;
     end if;
    end if;
   end if;
  end do;
 end do;

for cols from 1 to 4 do 
  for row from 4 to 6 do
   if Balls[row,cols]=currplayer then
    if Balls[row-1,cols+1]=currplayer then
     if Balls[row-2,cols+2]=currplayer then
      if Balls[row-3,cols+3]=currplayer then
       Set(WhoWins=cat(<Font encoding="UTF-8">&quot;   Congratulations!\134n      &quot;, player[currplayer],&quot;\134n   Wins </Font>Diagonally!&quot;));
       Set(Win(run)=true);
      end if;
     end if;
    end if;
   end if;
  end do;
 end do;
end proc:</Font></Text-field>
</Input>
</Group>
<Group labelreference="L155" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L91" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">FourRow:=Maplet(onstartup = RunWindow(Info),
Font[helv10](&quot;helvetica&quot;,10),
Window[Info](title=&quot;Four in a Row&quot;, width=450, height=410,
  [ [ Label(Image(TitlePic)), halign=center
    ],
    [ &quot;Player 1&quot;,&quot;Player 2&quot;],
    [ &quot;Enter Your Name&quot;,&quot;Enter Your Name&quot;],
    [ [ TextField[P1Init](width=5, background=cyan)
      ],     
      [ TextField[P2Init](width=5, background=cyan)
      ]
    ],
    [ &quot;Choose Your Color&quot;
    ],
    [ DropDownBox[P1color](&quot;Maroon&quot;, ColorList, onchange=Acolor1),
      DropDownBox[P2color](&quot;White&quot;, ColorList, onchange=Acolor2 )
    ],   
    [ Button(&quot;Game On!&quot;, onclick=A1, background=wheat)
    ],
    [ background=&quot;#DDFFFF&quot;, inset=0, spacing=0, 
      Label(&quot;Programmers: Erik Katzen &amp; Mitch Pace&quot;, font=helv10),
      HorizontalGlue(),
      Label(&quot;Copyright P. Yasskin 2009&quot;, font=helv10)
    ]
  ]
), 
Window[Game](title=&quot;Four in a Row&quot;,
  [ [ Label(Image(GamePic)), halign=center
    ],
    [ inset=0, halign=none,
      HorizontalGlue(),
      HorizontalGlue(),
      Button[B1](&quot;V&quot;, width=55, height=40, onclick=Acol1,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B2](&quot;V&quot;, width=55, height=40, onclick=Acol2,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B3](&quot;V&quot;, width=55, height=40, onclick=Acol3,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B4](&quot;V&quot;, width=55, height=40, onclick=Acol4,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B5](&quot;V&quot;, width=55, height=40, onclick=Acol5,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B6](&quot;V&quot;, width=55, height=40, onclick=Acol6,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      Button[B7](&quot;V&quot;, width=55, height=40, onclick=Acol7,  background=grey,
                 Font(family=Helvetica, bold=true, size=24)),
      HorizontalGlue(),
      HorizontalGlue()
    ],
    [  Plotter[Board](gameplot , width=525, height=500)
    ],
    [ TextField[TFturn](width=10, editable=false, background=wheat)
    ],
    [ background=&quot;#DDFFFF&quot;, inset=0, spacing=0, 
      Label(&quot;Programmers: Erik Katzen &amp; Mitch Pace&quot;, font=helv10),
      HorizontalGlue(),
      Label(&quot;Copyright P. Yasskin 2009&quot;, font=helv10)
    ]
  ]
),
Window[EndGame](title=&quot;Four in a Row&quot;,
  [ [ TextBox[WhoWins](width=15, height=3, editable=false, background=white,
                       font=Font(family=Stencil, bold=false, size=24))
    ],
    [ Button(&quot;Quit&quot;, onclick=A2, background=wheat)
    ]
  ]
),
Action[A1](RunWindow(Game), CloseWindow(Info),  Evaluate(function = &quot;Turn1&quot;)),
Action[Acolor1](Evaluate(function=Color1)),
Action[Acolor2](Evaluate(function=Color2)),
Action[A2](Shutdown()),
Action[Acol1](Evaluate(function = &quot;Turn(1)&quot;)),
Action[Acol2](Evaluate(function = &quot;Turn(2)&quot;)),
Action[Acol3](Evaluate(function = &quot;Turn(3)&quot;)),
Action[Acol4](Evaluate(function = &quot;Turn(4)&quot;)),
Action[Acol5](Evaluate(function = &quot;Turn(5)&quot;)),
Action[Acol6](Evaluate(function = &quot;Turn(6)&quot;)),
Action[Acol7](Evaluate(function = &quot;Turn(7)&quot;)),
Action[Win](RunWindow(EndGame))
):</Text-field>
</Input>
</Group>
<Group labelreference="L92" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Maplets[Display]( FourRow ):</Text-field>
</Input>
</Group>
<Group labelreference="L156" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Worksheet>
