{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 7, "minor" : 0, "revision" : 1, "architecture" : "x86", "modernui" : 1 } , "rect" : [ 478.0, 212.0, 847.0, 599.0 ], "bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "editing_bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 1, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 1, "objectsnaponopen" : 1, "statusbarvisible" : 2, "toolbarvisible" : 1, "lefttoolbarpinned" : 0, "toptoolbarpinned" : 0, "righttoolbarpinned" : 0, "bottomtoolbarpinned" : 0, "toolbars_unpinned_last_save" : 0, "tallnewobj" : 0, "boxanimatetime" : 200, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "description" : "", "digest" : "", "tags" : "", "style" : "", "subpatcher_template" : "IceCubeTray", "boxes" : [ { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-31", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 495.5, 270.0, 47.0 ], "style" : "", "text" : "Try adding different values to the horizontal and vertical coordinates when you build the drawing command" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-30", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 450.0, 273.0, 33.0 ], "style" : "", "text" : "What happens if we use a different integer than 2 in the mod statements?" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-28", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 300.0, 297.5, 90.0, 33.0 ], "style" : "", "text" : "Build drawing command" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-12", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 357.0, 390.0, 32.5, 22.0 ], "style" : "", "text" : "+ 1" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-23", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 321.75, 390.0, 32.5, 22.0 ], "style" : "", "text" : "+ 1" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-9", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 300.0, 474.0, 109.0, 22.0 ], "style" : "", "text" : "prepend framerect" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-24", "maxclass" : "newobj", "numinlets" : 4, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 300.0, 435.0, 76.0, 22.0 ], "style" : "", "text" : "pack 0 0 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-26", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "patching_rect" : [ 300.0, 345.0, 69.0, 22.0 ], "style" : "", "text" : "unpack 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-22", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 540.0, 55.0, 22.0 ], "style" : "", "text" : "send lcd" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-20", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 510.0, 289.0, 22.0 ], "style" : "", "text" : "framerect 78 176 79 177" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-17", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 113.0, 405.0, 100.0, 33.0 ], "style" : "", "text" : "Test each pair of coordinates" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-14", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 474.0, 202.0, 22.0 ], "style" : "", "text" : "if ($i1 == 0) && ($i2 == 1) then bang" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-16", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 80.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "% 2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-10", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 30.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "% 2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-8", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "" ], "patching_rect" : [ 30.0, 345.0, 32.5, 22.0 ], "style" : "", "text" : "t l l" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-104", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "patching_rect" : [ 30.0, 405.0, 69.0, 22.0 ], "style" : "", "text" : "unpack 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-21", "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 50.0, 165.0, 55.0, 35.0 ], "style" : "", "text" : ";\rlcd clear" } } , { "box" : { "id" : "obj-19", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 30.0, 135.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-15", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 3, "outlettype" : [ "bang", "bang", "int" ], "patching_rect" : [ 30.0, 210.0, 63.0, 22.0 ], "style" : "", "text" : "uzi 20000" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-83", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "bang", "bang" ], "patching_rect" : [ 30.0, 242.0, 34.0, 22.0 ], "style" : "", "text" : "t b b" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-82", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 315.0, 56.0, 22.0 ], "style" : "", "text" : "pack 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-80", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 108.0, 285.0, 75.0, 22.0 ], "style" : "", "text" : "random 200" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-81", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 30.0, 285.0, 75.0, 22.0 ], "style" : "", "text" : "random 200" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-77", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 108.0, 229.0, 102.0, 33.0 ], "style" : "", "text" : "Create each pair of coordinates" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 405.0, 270.0, 33.0 ], "style" : "", "text" : "What happens if both coordinates are constrained to be even or both to be odd?" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-11", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 90.0, 270.0, 47.0 ], "style" : "", "text" : "It may not be immediately obvious what consequences a particular set of conditions will have for our final results" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-7", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 150.0, 135.0, 330.0, 60.0 ], "style" : "", "text" : "Here we randomly create thousands of pairs of coordinates. We test each one to see if the horizontal coordinate is even and the vertical coordinate is odd. If so, we plot the point. If not, we discard it." } } , { "box" : { "id" : "obj-5", "maxclass" : "lcd", "numinlets" : 1, "numoutlets" : 4, "outlettype" : [ "list", "list", "int", "" ], "patching_rect" : [ 510.0, 180.0, 200.0, 200.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-1", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 510.0, 150.0, 68.0, 22.0 ], "style" : "", "text" : "receive lcd" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-4", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 90.0, 450.0, 33.0 ], "style" : "", "text" : "A generate-and-test algorithm is one which randomly or exhaustively creates potential solutions and then tests each one to see if it fits some desired condition." } } , { "box" : { "bubble" : 1, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 315.0, 51.0 ], "style" : "", "text" : "Patch 7-040. Generate and Test\nWilliam J Turkel\nhttp://williamjturkel.net/code/#programming" } } , { "box" : { "angle" : 0.0, "bgcolor" : [ 1.0, 1.0, 1.0, 0.0 ], "border" : 1, "id" : "obj-3", "maxclass" : "panel", "mode" : 0, "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 77.5, 810.0, 495.0 ], "proportion" : 0.39, "rounded" : 20, "style" : "" } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-1", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-10", 0 ] } } , { "patchline" : { "destination" : [ "obj-10", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-104", 0 ] } } , { "patchline" : { "destination" : [ "obj-16", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-104", 1 ] } } , { "patchline" : { "destination" : [ "obj-24", 3 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-12", 0 ] } } , { "patchline" : { "destination" : [ "obj-20", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-14", 0 ] } } , { "patchline" : { "destination" : [ "obj-83", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-15", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-16", 0 ] } } , { "patchline" : { "destination" : [ "obj-15", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-19", 0 ] } } , { "patchline" : { "destination" : [ "obj-21", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-19", 0 ] } } , { "patchline" : { "destination" : [ "obj-22", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-20", 0 ] } } , { "patchline" : { "destination" : [ "obj-24", 2 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-23", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-24", 0 ] } } , { "patchline" : { "destination" : [ "obj-12", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-26", 1 ] } } , { "patchline" : { "destination" : [ "obj-23", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-26", 0 ] } } , { "patchline" : { "destination" : [ "obj-24", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 359.5, 375.0, 318.0, 375.0, 318.0, 417.0, 328.5, 417.0 ], "source" : [ "obj-26", 1 ] } } , { "patchline" : { "destination" : [ "obj-24", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-26", 0 ] } } , { "patchline" : { "destination" : [ "obj-104", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-8", 0 ] } } , { "patchline" : { "destination" : [ "obj-26", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 53.0, 375.0, 285.0, 375.0, 285.0, 342.0, 309.5, 342.0 ], "source" : [ "obj-8", 1 ] } } , { "patchline" : { "destination" : [ "obj-82", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-80", 0 ] } } , { "patchline" : { "destination" : [ "obj-82", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-81", 0 ] } } , { "patchline" : { "destination" : [ "obj-8", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-82", 0 ] } } , { "patchline" : { "destination" : [ "obj-80", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-83", 1 ] } } , { "patchline" : { "destination" : [ "obj-81", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-83", 0 ] } } , { "patchline" : { "destination" : [ "obj-20", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-9", 0 ] } } ], "dependency_cache" : [ ], "embedsnapshot" : 0, "default_bgcolor" : [ 0.207843, 0.215686, 0.278431, 1.0 ], "color" : [ 0.901961, 0.901961, 0.901961, 1.0 ], "elementcolor" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "accentcolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "selectioncolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "textcolor" : [ 0.090196, 0.07451, 0.07451, 1.0 ], "textcolor_inverse" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "patchlinecolor" : [ 0.207843, 0.215686, 0.278431, 0.9 ], "bgfillcolor_type" : "gradient", "bgfillcolor_color1" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color2" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color" : [ 0.290196, 0.309804, 0.301961, 1.0 ], "bgfillcolor_angle" : 270.0, "bgfillcolor_proportion" : 0.39 } }