{"id":9394,"date":"2018-01-26T09:00:54","date_gmt":"2018-01-26T14:00:54","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=9394"},"modified":"2021-11-21T12:57:00","modified_gmt":"2021-11-21T17:57:00","slug":"whac-a-mole-with-arduino","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2018\/01\/26\/whac-a-mole-with-arduino\/","title":{"rendered":"Whac-a-Mole with Arduino"},"content":{"rendered":"<div class=\"content\">\r\n\r\n<a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\">Jiro<\/a>&#8216;s pick this week is <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/58785 (link no longer works)\">Whac-a-Mole with Arduino<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/8350051\">Sophia Hubscher<\/a>.\r\n\r\n<img decoding=\"async\" src=\"https:\/\/jp.mathworks.com\/matlabcentral\/mlc-downloads\/downloads\/submissions\/58785\/versions\/2\/screenshot.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n\r\nHere&#8217;s a fun classic arcade game, Whac-a-Mole, built using Arduino. What do I like about it?\r\n<div>\r\n<ul>\r\n \t<li>The program is nicely written and is very well commented. You can just read the program and understand exactly what it is doing.<\/li>\r\n \t<li>I love the <a href=\"https:\/\/youtu.be\/u-xmr2ZtBlE\">video<\/a>, where Sophia explains how the program works and shows the game in action.<\/li>\r\n \t<li>This material can be used in a STEM education setting.<\/li>\r\n \t<li>Oh, and she was only 13 when she made this!! Okay, I was <b>NOT<\/b> writing programs when I was 13.<\/li>\r\n<\/ul>\r\n<\/div>\r\nGreat job, Sophia! Looking forward to your next program!\r\n\r\n<b>Comments<\/b>\r\n\r\nGive it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=9394#respond\">here<\/a> or leave a comment for Sophia.\r\n\r\n<script language=\"JavaScript\"> <!-- \r\n    function grabCode_bb88b4d0043442819f50f551e380be80() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='bb88b4d0043442819f50f551e380be80 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' bb88b4d0043442819f50f551e380be80';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2018 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<\/p>\r\n<p>\r\n<\/p>\r\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\r\n<p>\r\n<\/p>\r\n<p>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\"><a><span style=\"font-size: x-small; font-style: italic;\">Get\r\nthe MATLAB code<noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\r\nPublished with MATLAB\u00ae R2017b\r\n<p class=\"footer\">Published with MATLAB\u00ae R2017b<\/p>\r\n\r\n<\/div>\r\n<!--\r\nbb88b4d0043442819f50f551e380be80 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871 Jiro>'s\r\n% pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/58785 Whac-a-Mole % with Arduino> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/8350051 Sophia % Hubscher>.\r\n%\r\n% <<https:\/\/jp.mathworks.com\/matlabcentral\/mlc-downloads\/downloads\/submissions\/58785\/versions\/2\/screenshot.png>>\r\n%\r\n% Here's a fun classic arcade game, Whac-a-Mole, built using Arduino. What\r\n% do I like about it?\r\n%\r\n% * The program is nicely written and is very well commented. You can just\r\n% read the program and understand exactly what it is doing.\r\n% * I love the <https:\/\/youtu.be\/u-xmr2ZtBlE video>, where Sophia explains\r\n% how the program works and shows the game in action.\r\n% * This material can be used in a STEM education setting.\r\n% * Oh, and she was only 13 when she made this!! Okay, I was *NOT* writing\r\n% programs when I was 13.\r\n%\r\n% Great job, Sophia! Looking forward to your next program!\r\n%\r\n% *Comments*\r\n%\r\n% Give it a try and let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=9394#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/58785#comment % comment> for Sophia.\r\n\r\n##### SOURCE END ##### bb88b4d0043442819f50f551e380be80\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/jp.mathworks.com\/matlabcentral\/mlc-downloads\/downloads\/submissions\/58785\/versions\/2\/screenshot.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n\r\nJiro&#8216;s pick this week is Whac-a-Mole with Arduino by Sophia Hubscher.\r\n\r\n\r\n\r\nHere&#8217;s a fun classic arcade game, Whac-a-Mole, built using Arduino. What do I like about it?\r\n\r\n\r\n \tThe&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2018\/01\/26\/whac-a-mole-with-arduino\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9394"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=9394"}],"version-history":[{"count":7,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9394\/revisions"}],"predecessor-version":[{"id":14409,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9394\/revisions\/14409"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=9394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=9394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=9394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}