{"action":"created","comment":{"url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/comments/226730810","pull_request_review_id":166630820,"id":226730810,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjczMDgxMA==","diff_hunk":"@@ -1,184 +1,185 @@\n-class Game\n-\n-\tdef initialize\n-\t\trandom_start = rand(2)\n-\t\tif random_start == 0\n-\t\t\t@player_turn = \"X\"\n-\t\telse\n-\t\t\t@player_turn = \"O\"\n+\tclass Game\n+\n+\t\tdef initialize\n+\t\t\trandom_start = rand(2)\n+\t\t\tif random_start == 0\n+\t\t\t\t@player_turn = \"X\"\n+\t\t\telse\n+\t\t\t\t@player_turn = \"O\"\n+\t\t\tend\n \t\tend\n-\tend\n-\tattr_reader :player_turn\n+\t\tattr_reader :player_turn\n \n-\tdef turn\n-\t\tputs \"#{@player_turn}'s turn.\"\n-\t\tputs \"Enter your move: \"\n-\t\t\n+\t\tdef turn\n+\t\t\tputs \"#{@player_turn}'s turn.\"\n+\t\t\tputs \"Enter your move: \"\n+\t\t\t\n \n-\tend\n+\t\tend\n \n-\tdef switch_turn\n-\t\tif @player_turn == \"X\"\n-\t\t\t@player_turn = \"O\"\n-\t\telsif @player_turn == \"O\"\n-\t\t\t@player_turn = \"X\"\n+\t\tdef switch_turn\n+\t\t\tif @player_turn == \"X\"\n+\t\t\t\t@player_turn = \"O\"\n+\t\t\telsif @player_turn == \"O\"\n+\t\t\t\t@player_turn = \"X\"\n+\t\t\tend\n \t\tend\n-\tend\n \n-\tdef start_game\n-\t\tputs \"Welcome to Tic Tac Toe\"\n-\t\tputs \"Play by typing the column position and row position separated by a space\"\n-\t\tputs \"Ex:  top middle\"\n-\t\tputs \"\\\"#{@player_turn}\\\" goes first.\"\n+\t\tdef start_game\n+\t\t\tputs \"Welcome to Tic Tac Toe\"\n+\t\t\tputs \"Play by typing the column position and row position separated by a space\"\n+\t\t\tputs \"Ex:  top middle\"\n+\t\t\tputs \"\\\"#{@player_turn}\\\" goes first.\"\n \n+\t\tend\n \tend\n-end\n \n-class Board\n+\tclass Board\n \n-\tdef initialize\n-\t\t# @board = [[\"-\",\"-\",\"-\"],[\"-\",\"-\",\"-\"],[\"-\",\"-\",\"-\"]]\n-\t\t@board = [[\"X\",\"O\",\"X\"],[\"O\",\"X\",\"X\"],[\"O\",\"X\",\"-\"]]\n-\tend\n+\t\tdef initialize\n+\t\t\t# @board = [[\"-\",\"-\",\"-\"],[\"-\",\"-\",\"-\"],[\"-\",\"-\",\"-\"]]\n+\t\t\t@board = [[\"X\",\"O\",\"X\"],[\"O\",\"X\",\"X\"],[\"O\",\"X\",\"-\"]]\n+\t\tend\n \n-\tdef display\n-\t\tprint_line = \"\"\n-\t\t@board.each do |row|\n-\t\t\trow.each do |element|\n-\t\t\t\tprint_line += element + \" \"\n+\t\tdef display\n+\t\t\tprint_line = \"\"\n+\t\t\t@board.each do |row|\n+\t\t\t\trow.each do |element|\n+\t\t\t\t\tprint_line += element + \" \"\n+\t\t\t\tend\n+\t\t\t\tprint_line += \"\\n\"\n \t\t\tend\n-\t\t\tprint_line += \"\\n\"\n+\t\t\tputs print_line\n \t\tend\n-\t\tputs print_line\n-\tend\n \n-\tdef make_move(who_player)\n-    board_idx = condition_input\n-    while !(valid_move?(board_idx[0], board_idx[-1]))\n-\t\t\t# if valid_move?(board_idx[0], board_idx[1])\n-\t\t\t# \t@board[board_idx[0]][board_idx[1]] = who_player\n-\t\t\t# else\n-\t\t\tboard_idx = condition_input\n-\t\t\tvalid_move?(board_idx[0], board_idx[-1])\n+\t\tdef make_move(who_player)\n+\t    board_idx = condition_input\n+\t    while !(valid_move?(board_idx[0], board_idx[-1]))\n+\t\t\t\t# if valid_move?(board_idx[0], board_idx[1])\n+\t\t\t\t# \t@board[board_idx[0]][board_idx[1]] = who_player\n+\t\t\t\t# else\n+\t\t\t\tboard_idx = condition_input\n+\t\t\t\tvalid_move?(board_idx[0], board_idx[-1])\n+\t\t\tend\n+\t\t\t@board[board_idx[0]][board_idx[-1]] = who_player\n \t\tend\n-\t\t@board[board_idx[0]][board_idx[-1]] = who_player\n-\tend\n \n-\tdef condition_input\n-\t\tmove = gets.chomp\n-\t\tmove_a = move.split(' ')\n-\t\trow_word = move_a[0]\n-\t\tcolumn_word = move_a[1]\n-\t\treturn space(row_word, column_word)\n-\tend\n-\n-\tdef space(row, column)\n-\t\tcase row\n-\t\twhen \"top\"\n-\t\t\tfirst = 0\n-\t\twhen \"middle\"\n-\t\t\tfirst = 1\n-\t\twhen \"bottom\"\n-\t\t\tfirst = 2\n-\t\telse\n-\t\t\tfirst = 3\n+\t\tdef condition_input\n+\t\t\tmove = gets.chomp\n+\t\t\tmove_a = move.split(' ')\n+\t\t\trow_word = move_a[0]\n+\t\t\tcolumn_word = move_a[1]\n+\t\t\treturn space(row_word, column_word)\n \t\tend\n \n-\t\tcase column\n-\t\twhen \"left\"\n-\t\t\tsecond = 0\n-\t\twhen \"middle\"\n-\t\t\tsecond = 1\n-\t\twhen \"right\"\n-\t\t\tsecond = 2\n-\t\telse\n-\t\t\tsecond = 3\n+\t\tdef space(row, column)","path":"tictactoe.rb","position":152,"original_position":152,"commit_id":"5244d1b14389365a046dd9d760d59f76dae6caac","original_commit_id":"5244d1b14389365a046dd9d760d59f76dae6caac","user":{"login":"JSkeets","id":28940414,"node_id":"MDQ6VXNlcjI4OTQwNDE0","avatar_url":"https://avatars2.githubusercontent.com/u/28940414?v=4","gravatar_id":"","url":"https://api.github.com/users/JSkeets","html_url":"https://github.com/JSkeets","followers_url":"https://api.github.com/users/JSkeets/followers","following_url":"https://api.github.com/users/JSkeets/following{/other_user}","gists_url":"https://api.github.com/users/JSkeets/gists{/gist_id}","starred_url":"https://api.github.com/users/JSkeets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JSkeets/subscriptions","organizations_url":"https://api.github.com/users/JSkeets/orgs","repos_url":"https://api.github.com/users/JSkeets/repos","events_url":"https://api.github.com/users/JSkeets/events{/privacy}","received_events_url":"https://api.github.com/users/JSkeets/received_events","type":"User","site_admin":false},"body":"Also formatting please.","created_at":"2018-10-19T17:51:21Z","updated_at":"2018-10-19T17:51:21Z","html_url":"https://github.com/torreyhogan/tictactoe/pull/2#discussion_r226730810","pull_request_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/comments/226730810"},"html":{"href":"https://github.com/torreyhogan/tictactoe/pull/2#discussion_r226730810"},"pull_request":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2"}},"in_reply_to_id":226730744},"pull_request":{"url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2","id":224361740,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MzYxNzQw","html_url":"https://github.com/torreyhogan/tictactoe/pull/2","diff_url":"https://github.com/torreyhogan/tictactoe/pull/2.diff","patch_url":"https://github.com/torreyhogan/tictactoe/pull/2.patch","issue_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/2","number":2,"state":"open","locked":false,"title":"Optimize","user":{"login":"torreyhogan","id":42388214,"node_id":"MDQ6VXNlcjQyMzg4MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/42388214?v=4","gravatar_id":"","url":"https://api.github.com/users/torreyhogan","html_url":"https://github.com/torreyhogan","followers_url":"https://api.github.com/users/torreyhogan/followers","following_url":"https://api.github.com/users/torreyhogan/following{/other_user}","gists_url":"https://api.github.com/users/torreyhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/torreyhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torreyhogan/subscriptions","organizations_url":"https://api.github.com/users/torreyhogan/orgs","repos_url":"https://api.github.com/users/torreyhogan/repos","events_url":"https://api.github.com/users/torreyhogan/events{/privacy}","received_events_url":"https://api.github.com/users/torreyhogan/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-19T17:43:46Z","updated_at":"2018-10-19T17:51:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f95e424e3f1c815ddf6a8e9c064b1c547bfae7a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2/commits","review_comments_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2/comments","review_comment_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/2/comments","statuses_url":"https://api.github.com/repos/torreyhogan/tictactoe/statuses/5244d1b14389365a046dd9d760d59f76dae6caac","head":{"label":"torreyhogan:optimize","ref":"optimize","sha":"5244d1b14389365a046dd9d760d59f76dae6caac","user":{"login":"torreyhogan","id":42388214,"node_id":"MDQ6VXNlcjQyMzg4MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/42388214?v=4","gravatar_id":"","url":"https://api.github.com/users/torreyhogan","html_url":"https://github.com/torreyhogan","followers_url":"https://api.github.com/users/torreyhogan/followers","following_url":"https://api.github.com/users/torreyhogan/following{/other_user}","gists_url":"https://api.github.com/users/torreyhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/torreyhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torreyhogan/subscriptions","organizations_url":"https://api.github.com/users/torreyhogan/orgs","repos_url":"https://api.github.com/users/torreyhogan/repos","events_url":"https://api.github.com/users/torreyhogan/events{/privacy}","received_events_url":"https://api.github.com/users/torreyhogan/received_events","type":"User","site_admin":false},"repo":{"id":153719810,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3MTk4MTA=","name":"tictactoe","full_name":"torreyhogan/tictactoe","private":false,"owner":{"login":"torreyhogan","id":42388214,"node_id":"MDQ6VXNlcjQyMzg4MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/42388214?v=4","gravatar_id":"","url":"https://api.github.com/users/torreyhogan","html_url":"https://github.com/torreyhogan","followers_url":"https://api.github.com/users/torreyhogan/followers","following_url":"https://api.github.com/users/torreyhogan/following{/other_user}","gists_url":"https://api.github.com/users/torreyhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/torreyhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torreyhogan/subscriptions","organizations_url":"https://api.github.com/users/torreyhogan/orgs","repos_url":"https://api.github.com/users/torreyhogan/repos","events_url":"https://api.github.com/users/torreyhogan/events{/privacy}","received_events_url":"https://api.github.com/users/torreyhogan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/torreyhogan/tictactoe","description":"simple tic tac toe in Ruby","fork":false,"url":"https://api.github.com/repos/torreyhogan/tictactoe","forks_url":"https://api.github.com/repos/torreyhogan/tictactoe/forks","keys_url":"https://api.github.com/repos/torreyhogan/tictactoe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torreyhogan/tictactoe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torreyhogan/tictactoe/teams","hooks_url":"https://api.github.com/repos/torreyhogan/tictactoe/hooks","issue_events_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/events{/number}","events_url":"https://api.github.com/repos/torreyhogan/tictactoe/events","assignees_url":"https://api.github.com/repos/torreyhogan/tictactoe/assignees{/user}","branches_url":"https://api.github.com/repos/torreyhogan/tictactoe/branches{/branch}","tags_url":"https://api.github.com/repos/torreyhogan/tictactoe/tags","blobs_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/refs{/sha}","trees_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torreyhogan/tictactoe/statuses/{sha}","languages_url":"https://api.github.com/repos/torreyhogan/tictactoe/languages","stargazers_url":"https://api.github.com/repos/torreyhogan/tictactoe/stargazers","contributors_url":"https://api.github.com/repos/torreyhogan/tictactoe/contributors","subscribers_url":"https://api.github.com/repos/torreyhogan/tictactoe/subscribers","subscription_url":"https://api.github.com/repos/torreyhogan/tictactoe/subscription","commits_url":"https://api.github.com/repos/torreyhogan/tictactoe/commits{/sha}","git_commits_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/commits{/sha}","comments_url":"https://api.github.com/repos/torreyhogan/tictactoe/comments{/number}","issue_comment_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/comments{/number}","contents_url":"https://api.github.com/repos/torreyhogan/tictactoe/contents/{+path}","compare_url":"https://api.github.com/repos/torreyhogan/tictactoe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torreyhogan/tictactoe/merges","archive_url":"https://api.github.com/repos/torreyhogan/tictactoe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torreyhogan/tictactoe/downloads","issues_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues{/number}","pulls_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls{/number}","milestones_url":"https://api.github.com/repos/torreyhogan/tictactoe/milestones{/number}","notifications_url":"https://api.github.com/repos/torreyhogan/tictactoe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torreyhogan/tictactoe/labels{/name}","releases_url":"https://api.github.com/repos/torreyhogan/tictactoe/releases{/id}","deployments_url":"https://api.github.com/repos/torreyhogan/tictactoe/deployments","created_at":"2018-10-19T03:10:54Z","updated_at":"2018-10-19T17:24:46Z","pushed_at":"2018-10-19T17:43:47Z","git_url":"git://github.com/torreyhogan/tictactoe.git","ssh_url":"git@github.com:torreyhogan/tictactoe.git","clone_url":"https://github.com/torreyhogan/tictactoe.git","svn_url":"https://github.com/torreyhogan/tictactoe","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"torreyhogan:master","ref":"master","sha":"83c7cd3d15e9081451ac71a80521909cc5aa004d","user":{"login":"torreyhogan","id":42388214,"node_id":"MDQ6VXNlcjQyMzg4MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/42388214?v=4","gravatar_id":"","url":"https://api.github.com/users/torreyhogan","html_url":"https://github.com/torreyhogan","followers_url":"https://api.github.com/users/torreyhogan/followers","following_url":"https://api.github.com/users/torreyhogan/following{/other_user}","gists_url":"https://api.github.com/users/torreyhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/torreyhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torreyhogan/subscriptions","organizations_url":"https://api.github.com/users/torreyhogan/orgs","repos_url":"https://api.github.com/users/torreyhogan/repos","events_url":"https://api.github.com/users/torreyhogan/events{/privacy}","received_events_url":"https://api.github.com/users/torreyhogan/received_events","type":"User","site_admin":false},"repo":{"id":153719810,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3MTk4MTA=","name":"tictactoe","full_name":"torreyhogan/tictactoe","private":false,"owner":{"login":"torreyhogan","id":42388214,"node_id":"MDQ6VXNlcjQyMzg4MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/42388214?v=4","gravatar_id":"","url":"https://api.github.com/users/torreyhogan","html_url":"https://github.com/torreyhogan","followers_url":"https://api.github.com/users/torreyhogan/followers","following_url":"https://api.github.com/users/torreyhogan/following{/other_user}","gists_url":"https://api.github.com/users/torreyhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/torreyhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torreyhogan/subscriptions","organizations_url":"https://api.github.com/users/torreyhogan/orgs","repos_url":"https://api.github.com/users/torreyhogan/repos","events_url":"https://api.github.com/users/torreyhogan/events{/privacy}","received_events_url":"https://api.github.com/users/torreyhogan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/torreyhogan/tictactoe","description":"simple tic tac toe in Ruby","fork":false,"url":"https://api.github.com/repos/torreyhogan/tictactoe","forks_url":"https://api.github.com/repos/torreyhogan/tictactoe/forks","keys_url":"https://api.github.com/repos/torreyhogan/tictactoe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torreyhogan/tictactoe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torreyhogan/tictactoe/teams","hooks_url":"https://api.github.com/repos/torreyhogan/tictactoe/hooks","issue_events_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/events{/number}","events_url":"https://api.github.com/repos/torreyhogan/tictactoe/events","assignees_url":"https://api.github.com/repos/torreyhogan/tictactoe/assignees{/user}","branches_url":"https://api.github.com/repos/torreyhogan/tictactoe/branches{/branch}","tags_url":"https://api.github.com/repos/torreyhogan/tictactoe/tags","blobs_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/refs{/sha}","trees_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torreyhogan/tictactoe/statuses/{sha}","languages_url":"https://api.github.com/repos/torreyhogan/tictactoe/languages","stargazers_url":"https://api.github.com/repos/torreyhogan/tictactoe/stargazers","contributors_url":"https://api.github.com/repos/torreyhogan/tictactoe/contributors","subscribers_url":"https://api.github.com/repos/torreyhogan/tictactoe/subscribers","subscription_url":"https://api.github.com/repos/torreyhogan/tictactoe/subscription","commits_url":"https://api.github.com/repos/torreyhogan/tictactoe/commits{/sha}","git_commits_url":"https://api.github.com/repos/torreyhogan/tictactoe/git/commits{/sha}","comments_url":"https://api.github.com/repos/torreyhogan/tictactoe/comments{/number}","issue_comment_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues/comments{/number}","contents_url":"https://api.github.com/repos/torreyhogan/tictactoe/contents/{+path}","compare_url":"https://api.github.com/repos/torreyhogan/tictactoe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torreyhogan/tictactoe/merges","archive_url":"https://api.github.com/repos/torreyhogan/tictactoe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torreyhogan/tictactoe/downloads","issues_url":"https://api.github.com/repos/torreyhogan/tictactoe/issues{/number}","pulls_url":"https://api.github.com/repos/torreyhogan/tictactoe/pulls{/number}","milestones_url":"https://api.github.com/repos/torreyhogan/tictactoe/milestones{/number}","notifications_url":"https://api.github.com/repos/torreyhogan/tictactoe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torreyhogan/tictactoe/labels{/name}","releases_url":"https://api.github.com/repos/torreyhogan/tictactoe/releases{/id}","deployments_url":"https://api.github.com/repos/torreyhogan/tictactoe/deployments","created_at":"2018-10-19T03:10:54Z","updated_at":"2018-10-19T17:24:46Z","pushed_at":"2018-10-19T17:43:47Z","git_url":"git://github.com/torreyhogan/tictactoe.git","ssh_url":"git@github.com:torreyhogan/tictactoe.git","clone_url":"https://github.com/torreyhogan/tictactoe.git","svn_url":"https://github.com/torreyhogan/tictactoe","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2"},"html":{"href":"https://github.com/torreyhogan/tictactoe/pull/2"},"issue":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/issues/2"},"comments":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/torreyhogan/tictactoe/statuses/5244d1b14389365a046dd9d760d59f76dae6caac"}},"author_association":"OWNER"}}
{"actor":{"display_login":"JSkeets"}}