{"action":"created","comment":{"url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/comments/26122856","id":26122856,"diff_hunk":"@@ -0,0 +1,324 @@\n+WIDTH = 8\n+LETTER = {\"A\" => 0,\n+            \"B\" => 1,\n+            \"C\" => 2,\n+            \"D\" => 3,\n+            \"E\" => 4,\n+            \"F\" => 5,\n+            \"G\" => 6,\n+            \"H\" => 7 }\n+class Board\n+  def initialize\n+    @board = Array.new(WIDTH) {WIDTH.times.map{[]}}\n+    @removed = []\n+    @poss_moves = []\n+  end\n+\n+  def clear\n+    @board.clear\n+  end\n+\n+  def start\n+    @board.map.with_index do |row, row_i|\n+      if row_i== 1 || row_i == 6\n+        row.map.with_index do |square, square_i|\n+          square << Pawn.new([row_i, square_i])\n+        end\n+      elsif row_i == 0 || row_i == WIDTH-1\n+        row.map.with_index do |square,square_i|\n+          if square_i == 0 || square_i == WIDTH-1\n+            square << Rook.new([row_i, square_i])\n+          elsif square_i == 1 || square_i == WIDTH-2\n+            square << Knight.new([row_i, square_i])\n+          elsif square_i ==2 || square_i == WIDTH-3\n+            square << Bishop.new([row_i, square_i])\n+          elsif square_i == 3\n+            square << Queen.new([row_i, square_i])\n+          else\n+            square << King.new([row_i, square_i])\n+          end\n+        end\n+      end\n+\n+##changing pieces (black) to white when on rows 6 & 7\n+\n+##PROBLEM: because square is in an array containing the piece, we have to use #first to access the piece itself.\n+# If *not* in an array, can directly access.\n+      if row_i == WIDTH-2 || row_i == WIDTH-1\n+        row.map do |square|\n+          square.first.color = \"white\"\n+        end\n+      end\n+    end\n+    @board\n+  end\n+\n+  #  def remove\n+  #   #TODO: remove pieces if piece.captured == true\n+  #   #stores removed pieces in removed array.\n+  #   @board.map.with_index |row, row_i|\n+  #     row.map.with_index\n+  #   end\n+  # end\n+\n+  def move_valid(coordinate)\n+    @poss_moves.clear\n+    square = @board[8-coordinate[1]][LETTER[coordinate[0]]]\n+    if square.empty?\n+      puts \"This is empty!\"\n+    else\n+      piece = square.first\n+    end\n+    p piece\n+    # piece.moves.each do |coordinate|\n+    # @board.each_with_index do |row, row_i|\n+    #   row.each_with_index do |square, square_i|\n+    piece.moves.each do |coordinate_set|\n+      coordinate_set.each do |x,y|\n+        if !@board[x][y].empty?\n+          if piece.color != @board[x][y][0].color\n+            @poss_moves << [x, y]\n+            break\n+          else\n+            break\n+          end\n+        end\n+        @poss_moves 5\n+        << [x, y] if @board[x][y].empty?","path":"board.rb","position":87,"original_position":87,"commit_id":"1df3263ff9dea3176b0b5d68b8e350fa3399354c","original_commit_id":"1df3263ff9dea3176b0b5d68b8e350fa3399354c","user":{"login":"zencephalon","id":1297679,"avatar_url":"https://avatars.githubusercontent.com/u/1297679?v=3","gravatar_id":"","url":"https://api.github.com/users/zencephalon","html_url":"https://github.com/zencephalon","followers_url":"https://api.github.com/users/zencephalon/followers","following_url":"https://api.github.com/users/zencephalon/following{/other_user}","gists_url":"https://api.github.com/users/zencephalon/gists{/gist_id}","starred_url":"https://api.github.com/users/zencephalon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zencephalon/subscriptions","organizations_url":"https://api.github.com/users/zencephalon/orgs","repos_url":"https://api.github.com/users/zencephalon/repos","events_url":"https://api.github.com/users/zencephalon/events{/privacy}","received_events_url":"https://api.github.com/users/zencephalon/received_events","type":"User","site_admin":false},"body":"Assuming a typo happened here.","created_at":"2015-03-10T13:55:19Z","updated_at":"2015-03-10T13:55:19Z","html_url":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2#discussion_r26122856","pull_request_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/comments/26122856"},"html":{"href":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2#discussion_r26122856"},"pull_request":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2","id":30711838,"html_url":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2","diff_url":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2.diff","patch_url":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2.patch","issue_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/2","number":2,"state":"open","locked":false,"title":"Almost there!","user":{"login":"gellieb","id":8163410,"avatar_url":"https://avatars.githubusercontent.com/u/8163410?v=3","gravatar_id":"","url":"https://api.github.com/users/gellieb","html_url":"https://github.com/gellieb","followers_url":"https://api.github.com/users/gellieb/followers","following_url":"https://api.github.com/users/gellieb/following{/other_user}","gists_url":"https://api.github.com/users/gellieb/gists{/gist_id}","starred_url":"https://api.github.com/users/gellieb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gellieb/subscriptions","organizations_url":"https://api.github.com/users/gellieb/orgs","repos_url":"https://api.github.com/users/gellieb/repos","events_url":"https://api.github.com/users/gellieb/events{/privacy}","received_events_url":"https://api.github.com/users/gellieb/received_events","type":"User","site_admin":false},"body":">>Check at Board.rb\r\n\r\nOur board looks pretty, the display works and will refresh after each turn. The pieces functionality is in tact. Each piece has the correct moves/path. We have a conversion method that converts the Letter/numbers from user input to corresponding array points.\r\n\r\nWe will sort out the classes into separate files so that it's more readable.    \r\n\r\nThings we still need to do\r\n>create a capture/remove method \r\n>check if white/black player is choosing their own piece\r\n>check if player is picking a valid move (piece that doesn't have zero moves, else try again)\r\n>check if game ends (are both kings still on the board?)\r\n\r\n@queerviolet @zencephalon @steppinlo @mbouzi @ebutler90 ","created_at":"2015-03-08T00:05:09Z","updated_at":"2015-03-10T13:55:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"862821e64881cea9a8c6bd1c03138ed20c1f0136","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2/commits","review_comments_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2/comments","review_comment_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/2/comments","statuses_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/statuses/1df3263ff9dea3176b0b5d68b8e350fa3399354c","head":{"label":"nyc-sea-lions-2015:SEAM_chess","ref":"SEAM_chess","sha":"1df3263ff9dea3176b0b5d68b8e350fa3399354c","user":{"login":"nyc-sea-lions-2015","id":10661432,"avatar_url":"https://avatars.githubusercontent.com/u/10661432?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-sea-lions-2015","html_url":"https://github.com/nyc-sea-lions-2015","followers_url":"https://api.github.com/users/nyc-sea-lions-2015/followers","following_url":"https://api.github.com/users/nyc-sea-lions-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-sea-lions-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-sea-lions-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-sea-lions-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-sea-lions-2015/orgs","repos_url":"https://api.github.com/users/nyc-sea-lions-2015/repos","events_url":"https://api.github.com/users/nyc-sea-lions-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-sea-lions-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":31698110,"name":"chess-challenge","full_name":"nyc-sea-lions-2015/chess-challenge","owner":{"login":"nyc-sea-lions-2015","id":10661432,"avatar_url":"https://avatars.githubusercontent.com/u/10661432?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-sea-lions-2015","html_url":"https://github.com/nyc-sea-lions-2015","followers_url":"https://api.github.com/users/nyc-sea-lions-2015/followers","following_url":"https://api.github.com/users/nyc-sea-lions-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-sea-lions-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-sea-lions-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-sea-lions-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-sea-lions-2015/orgs","repos_url":"https://api.github.com/users/nyc-sea-lions-2015/repos","events_url":"https://api.github.com/users/nyc-sea-lions-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-sea-lions-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-sea-lions-2015/chess-challenge","description":"Build a command line chess game with OOP.","fork":true,"url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge","forks_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/forks","keys_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/teams","hooks_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/hooks","issue_events_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/events","assignees_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/tags","blobs_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/languages","stargazers_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/stargazers","contributors_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/contributors","subscribers_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/subscribers","subscription_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/subscription","commits_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/merges","archive_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/downloads","issues_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/labels{/name}","releases_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/releases{/id}","created_at":"2015-03-05T05:49:47Z","updated_at":"2015-03-05T05:50:03Z","pushed_at":"2015-03-09T00:54:15Z","git_url":"git://github.com/nyc-sea-lions-2015/chess-challenge.git","ssh_url":"git@github.com:nyc-sea-lions-2015/chess-challenge.git","clone_url":"https://github.com/nyc-sea-lions-2015/chess-challenge.git","svn_url":"https://github.com/nyc-sea-lions-2015/chess-challenge","homepage":null,"size":478,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"nyc-sea-lions-2015:master","ref":"master","sha":"ab0feb1ef475b8fefa917dab06a3103af434fc97","user":{"login":"nyc-sea-lions-2015","id":10661432,"avatar_url":"https://avatars.githubusercontent.com/u/10661432?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-sea-lions-2015","html_url":"https://github.com/nyc-sea-lions-2015","followers_url":"https://api.github.com/users/nyc-sea-lions-2015/followers","following_url":"https://api.github.com/users/nyc-sea-lions-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-sea-lions-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-sea-lions-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-sea-lions-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-sea-lions-2015/orgs","repos_url":"https://api.github.com/users/nyc-sea-lions-2015/repos","events_url":"https://api.github.com/users/nyc-sea-lions-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-sea-lions-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":31698110,"name":"chess-challenge","full_name":"nyc-sea-lions-2015/chess-challenge","owner":{"login":"nyc-sea-lions-2015","id":10661432,"avatar_url":"https://avatars.githubusercontent.com/u/10661432?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-sea-lions-2015","html_url":"https://github.com/nyc-sea-lions-2015","followers_url":"https://api.github.com/users/nyc-sea-lions-2015/followers","following_url":"https://api.github.com/users/nyc-sea-lions-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-sea-lions-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-sea-lions-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-sea-lions-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-sea-lions-2015/orgs","repos_url":"https://api.github.com/users/nyc-sea-lions-2015/repos","events_url":"https://api.github.com/users/nyc-sea-lions-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-sea-lions-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-sea-lions-2015/chess-challenge","description":"Build a command line chess game with OOP.","fork":true,"url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge","forks_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/forks","keys_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/teams","hooks_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/hooks","issue_events_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/events","assignees_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/tags","blobs_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/languages","stargazers_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/stargazers","contributors_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/contributors","subscribers_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/subscribers","subscription_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/subscription","commits_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/merges","archive_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/downloads","issues_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/labels{/name}","releases_url":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/releases{/id}","created_at":"2015-03-05T05:49:47Z","updated_at":"2015-03-05T05:50:03Z","pushed_at":"2015-03-09T00:54:15Z","git_url":"git://github.com/nyc-sea-lions-2015/chess-challenge.git","ssh_url":"git@github.com:nyc-sea-lions-2015/chess-challenge.git","clone_url":"https://github.com/nyc-sea-lions-2015/chess-challenge.git","svn_url":"https://github.com/nyc-sea-lions-2015/chess-challenge","homepage":null,"size":478,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2"},"html":{"href":"https://github.com/nyc-sea-lions-2015/chess-challenge/pull/2"},"issue":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/2"},"comments":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/nyc-sea-lions-2015/chess-challenge/statuses/1df3263ff9dea3176b0b5d68b8e350fa3399354c"}}}}