{"action":"created","comment":{"url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/comments/23643893","id":23643893,"diff_hunk":"@@ -0,0 +1,151 @@\n+class Board\r\n+  def initialize\r\n+    @board_width = 7\r\n+    @board_height = 6\r\n+    @board = Array.new(@board_width){Array.new(@board_height)}\r\n+  end\r\n+\r\n+  def drop_token(column_number,game_token)\r\n+    board_full\r\n+     if column_full(column_number)\r\n+       false\r\n+     else\r\n+      i = 5\r\n+      while @board[column_number][i] != nil\r\n+        i -= 1\r\n+      end\r\n+      @board[column_number][i] = game_token\r\n+      #animates the dropping of the token4, can be buggy but fun\r\n+      #MODULATE!!\r\n+      animate = 0\r\n+      while animate < i\r\n+        @board[column_number][animate] = game_token\r\n+        board_render\r\n+        sleep 0.1\r\n+        puts \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\"\r\n+        @board[column_number][animate] = nil\r\n+        animate += 1\r\n+      end       \r\n+    end\r\n+    #MODULATE!!\r\n+    if win?\r\n+      board_render\r\n+      puts \" #{game_token} wins! play again? (y/n)\"\r\n+      print \"> \"\r\n+      another_play = gets.strip.chomp\r\n+      if another_play.downcase == \"y\"\r\n+        schwad = Game.new\r\n+        schwad.play\r\n+      else\r\n+        exit\r\n+      end\r\n+    else\r\n+      true\r\n+    end\r\n+  end\r\n+\r\n+  def column_full(column_no)\r\n+    #binding.pry                  #pry stuff\r\n+    @board[column_no].all?\r\n+  end\r\n+\r\n+  def board_full\r\n+    if @board.flatten.all?\r\n+      puts \"Oh no, the board is full! Let's start again!\"\r\n+      schwad = Game.new\r\n+      schwad.play\r\n+    end\r\n+  end\r\n+\r\n+  def board_render\r\n+        \r\n+    # This method will render the pegs top-down\r\n+    # The first peg will be printed, followed by a tab, then second and so on\r\n+    iterator_row = 0\r\n+\r\n+    puts  \"Current Board:\"\r\n+    while (iterator_row <= 6)\r\n+      iterator_column = 0\r\n+      7.times do \r\n+        if @board[iterator_column][iterator_row]!=nil\r\n+        print @board[iterator_column][iterator_row]\r\n+        end\r\n+        print \"\\t\"\r\n+        iterator_column += 1\r\n+      end      \r\n+      puts \"\"\r\n+      iterator_row += 1\r\n+    end\r\n+    puts \"0\\t1\\t2\\t3\\t4\\t5\\t6\\n\"\r\n+  end\r\n+\r\n+  def win?\r\n+   # Checks vertical, horizontal, and diaogonal victory conditions\r\n+    vertical_win? ||\r\n+    horizontal_win? ||\r\n+    up_diagonal_win? ||\r\n+    down_diagonal_win?\r\n+  end\r","path":"connect_four/board.rb","position":88,"original_position":88,"commit_id":"712faa36fb1e6698e0e884d8de6dc242e0a117a1","original_commit_id":"712faa36fb1e6698e0e884d8de6dc242e0a117a1","user":{"login":"dsberger","id":5608734,"avatar_url":"https://avatars.githubusercontent.com/u/5608734?v=3","gravatar_id":"","url":"https://api.github.com/users/dsberger","html_url":"https://github.com/dsberger","followers_url":"https://api.github.com/users/dsberger/followers","following_url":"https://api.github.com/users/dsberger/following{/other_user}","gists_url":"https://api.github.com/users/dsberger/gists{/gist_id}","starred_url":"https://api.github.com/users/dsberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsberger/subscriptions","organizations_url":"https://api.github.com/users/dsberger/orgs","repos_url":"https://api.github.com/users/dsberger/repos","events_url":"https://api.github.com/users/dsberger/events{/privacy}","received_events_url":"https://api.github.com/users/dsberger/received_events","type":"User","site_admin":false},"body":"Hey, this looks familiar. Hopefully you understand what the methods are doing.","created_at":"2015-01-27T21:20:39Z","updated_at":"2015-01-27T21:20:39Z","html_url":"https://github.com/vikingeducation/project_ruby_game_center/pull/10#discussion_r23643893","pull_request_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/comments/23643893"},"html":{"href":"https://github.com/vikingeducation/project_ruby_game_center/pull/10#discussion_r23643893"},"pull_request":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10","id":28003368,"html_url":"https://github.com/vikingeducation/project_ruby_game_center/pull/10","diff_url":"https://github.com/vikingeducation/project_ruby_game_center/pull/10.diff","patch_url":"https://github.com/vikingeducation/project_ruby_game_center/pull/10.patch","issue_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/10","number":10,"state":"open","locked":false,"title":"BY THE POWER OF GREYSKULL","user":{"login":"Schwad","id":7865030,"avatar_url":"https://avatars.githubusercontent.com/u/7865030?v=3","gravatar_id":"","url":"https://api.github.com/users/Schwad","html_url":"https://github.com/Schwad","followers_url":"https://api.github.com/users/Schwad/followers","following_url":"https://api.github.com/users/Schwad/following{/other_user}","gists_url":"https://api.github.com/users/Schwad/gists{/gist_id}","starred_url":"https://api.github.com/users/Schwad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schwad/subscriptions","organizations_url":"https://api.github.com/users/Schwad/orgs","repos_url":"https://api.github.com/users/Schwad/repos","events_url":"https://api.github.com/users/Schwad/events{/privacy}","received_events_url":"https://api.github.com/users/Schwad/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-26T02:44:50Z","updated_at":"2015-01-27T21:20:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4cbd155021f9a2c1407e2bd1042500ea1135be4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10/commits","review_comments_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10/comments","review_comment_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/comments/{number}","comments_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/10/comments","statuses_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/statuses/712faa36fb1e6698e0e884d8de6dc242e0a117a1","head":{"label":"Schwad:master","ref":"master","sha":"712faa36fb1e6698e0e884d8de6dc242e0a117a1","user":{"login":"Schwad","id":7865030,"avatar_url":"https://avatars.githubusercontent.com/u/7865030?v=3","gravatar_id":"","url":"https://api.github.com/users/Schwad","html_url":"https://github.com/Schwad","followers_url":"https://api.github.com/users/Schwad/followers","following_url":"https://api.github.com/users/Schwad/following{/other_user}","gists_url":"https://api.github.com/users/Schwad/gists{/gist_id}","starred_url":"https://api.github.com/users/Schwad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schwad/subscriptions","organizations_url":"https://api.github.com/users/Schwad/orgs","repos_url":"https://api.github.com/users/Schwad/repos","events_url":"https://api.github.com/users/Schwad/events{/privacy}","received_events_url":"https://api.github.com/users/Schwad/received_events","type":"User","site_admin":false},"repo":{"id":29757660,"name":"project_ruby_game_center","full_name":"Schwad/project_ruby_game_center","owner":{"login":"Schwad","id":7865030,"avatar_url":"https://avatars.githubusercontent.com/u/7865030?v=3","gravatar_id":"","url":"https://api.github.com/users/Schwad","html_url":"https://github.com/Schwad","followers_url":"https://api.github.com/users/Schwad/followers","following_url":"https://api.github.com/users/Schwad/following{/other_user}","gists_url":"https://api.github.com/users/Schwad/gists{/gist_id}","starred_url":"https://api.github.com/users/Schwad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schwad/subscriptions","organizations_url":"https://api.github.com/users/Schwad/orgs","repos_url":"https://api.github.com/users/Schwad/repos","events_url":"https://api.github.com/users/Schwad/events{/privacy}","received_events_url":"https://api.github.com/users/Schwad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Schwad/project_ruby_game_center","description":"The Game Center Project for the Koding for Kids organization","fork":true,"url":"https://api.github.com/repos/Schwad/project_ruby_game_center","forks_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/forks","keys_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/teams","hooks_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/hooks","issue_events_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/issues/events{/number}","events_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/events","assignees_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/assignees{/user}","branches_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/branches{/branch}","tags_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/tags","blobs_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/git/refs{/sha}","trees_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/statuses/{sha}","languages_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/languages","stargazers_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/stargazers","contributors_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/contributors","subscribers_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/subscribers","subscription_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/subscription","commits_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/commits{/sha}","git_commits_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/git/commits{/sha}","comments_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/comments{/number}","issue_comment_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/issues/comments/{number}","contents_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/contents/{+path}","compare_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/merges","archive_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/downloads","issues_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/issues{/number}","pulls_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/pulls{/number}","milestones_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/milestones{/number}","notifications_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/labels{/name}","releases_url":"https://api.github.com/repos/Schwad/project_ruby_game_center/releases{/id}","created_at":"2015-01-23T23:09:49Z","updated_at":"2015-01-27T02:35:49Z","pushed_at":"2015-01-27T02:35:49Z","git_url":"git://github.com/Schwad/project_ruby_game_center.git","ssh_url":"git@github.com:Schwad/project_ruby_game_center.git","clone_url":"https://github.com/Schwad/project_ruby_game_center.git","svn_url":"https://github.com/Schwad/project_ruby_game_center","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"vikingeducation:master","ref":"master","sha":"16fc95081ac5f18106a71083a99c5dfe79b6c4a5","user":{"login":"vikingeducation","id":7231832,"avatar_url":"https://avatars.githubusercontent.com/u/7231832?v=3","gravatar_id":"","url":"https://api.github.com/users/vikingeducation","html_url":"https://github.com/vikingeducation","followers_url":"https://api.github.com/users/vikingeducation/followers","following_url":"https://api.github.com/users/vikingeducation/following{/other_user}","gists_url":"https://api.github.com/users/vikingeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/vikingeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikingeducation/subscriptions","organizations_url":"https://api.github.com/users/vikingeducation/orgs","repos_url":"https://api.github.com/users/vikingeducation/repos","events_url":"https://api.github.com/users/vikingeducation/events{/privacy}","received_events_url":"https://api.github.com/users/vikingeducation/received_events","type":"Organization","site_admin":false},"repo":{"id":23600230,"name":"project_ruby_game_center","full_name":"vikingeducation/project_ruby_game_center","owner":{"login":"vikingeducation","id":7231832,"avatar_url":"https://avatars.githubusercontent.com/u/7231832?v=3","gravatar_id":"","url":"https://api.github.com/users/vikingeducation","html_url":"https://github.com/vikingeducation","followers_url":"https://api.github.com/users/vikingeducation/followers","following_url":"https://api.github.com/users/vikingeducation/following{/other_user}","gists_url":"https://api.github.com/users/vikingeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/vikingeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikingeducation/subscriptions","organizations_url":"https://api.github.com/users/vikingeducation/orgs","repos_url":"https://api.github.com/users/vikingeducation/repos","events_url":"https://api.github.com/users/vikingeducation/events{/privacy}","received_events_url":"https://api.github.com/users/vikingeducation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vikingeducation/project_ruby_game_center","description":"The Game Center Project for the Koding for Kids organization","fork":false,"url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center","forks_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/forks","keys_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/teams","hooks_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/hooks","issue_events_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/events{/number}","events_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/events","assignees_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/assignees{/user}","branches_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/branches{/branch}","tags_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/tags","blobs_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/git/refs{/sha}","trees_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/statuses/{sha}","languages_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/languages","stargazers_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/stargazers","contributors_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/contributors","subscribers_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/subscribers","subscription_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/subscription","commits_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/commits{/sha}","git_commits_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/git/commits{/sha}","comments_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/comments{/number}","issue_comment_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/comments/{number}","contents_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/contents/{+path}","compare_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/merges","archive_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/downloads","issues_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues{/number}","pulls_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls{/number}","milestones_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/milestones{/number}","notifications_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/labels{/name}","releases_url":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/releases{/id}","created_at":"2014-09-03T00:13:34Z","updated_at":"2015-01-07T02:13:27Z","pushed_at":"2015-01-07T02:13:26Z","git_url":"git://github.com/vikingeducation/project_ruby_game_center.git","ssh_url":"git@github.com:vikingeducation/project_ruby_game_center.git","clone_url":"https://github.com/vikingeducation/project_ruby_game_center.git","svn_url":"https://github.com/vikingeducation/project_ruby_game_center","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":10,"forks":13,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10"},"html":{"href":"https://github.com/vikingeducation/project_ruby_game_center/pull/10"},"issue":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/10"},"comments":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/vikingeducation/project_ruby_game_center/statuses/712faa36fb1e6698e0e884d8de6dc242e0a117a1"}}}}