{"id":4713,"date":"2021-09-21T07:32:00","date_gmt":"2021-09-21T11:32:00","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=4713"},"modified":"2021-09-21T15:54:55","modified_gmt":"2021-09-21T19:54:55","slug":"what-do-matlab-and-games-have-in-common","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2021\/09\/21\/what-do-matlab-and-games-have-in-common\/","title":{"rendered":"What Do MATLAB and Games Have in Common?"},"content":{"rendered":"<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Today I want to introduce you to <\/span><a href = \"https:\/\/medium.com\/@Jake_Mitchell\"><span>Jake Mitchell<\/span><\/a><span>, a MATLAB user that I knew of and someone recently reminded me of again. Jake is a mechanical engineering major who is interested in data science. He uses MATLAB to explore strategies and positions in various games, and then writes about it.  As he does, he shows the core code for the way pieces move and the game unfolds. <\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Games with Simple Rules<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Jake has really nice commentary about possible strategies, based on simulating many, many plays of each games.  In some cases, he also applies machine learning techniques to enable a machine to learn to play, such as <\/span><a href = \"https:\/\/towardsdatascience.com\/applying-machine-learning-to-tic-tac-toe-47d954671c73\"><span>tic-tac-toe.<\/span><\/a><span>  He's got an algorithm for playing <\/span><a href = \"https:\/\/towardsdatascience.com\/i-taught-a-machine-how-to-play-connect-4-df261da4e23f\"><span>Connect-4<\/span><\/a><span>, a fun post on <\/span><a href = \"https:\/\/towardsdatascience.com\/the-surprisingly-interesting-mathematics-within-chutes-and-ladders-40f931c18489\"><span>Chutes and Ladders<\/span><\/a><span>.  And he explores games that appear simple, or at least have simple governing rules, to ones that have much more nuance.<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Games with More Complexity<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I learned to play Settlers of Catan probably 15 years ago.  And I still play occasionally.  Now I will be armed with more strategic knowledge after reading Jake on <\/span><a href = \"https:\/\/medium.com\/codex\/the-best-and-worst-catan-board-setups-989df4ba550a\"><span>How I Built the Best Catan Board<\/span><\/a><span>.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Perhaps my favorite is Jake's analysis on the <\/span><a href = \"https:\/\/towardsdatascience.com\/simulating-monopoly-finding-the-best-properties-using-matlab-130fe557b1ae\"><span>value of Monopoly properties<\/span><\/a><span>.  He goes into all the different property types, adding houses and hotels, plus utilities and railroads.  And don't forget about going to jail!  I like the way Jake presents the results as well, sometimes in tables and sometimes in plots.  Here's a plot Jake allowed me to copy, showing the effects of houses and hotels on reaching break-even on the investment.  Plus I really like that he uses the same colors as the Monopoly game so you can easily tell which group of properties are which.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/loren\/files\/matlabGames_1.png\" width = \"560\" height = \"288\" alt = \"\" style = \"vertical-align: baseline\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I also like that he delves into the ins and outs of Boardwalk and Park Place!<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Games, Anyone?<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Have you made or analyzed games using MATLAB?  Clearly some people have, when I check out the <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange?q=game&amp;s_tid=srch_dym_sug\"><span>File Exchange<\/span><\/a><span>, or with <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?category%5B%5D=support%2Fgaming800&amp;q=game\"><span>this search<\/span><\/a><span>.  If you have, please share with us <\/span><a href = \"#respond\"><span>here<\/span><\/a><span>!<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span style=' font-style: italic; font-family: monospace;'>Copyright 2021 The MathWorks, Inc.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span><\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span><\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span><\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><\/div>\r\n<\/div><script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><a href=\"https:\/\/blogs.mathworks.com\/loren\/files\/matlabGames.mlx\"><button class=\"btn btn-sm btn_color_blue pull-right add_margin_10\">Download Live Script<\/button><\/a>","protected":false},"excerpt":{"rendered":"<p>Today I want to introduce you to Jake Mitchell, a MATLAB user that I knew of and someone recently reminded me of again. Jake is a mechanical engineering major who is interested in data science. He... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2021\/09\/21\/what-do-matlab-and-games-have-in-common\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[33],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/4713"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=4713"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/4713\/revisions"}],"predecessor-version":[{"id":4716,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/4713\/revisions\/4716"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=4713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=4713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=4713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}