{"id":573,"date":"2012-04-16T09:00:53","date_gmt":"2012-04-16T14:00:53","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=573"},"modified":"2012-04-16T09:00:53","modified_gmt":"2012-04-16T14:00:53","slug":"scalatron-rough-approach-and-running-code","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/573\/scalatron-rough-approach-and-running-code\/","title":{"rendered":"Scalatron: Rough Approach and Running Code"},"content":{"rendered":"<p>This weekend, I sat down and got comfy with <a href=\"http:\/\/scalatron.wordpress.com\/\">Scalatron<\/a>, a programming tutorial based around building a competitive bot in a game environment in Scala.<\/p>\n<p>At first, I was a bit stymied; with no Java-friendly IDE, and the instructions being really IDE targeted, I had some problems getting my development environment set up. Thanks to <a href=\"https:\/\/github.com\/dwins\/scalatron-template\">some help<\/a> from <a href=\"http:\/\/twitter.com\/#!\/godwinsgo\">godwinsgo<\/a> on Twitter, I got set up with an environment where I was able to have:<br \/>\n &#8211; Automatic compiling on file save, which was super helpful (rather than having to do something else)<br \/>\n &#8211; The ability to quickly swap back over, tap a button, and have Scalatron reload my bot and test it right away.<\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/DI2i3THk2to\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>After some playing, I wrote a bot that is pretty good: it gets ~22000 in the &#8216;reference&#8217; (bot on its own, 5000 steps, 100&#215;100 field). I have a better understanding of some of the simple mistakes that I made &#8212; adding a println at the end of my function when I have a return type expected will return a somewhat cryptic &#8220;Expected Type, Got Unit&#8221; error message pointing to a spot in my code that it doesn&#8217;t make sense to me; same with really any case where I&#8217;m not paying careful attention to return types, since without an explicit &#8216;return&#8217; statement, what gets returned is confusing to me.<\/p>\n<p>I probably wrote terrible Scala; I didn&#8217;t bother to learn much about the language, just enough to actually hack my bot into something that worked. (My bot is <a href=\"https:\/\/github.com\/crschmidt\/scalatron-bots\">on github<\/a>, if people want to critique my terrible Scala &#8212; or code in general.) However, I was able to get working, learned some things about Scala, and wrote a cool digital robot. (Hooray!)<\/p>\n<p>Thanks to David Winslow for giving me the bits to running, and to Scalatron for helping me have a fun project for this weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This weekend, I sat down and got comfy with Scalatron, a programming tutorial based around building a competitive bot in a game environment in Scala. At first, I was a bit stymied; with no Java-friendly IDE, and the instructions being really IDE targeted, I had some problems getting my development environment set up. Thanks to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=573"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/573\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}