{"id":131,"date":"2010-10-20T17:04:41","date_gmt":"2010-10-20T22:04:41","guid":{"rendered":"http:\/\/jebware.com\/blog\/?p=131"},"modified":"2015-01-11T23:33:04","modified_gmt":"2015-01-12T04:33:04","slug":"24-game-solver","status":"publish","type":"post","link":"https:\/\/jebware.com\/blog\/?p=131","title":{"rendered":"24 Game Solver"},"content":{"rendered":"<p>My wife teaches elementary-school math, and I&#8217;m somewhat of a math nerd, so <a href=\"http:\/\/en.wikipedia.org\/wiki\/24_Game\">the 24 game<\/a> is right up our alley. \u00a0Basically, you&#8217;re given four numbers, and you have to find a series of operations that makes 24 from those numbers. \u00a0For example, given 1, 2, 3, and 4, you might respond that \u00a01*2*3*4 = 24. \u00a0Some sets of numbers are harder than others (much harder).<\/p>\n<p>One day, my wife and her class were having trouble solving a particularly hard set, so she emailed me for help. \u00a0It took me a while to find the answer, and all the while I was thinking to myself &#8220;Self, I&#8217;m a programmer. \u00a0Why am I doing this the hard way?&#8221; \u00a0So now I&#8217;ve created the easy (cheater) way. \u00a0Go to <a href=\"http:\/\/jebware.com\/24\">http:\/\/jebware.com\/24<\/a> input your 4 numbers, and it will tell you how to make 24.<\/p>\n<p>Right now it does addition, subtraction, multiplication, division, and exponentiation. \u00a0However, it doesn&#8217;t understand the commutative property, so you&#8217;ll get a lot of answers that are essentially the same, like (1*2)*(3*4) and (4*3)*(2*1). I wrote it in javascript, and if you want the source or you want to improve on it, I made\u00a0<a href=\"http:\/\/github.com\/jebstuart\/solve24\">a repository on GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My wife teaches elementary-school math, and I&#8217;m somewhat of a math nerd, so the 24 game is right up our alley. \u00a0Basically, you&#8217;re given four numbers, and you have to find a series of operations that makes 24 from those numbers. \u00a0For example, given 1, 2, 3, and 4, you might respond that \u00a01*2*3*4 = &hellip; <a href=\"https:\/\/jebware.com\/blog\/?p=131\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;24 Game Solver&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"twitterCardType":"","cardImageID":0,"cardImage":"","cardTitle":"","cardDesc":"","cardImageAlt":"","cardPlayer":"","cardPlayerWidth":0,"cardPlayerHeight":0,"cardPlayerStream":"","cardPlayerCodec":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/131"}],"collection":[{"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131"}],"version-history":[{"count":5,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jebware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}