{"id":134,"date":"2024-08-22T13:31:33","date_gmt":"2024-08-22T13:31:33","guid":{"rendered":"https:\/\/learnx.ca\/mt\/?page_id=134"},"modified":"2025-08-02T15:02:06","modified_gmt":"2025-08-02T15:02:06","slug":"coding-growing-patterns","status":"publish","type":"page","link":"https:\/\/learnx.ca\/mt\/coding-growing-patterns\/","title":{"rendered":"CODING PUZZLES"},"content":{"rendered":"\n<p>[<a href=\"#s\">Solutions<\/a>&nbsp;are shown after the puzzles]<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 1: Growing Patterns (Scratch)<\/h4>\n\n\n\n<p>Run the code at <a href=\"https:\/\/scratch.mit.edu\/projects\/964727477\/editor\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/scratch.mit.edu\/projects\/964727477\/editor<\/a> .<\/p>\n\n\n\n<p>You will see the list of numbers shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"388\" height=\"251\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c1.png\" alt=\"\" class=\"wp-image-174\" style=\"width:432px;height:auto\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c1.png 388w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c1-300x194.png 300w\" sizes=\"auto, (max-width: 388px) 85vw, 388px\" \/><\/figure>\n\n\n\n<p>This code represents the pattern shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"339\" height=\"83\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2.png\" alt=\"\" class=\"wp-image-175\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2.png 339w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2-300x73.png 300w\" sizes=\"auto, (max-width: 339px) 85vw, 339px\" \/><\/figure>\n\n\n\n<p>How would you edit the code to create each of the following lists of numbers?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"572\" height=\"209\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c3.png\" alt=\"\" class=\"wp-image-176\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c3.png 572w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c3-300x110.png 300w\" sizes=\"auto, (max-width: 572px) 85vw, 572px\" \/><\/figure>\n\n\n\n<p>Edit and run the code to test your predictions.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 2: Growing Patterns (Python)<\/h4>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"55\" height=\"231\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c6.png\" alt=\"\" class=\"wp-image-178\"\/><\/figure>\n<\/div>\n\n\n<p>Go to <a href=\"https:\/\/cscircles.cemc.uwaterloo.ca\/console\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/cscircles.cemc.uwaterloo.ca\/console<\/a> .<\/p>\n\n\n\n<p>Enter and run the code below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"242\" height=\"52\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c5.png\" alt=\"\" class=\"wp-image-177\" style=\"width:270px;height:auto\"\/><\/figure>\n\n\n\n<p>You will see the list of numbers shown on the right.<\/p>\n\n\n\n<p>This code represents the pattern shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"339\" height=\"83\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2-1.png\" alt=\"\" class=\"wp-image-179\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2-1.png 339w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c2-1-300x73.png 300w\" sizes=\"auto, (max-width: 339px) 85vw, 339px\" \/><\/figure>\n\n\n\n<p>How would you edit the code to create each of the flowing lists of numbers?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"246\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c7.png\" alt=\"\" class=\"wp-image-180\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c7.png 542w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c7-300x136.png 300w\" sizes=\"auto, (max-width: 542px) 85vw, 542px\" \/><\/figure>\n\n\n\n<p>Edit and run the code to test your predictions.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 3: Plotting linear relations (Scratch)<\/h4>\n\n\n\n<p>Go to <a href=\"https:\/\/scratch.mit.edu\/projects\/556330557\/editor\">https:\/\/scratch.mit.edu\/projects\/556330557\/editor<\/a> to see and run the code below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"406\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations.png\" alt=\"\" class=\"wp-image-462\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations.png 828w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-300x147.png 300w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-768x377.png 768w\" sizes=\"auto, (max-width: 828px) 85vw, 828px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Alter the code to create each of the plots below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"498\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-puzzles3.png\" alt=\"\" class=\"wp-image-465\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-puzzles3.png 600w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-puzzles3-300x249.png 300w\" sizes=\"auto, (max-width: 600px) 85vw, 600px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading has-dark-gray-color has-text-color has-link-color wp-elements-fd657f999b5c075dfd639e73e4ea691e\" id=\"s\">SOLUTIONS<\/h1>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 1<\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"130\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c4.png\" alt=\"\" class=\"wp-image-182\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c4.png 549w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c4-300x71.png 300w\" sizes=\"auto, (max-width: 549px) 85vw, 549px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 2<\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"145\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c8.png\" alt=\"\" class=\"wp-image-183\" srcset=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c8.png 621w, https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/08\/trains-c8-300x70.png 300w\" sizes=\"auto, (max-width: 621px) 85vw, 621px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">CODING PUZZLE 3<\/h4>\n\n\n\n<p>a\/b\/c<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"237\" height=\"177\" src=\"https:\/\/learnx.ca\/mt\/wp-content\/uploads\/2024\/09\/scratch-linear-equations-puzzles3-solutions.png\" alt=\"\" class=\"wp-image-467\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Solutions&nbsp;are shown after the puzzles] CODING PUZZLE 1: Growing Patterns (Scratch) Run the code at https:\/\/scratch.mit.edu\/projects\/964727477\/editor . You will see the list of numbers shown below. This code represents the pattern shown below. How would you edit the code to create each of the following lists of numbers? Edit and run the code to test &hellip; <a href=\"https:\/\/learnx.ca\/mt\/coding-growing-patterns\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CODING PUZZLES&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-134","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/pages\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":14,"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/pages\/134\/revisions"}],"predecessor-version":[{"id":760,"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/pages\/134\/revisions\/760"}],"wp:attachment":[{"href":"https:\/\/learnx.ca\/mt\/wp-json\/wp\/v2\/media?parent=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}