{"action":"created","comment":{"url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/comments/85047002","pull_request_review_id":5783855,"id":85047002,"diff_hunk":"@@ -0,0 +1,269 @@\n+package piconot.internal\n+\n+import scala.language.implicitConversions\n+import picolib.maze.Maze\n+import scala.collection._\n+import scalafx.application.JFXApp\n+import util.control.Breaks._\n+import picolib.semantics._\n+import java.io.File\n+\n+\n+\n+case class Program(labels: List[Label]) {\n+  val processor = new PicoPrgrm(\"empty.txt\", NORTH)\n+  System.out.println(processor.labelStates)\n+  System.out.println(processor.direction)\n+  processor.process(labels, processor.labelStates) // create initial label map\n+  val rules = processor.buildrules(labels) // for each element in a label, create a rule\n+  processor.execute(rules)\n+}\n+\n+class PicoPrgrm(val mazeFilename: String, dir: Direction) extends JFXApp {\n+\n+  var labelStates = mutable.Map.empty[String, Int]\n+  var direction: Direction = dir\n+  var stCounter = 0\n+  \n+  def execute(rules: List[Rule]) = {\n+    val maze = Maze(\"resources\" + File.separator + mazeFilename)\n+    object EmptyBot extends Picobot(maze, rules)\n+      with TextDisplay with GUIDisplay\n+\n+    stage = EmptyBot.mainStage\n+\n+    EmptyBot.run()\n+  }\n+\n+\n+  def process(labels: List[Label], labelMap: Map[String, Int]) = {\n+    var counter = 1\n+\n+    System.out.println(labels.toString())\n+    // Create a map that goes from top-level label to it's starting state\n+    labels.foreach((label: Label) => {\n+//      breakable {\n+      System.out.println(\"Label States in first\" + labelMap)\n+        if (labelMap == Map.empty) {\n+         labelMap + (label.name -> 0)\n+          System.out.println(\"Label States in first, if\" + labelMap)\n+          //break\n+        }\n+//      }\n+      label.rules.foreach((rule: Rules) => {\n+        System.out.println(\"Label States in second\" + labelMap)\n+        rule match {\n+          case Face(dir) => counter = counter + 1\n+          case _         => 0\n+        }\n+      })\n+      \n+      System.out.println(label)\n+      System.out.println(label.name)\n+      System.out.println(labelMap)\n+      System.out.println(counter)\n+      labelMap + (label.name -> counter)\n+\n+    })\n+  }\n+\n+  def buildrules(rules: List[Label]) = {\n+    var builtRules: List[picolib.semantics.Rule] = List()\n+\n+    rules.foreach((label: Label) => {\n+\n+      label.rules.foreach((rule: Rules) => {\n+        rule match {\n+          case Face(dir) => builtRules = builtRules ++ List(evalFace(dir))\n+          case Go(sur)   => builtRules = builtRules ++ List(evalGo(sur))\n+          case Jump(lbl) => builtRules = builtRules ++ List(evalJump(lbl))\n+        }\n+\n+      })\n+    })\n+    builtRules\n+  }\n+\n+  def evalFace(dir: Direction): Rule = {\n+    direction = dir\n+    stCounter += 1\n+    Rule(State(stCounter - 1 + \"\"), Surroundings(Anything, Anything, Anything, Anything), StayHere, State(stCounter + \"\"))\n+  }\n+\n+  def evalGo(sur: Surrounding): Rule = {\n+    var surRule = Surroundings(Anything, Anything, Anything, Anything)\n+    var dirRule: MoveDirection = North\n+    if (direction == NORTH) {","path":"src/main/scala/piconot/internal/Language.scala","position":96,"original_position":96,"commit_id":"3a2421390436befa4ce15724fe23de1bbd4dc170","original_commit_id":"3a2421390436befa4ce15724fe23de1bbd4dc170","user":{"login":"danielsonner","id":538370,"avatar_url":"https://avatars.githubusercontent.com/u/538370?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsonner","html_url":"https://github.com/danielsonner","followers_url":"https://api.github.com/users/danielsonner/followers","following_url":"https://api.github.com/users/danielsonner/following{/other_user}","gists_url":"https://api.github.com/users/danielsonner/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsonner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsonner/subscriptions","organizations_url":"https://api.github.com/users/danielsonner/orgs","repos_url":"https://api.github.com/users/danielsonner/repos","events_url":"https://api.github.com/users/danielsonner/events{/privacy}","received_events_url":"https://api.github.com/users/danielsonner/received_events","type":"User","site_admin":false},"body":"if certainly works, although I feel like pattern matching might've been a little more scala-y","created_at":"2016-10-26T04:14:10Z","updated_at":"2016-10-26T04:18:12Z","html_url":"https://github.com/hmc-cs111-fall2016/piconot/pull/9#discussion_r85047002","pull_request_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/comments/85047002"},"html":{"href":"https://github.com/hmc-cs111-fall2016/piconot/pull/9#discussion_r85047002"},"pull_request":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9","id":90553913,"html_url":"https://github.com/hmc-cs111-fall2016/piconot/pull/9","diff_url":"https://github.com/hmc-cs111-fall2016/piconot/pull/9.diff","patch_url":"https://github.com/hmc-cs111-fall2016/piconot/pull/9.patch","issue_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/9","number":9,"state":"open","locked":false,"title":"Woky & Ross & Anthony","user":{"login":"wpark","id":10727193,"avatar_url":"https://avatars.githubusercontent.com/u/10727193?v=3","gravatar_id":"","url":"https://api.github.com/users/wpark","html_url":"https://github.com/wpark","followers_url":"https://api.github.com/users/wpark/followers","following_url":"https://api.github.com/users/wpark/following{/other_user}","gists_url":"https://api.github.com/users/wpark/gists{/gist_id}","starred_url":"https://api.github.com/users/wpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpark/subscriptions","organizations_url":"https://api.github.com/users/wpark/orgs","repos_url":"https://api.github.com/users/wpark/repos","events_url":"https://api.github.com/users/wpark/events{/privacy}","received_events_url":"https://api.github.com/users/wpark/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-24T06:07:17Z","updated_at":"2016-10-26T04:18:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25309e1becc15ea5cef230169e2468d2b986f096","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9/commits","review_comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9/comments","review_comment_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/9/comments","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/statuses/3a2421390436befa4ce15724fe23de1bbd4dc170","head":{"label":"wpark:master","ref":"master","sha":"3a2421390436befa4ce15724fe23de1bbd4dc170","user":{"login":"wpark","id":10727193,"avatar_url":"https://avatars.githubusercontent.com/u/10727193?v=3","gravatar_id":"","url":"https://api.github.com/users/wpark","html_url":"https://github.com/wpark","followers_url":"https://api.github.com/users/wpark/followers","following_url":"https://api.github.com/users/wpark/following{/other_user}","gists_url":"https://api.github.com/users/wpark/gists{/gist_id}","starred_url":"https://api.github.com/users/wpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpark/subscriptions","organizations_url":"https://api.github.com/users/wpark/orgs","repos_url":"https://api.github.com/users/wpark/repos","events_url":"https://api.github.com/users/wpark/events{/privacy}","received_events_url":"https://api.github.com/users/wpark/received_events","type":"User","site_admin":false},"repo":{"id":70530810,"name":"piconot","full_name":"wpark/piconot","owner":{"login":"wpark","id":10727193,"avatar_url":"https://avatars.githubusercontent.com/u/10727193?v=3","gravatar_id":"","url":"https://api.github.com/users/wpark","html_url":"https://github.com/wpark","followers_url":"https://api.github.com/users/wpark/followers","following_url":"https://api.github.com/users/wpark/following{/other_user}","gists_url":"https://api.github.com/users/wpark/gists{/gist_id}","starred_url":"https://api.github.com/users/wpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpark/subscriptions","organizations_url":"https://api.github.com/users/wpark/orgs","repos_url":"https://api.github.com/users/wpark/repos","events_url":"https://api.github.com/users/wpark/events{/privacy}","received_events_url":"https://api.github.com/users/wpark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wpark/piconot","description":"Assignment 5: Designing a syntax and implementing it as an internal and external DSL","fork":true,"url":"https://api.github.com/repos/wpark/piconot","forks_url":"https://api.github.com/repos/wpark/piconot/forks","keys_url":"https://api.github.com/repos/wpark/piconot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wpark/piconot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wpark/piconot/teams","hooks_url":"https://api.github.com/repos/wpark/piconot/hooks","issue_events_url":"https://api.github.com/repos/wpark/piconot/issues/events{/number}","events_url":"https://api.github.com/repos/wpark/piconot/events","assignees_url":"https://api.github.com/repos/wpark/piconot/assignees{/user}","branches_url":"https://api.github.com/repos/wpark/piconot/branches{/branch}","tags_url":"https://api.github.com/repos/wpark/piconot/tags","blobs_url":"https://api.github.com/repos/wpark/piconot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wpark/piconot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wpark/piconot/git/refs{/sha}","trees_url":"https://api.github.com/repos/wpark/piconot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wpark/piconot/statuses/{sha}","languages_url":"https://api.github.com/repos/wpark/piconot/languages","stargazers_url":"https://api.github.com/repos/wpark/piconot/stargazers","contributors_url":"https://api.github.com/repos/wpark/piconot/contributors","subscribers_url":"https://api.github.com/repos/wpark/piconot/subscribers","subscription_url":"https://api.github.com/repos/wpark/piconot/subscription","commits_url":"https://api.github.com/repos/wpark/piconot/commits{/sha}","git_commits_url":"https://api.github.com/repos/wpark/piconot/git/commits{/sha}","comments_url":"https://api.github.com/repos/wpark/piconot/comments{/number}","issue_comment_url":"https://api.github.com/repos/wpark/piconot/issues/comments{/number}","contents_url":"https://api.github.com/repos/wpark/piconot/contents/{+path}","compare_url":"https://api.github.com/repos/wpark/piconot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wpark/piconot/merges","archive_url":"https://api.github.com/repos/wpark/piconot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wpark/piconot/downloads","issues_url":"https://api.github.com/repos/wpark/piconot/issues{/number}","pulls_url":"https://api.github.com/repos/wpark/piconot/pulls{/number}","milestones_url":"https://api.github.com/repos/wpark/piconot/milestones{/number}","notifications_url":"https://api.github.com/repos/wpark/piconot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wpark/piconot/labels{/name}","releases_url":"https://api.github.com/repos/wpark/piconot/releases{/id}","deployments_url":"https://api.github.com/repos/wpark/piconot/deployments","created_at":"2016-10-10T21:35:36Z","updated_at":"2016-10-10T21:35:37Z","pushed_at":"2016-10-24T06:42:00Z","git_url":"git://github.com/wpark/piconot.git","ssh_url":"git@github.com:wpark/piconot.git","clone_url":"https://github.com/wpark/piconot.git","svn_url":"https://github.com/wpark/piconot","homepage":null,"size":2108,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hmc-cs111-fall2016:master","ref":"master","sha":"4205a14e0896aa5367635ff22a73b3286d8ce01c","user":{"login":"hmc-cs111-fall2016","id":20343278,"avatar_url":"https://avatars.githubusercontent.com/u/20343278?v=3","gravatar_id":"","url":"https://api.github.com/users/hmc-cs111-fall2016","html_url":"https://github.com/hmc-cs111-fall2016","followers_url":"https://api.github.com/users/hmc-cs111-fall2016/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2016/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2016/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2016/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2016/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2016/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2016/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2016/received_events","type":"Organization","site_admin":false},"repo":{"id":70127764,"name":"piconot","full_name":"hmc-cs111-fall2016/piconot","owner":{"login":"hmc-cs111-fall2016","id":20343278,"avatar_url":"https://avatars.githubusercontent.com/u/20343278?v=3","gravatar_id":"","url":"https://api.github.com/users/hmc-cs111-fall2016","html_url":"https://github.com/hmc-cs111-fall2016","followers_url":"https://api.github.com/users/hmc-cs111-fall2016/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2016/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2016/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2016/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2016/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2016/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2016/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmc-cs111-fall2016/piconot","description":"Assignment 5: Designing a syntax and implementing it as an internal and external DSL","fork":false,"url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot","forks_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/forks","keys_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/teams","hooks_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/hooks","issue_events_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/events{/number}","events_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/events","assignees_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/assignees{/user}","branches_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/branches{/branch}","tags_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/tags","blobs_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/statuses/{sha}","languages_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/languages","stargazers_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/stargazers","contributors_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/contributors","subscribers_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/subscribers","subscription_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/subscription","commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/contents/{+path}","compare_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/merges","archive_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/downloads","issues_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues{/number}","pulls_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls{/number}","milestones_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/milestones{/number}","notifications_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/labels{/name}","releases_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/releases{/id}","deployments_url":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/deployments","created_at":"2016-10-06T06:15:02Z","updated_at":"2016-10-06T06:31:02Z","pushed_at":"2016-10-25T10:45:38Z","git_url":"git://github.com/hmc-cs111-fall2016/piconot.git","ssh_url":"git@github.com:hmc-cs111-fall2016/piconot.git","clone_url":"https://github.com/hmc-cs111-fall2016/piconot.git","svn_url":"https://github.com/hmc-cs111-fall2016/piconot","homepage":null,"size":2135,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":8,"forks":11,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9"},"html":{"href":"https://github.com/hmc-cs111-fall2016/piconot/pull/9"},"issue":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/9"},"comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/piconot/statuses/3a2421390436befa4ce15724fe23de1bbd4dc170"}}}}
{"actor":{"display_login":"danielsonner"}}