{"id":372,"date":"2012-05-29T10:07:37","date_gmt":"2012-05-29T15:07:37","guid":{"rendered":"http:\/\/scottcsims.com\/wordpress\/?p=372"},"modified":"2016-07-12T11:14:02","modified_gmt":"2016-07-12T16:14:02","slug":"minesweeper-programming-contest-using-selenium-web-driver-to-win-minesweeper","status":"publish","type":"post","link":"http:\/\/scottcsims.com\/wordpress\/?p=372","title":{"rendered":"Minesweeper Programming Contest. Using Selenium Web Driver to win Minesweeper"},"content":{"rendered":"<p>I had a great time attending the <a title=\"Test Automation Bazaar\" href=\"http:\/\/watir.com\/test-automation-bazaar\/\">Test Automation Bazaar <\/a>\u00a0in Austin. Alister Scott put on a <a title=\"Minesweeper\" href=\"http:\/\/watir.com\/test-automation-bazaar\/minesweeper-challenge\/\">contest<\/a> to see who could write a program to win Minesweeper. \u00a0After checking out what was required, I started coding the Minesweeper robot. Before I noticed, I had spent hours coding tests and methods for the robot. \u00a0It was one of the most addictive and exciting code I had written. \u00a0I spent about 3 days coding along to get something to win on basic and intermediate level. I spent hours trying to win on advanced.<\/p>\n<p>I ended up\u00a0<a href=\"http:\/\/watirmelon.com\/2012\/03\/27\/introducing-einstien-the-minesweeper-robot\/\">winning<\/a> the Minesweeper Challenge! \u00a0I encourage everyone to take a look at Alister&#8217;s <a href=\"https:\/\/github.com\/minesweeper\/minesweeper-robot\">code<\/a>. \u00a0Alister wrote some of the \u00a0best cukes and examples I have seen. \u00a0I was very impressed by the time he put into writing unit tests that work on logic only, taking the browser out of the mix. \u00a0Thanks Alister for putting on the contest. \u00a0If you wish to see what 3 days of coding gets you in a mine sweeper robot you can checkout my code on <a href=\"https:\/\/github.com\/scottcsims\/MineSweeperRobot\">github<\/a>. \u00a0As I mentioned before I got really engaged with writing this code. \u00a0I could have spent weeks tuning and polishing it. \u00a0I did have a chance to\u00a0refractor\u00a0the code to use\u00a0Nokogiri instead of the find all elements selenium method to check the game state. \u00a0I believe that this might have actually slowed it down.<\/p>\n<p>Sadly to say, I had to withdraw from polishing and tuning the code. \u00a0If you want to run my robot checkout the code and run the test &#8220;Minesweeper should win&#8221; in this <a href=\"https:\/\/github.com\/scottcsims\/MineSweeperRobot\/blob\/master\/spec\/mine_sweeper_spec.rb\">file<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a great time attending the Test Automation Bazaar \u00a0in Austin. Alister Scott put on a contest to see who could write a program to win Minesweeper. \u00a0After checking out what was required, I started coding the Minesweeper robot. Before I noticed, I had spent hours coding tests and methods for the robot. \u00a0It [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[30],"tags":[],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-selenium-software"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372"}],"version-history":[{"count":9,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":468,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions\/468"}],"wp:attachment":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}