{"action":"created","comment":{"url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/comments/68498471","id":68498471,"diff_hunk":"@@ -1,49 +1,60 @@\n-var R = require('ramda');\n-// Т.к. в JS нет прекрасного Рубийного типа \"символ\", то...\n-const CLOSED = 0;\n-const OPEN = 1;\n-const BOARD_VALUES = R.map(x => String.fromCharCode(65 + x), R.range(0, 26));\n+const R = require('ramda');\n+const assert = require('assert');\n \n-console.log(BOARD_VALUES);\n+const C = require('./constants');\n+const makeRandomBoard = require('./makers').makeRandomBoard;\n \n-let state = {\n+let gameState = {\n   board: [\n     [\n-      {value: 0, state: CLOSED},\n-      {value: 1, state: CLOSED},\n-      {value: 2, state: CLOSED},\n-      {value: 3, state: CLOSED}\n+      {value: 0, state: C.cardStates.closed},\n+      {value: 1, state: C.cardStates.closed},\n+      {value: 2, state: C.cardStates.closed},\n+      {value: 3, state: C.cardStates.closed},\n     ],\n     [\n-      {value: 4, state: OPEN},\n-      {value: 5, state: OPEN},\n-      {value: 5, state: OPEN},\n-      {value: 4, state: OPEN}\n+      {value: 4, state: C.cardStates.open},\n+      {value: 5, state: C.cardStates.open},\n+      {value: 5, state: C.cardStates.open},\n+      {value: 4, state: C.cardStates.open},\n     ],\n     [\n-      {value: 3, state: CLOSED},\n-      {value: 2, state: CLOSED},\n-      {value: 1, state: CLOSED},\n-      {value: 0, state: OPEN}\n+      {value: 3, state: C.cardStates.closed},\n+      {value: 2, state: C.cardStates.closed},\n+      {value: 1, state: C.cardStates.closed},\n+      {value: 0, state: C.cardStates.open},\n     ]    \n   ],\n-  last_clicked: {\n-    x: 4,\n-    y: 3\n-  }\n+  last_clicked: {x: 3, y: 2},\n+  state: C.boardStates.unpaired,  \n }\n \n-let show_cell = cell => {\n-  return (cell['state'] == OPEN) ? BOARD_VALUES[cell['value']] : '*';\n+let show_cell = (cell, open) => {","path":"src/app.js","position":null,"original_position":57,"commit_id":"d4f1b9cb79b266bca86611ddb67e703748ac9e6d","original_commit_id":"5aeed909090deb7187e18348a0be34cc23cfbf24","user":{"login":"ivan-kleshnin","id":2128182,"avatar_url":"https://avatars.githubusercontent.com/u/2128182?v=3","gravatar_id":"","url":"https://api.github.com/users/ivan-kleshnin","html_url":"https://github.com/ivan-kleshnin","followers_url":"https://api.github.com/users/ivan-kleshnin/followers","following_url":"https://api.github.com/users/ivan-kleshnin/following{/other_user}","gists_url":"https://api.github.com/users/ivan-kleshnin/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan-kleshnin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan-kleshnin/subscriptions","organizations_url":"https://api.github.com/users/ivan-kleshnin/orgs","repos_url":"https://api.github.com/users/ivan-kleshnin/repos","events_url":"https://api.github.com/users/ivan-kleshnin/events{/privacy}","received_events_url":"https://api.github.com/users/ivan-kleshnin/received_events","type":"User","site_admin":false},"body":"Странная сигнатурая функции. Два источника истины: `cell` и `open`...","created_at":"2016-06-26T06:46:42Z","updated_at":"2016-06-26T06:46:42Z","html_url":"https://github.com/OUGHT/memory-game-mkdev/pull/2#discussion_r68498471","pull_request_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/comments/68498471"},"html":{"href":"https://github.com/OUGHT/memory-game-mkdev/pull/2#discussion_r68498471"},"pull_request":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2","id":75214420,"html_url":"https://github.com/OUGHT/memory-game-mkdev/pull/2","diff_url":"https://github.com/OUGHT/memory-game-mkdev/pull/2.diff","patch_url":"https://github.com/OUGHT/memory-game-mkdev/pull/2.patch","issue_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/2","number":2,"state":"open","locked":false,"title":"Lesson 2","user":{"login":"OUGHT","id":6378091,"avatar_url":"https://avatars.githubusercontent.com/u/6378091?v=3","gravatar_id":"","url":"https://api.github.com/users/OUGHT","html_url":"https://github.com/OUGHT","followers_url":"https://api.github.com/users/OUGHT/followers","following_url":"https://api.github.com/users/OUGHT/following{/other_user}","gists_url":"https://api.github.com/users/OUGHT/gists{/gist_id}","starred_url":"https://api.github.com/users/OUGHT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OUGHT/subscriptions","organizations_url":"https://api.github.com/users/OUGHT/orgs","repos_url":"https://api.github.com/users/OUGHT/repos","events_url":"https://api.github.com/users/OUGHT/events{/privacy}","received_events_url":"https://api.github.com/users/OUGHT/received_events","type":"User","site_admin":false},"body":"Ответ на вопросы: я бы сделал класс Cell, Board и GameState и оперировал через конструкторы и методы. Но это не функциональный подход =-)","created_at":"2016-06-25T21:03:16Z","updated_at":"2016-06-26T06:46:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82828243c787471bc2061507eb0122fcabd1c993","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2/commits","review_comments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2/comments","review_comment_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/2/comments","statuses_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/statuses/d4f1b9cb79b266bca86611ddb67e703748ac9e6d","head":{"label":"OUGHT:lesson-2","ref":"lesson-2","sha":"d4f1b9cb79b266bca86611ddb67e703748ac9e6d","user":{"login":"OUGHT","id":6378091,"avatar_url":"https://avatars.githubusercontent.com/u/6378091?v=3","gravatar_id":"","url":"https://api.github.com/users/OUGHT","html_url":"https://github.com/OUGHT","followers_url":"https://api.github.com/users/OUGHT/followers","following_url":"https://api.github.com/users/OUGHT/following{/other_user}","gists_url":"https://api.github.com/users/OUGHT/gists{/gist_id}","starred_url":"https://api.github.com/users/OUGHT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OUGHT/subscriptions","organizations_url":"https://api.github.com/users/OUGHT/orgs","repos_url":"https://api.github.com/users/OUGHT/repos","events_url":"https://api.github.com/users/OUGHT/events{/privacy}","received_events_url":"https://api.github.com/users/OUGHT/received_events","type":"User","site_admin":false},"repo":{"id":61478562,"name":"memory-game-mkdev","full_name":"OUGHT/memory-game-mkdev","owner":{"login":"OUGHT","id":6378091,"avatar_url":"https://avatars.githubusercontent.com/u/6378091?v=3","gravatar_id":"","url":"https://api.github.com/users/OUGHT","html_url":"https://github.com/OUGHT","followers_url":"https://api.github.com/users/OUGHT/followers","following_url":"https://api.github.com/users/OUGHT/following{/other_user}","gists_url":"https://api.github.com/users/OUGHT/gists{/gist_id}","starred_url":"https://api.github.com/users/OUGHT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OUGHT/subscriptions","organizations_url":"https://api.github.com/users/OUGHT/orgs","repos_url":"https://api.github.com/users/OUGHT/repos","events_url":"https://api.github.com/users/OUGHT/events{/privacy}","received_events_url":"https://api.github.com/users/OUGHT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OUGHT/memory-game-mkdev","description":"","fork":false,"url":"https://api.github.com/repos/OUGHT/memory-game-mkdev","forks_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/forks","keys_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/teams","hooks_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/hooks","issue_events_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/events{/number}","events_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/events","assignees_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/assignees{/user}","branches_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/branches{/branch}","tags_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/tags","blobs_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/refs{/sha}","trees_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/statuses/{sha}","languages_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/languages","stargazers_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/stargazers","contributors_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/contributors","subscribers_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/subscribers","subscription_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/subscription","commits_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/commits{/sha}","git_commits_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/commits{/sha}","comments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/comments{/number}","issue_comment_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/comments{/number}","contents_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/contents/{+path}","compare_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/merges","archive_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/downloads","issues_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues{/number}","pulls_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls{/number}","milestones_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/milestones{/number}","notifications_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/labels{/name}","releases_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/releases{/id}","deployments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/deployments","created_at":"2016-06-19T12:15:30Z","updated_at":"2016-06-19T17:48:56Z","pushed_at":"2016-06-25T21:03:17Z","git_url":"git://github.com/OUGHT/memory-game-mkdev.git","ssh_url":"git@github.com:OUGHT/memory-game-mkdev.git","clone_url":"https://github.com/OUGHT/memory-game-mkdev.git","svn_url":"https://github.com/OUGHT/memory-game-mkdev","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"OUGHT:master","ref":"master","sha":"736a18e97bd0c6da597fe7fde888e43898a5c7fe","user":{"login":"OUGHT","id":6378091,"avatar_url":"https://avatars.githubusercontent.com/u/6378091?v=3","gravatar_id":"","url":"https://api.github.com/users/OUGHT","html_url":"https://github.com/OUGHT","followers_url":"https://api.github.com/users/OUGHT/followers","following_url":"https://api.github.com/users/OUGHT/following{/other_user}","gists_url":"https://api.github.com/users/OUGHT/gists{/gist_id}","starred_url":"https://api.github.com/users/OUGHT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OUGHT/subscriptions","organizations_url":"https://api.github.com/users/OUGHT/orgs","repos_url":"https://api.github.com/users/OUGHT/repos","events_url":"https://api.github.com/users/OUGHT/events{/privacy}","received_events_url":"https://api.github.com/users/OUGHT/received_events","type":"User","site_admin":false},"repo":{"id":61478562,"name":"memory-game-mkdev","full_name":"OUGHT/memory-game-mkdev","owner":{"login":"OUGHT","id":6378091,"avatar_url":"https://avatars.githubusercontent.com/u/6378091?v=3","gravatar_id":"","url":"https://api.github.com/users/OUGHT","html_url":"https://github.com/OUGHT","followers_url":"https://api.github.com/users/OUGHT/followers","following_url":"https://api.github.com/users/OUGHT/following{/other_user}","gists_url":"https://api.github.com/users/OUGHT/gists{/gist_id}","starred_url":"https://api.github.com/users/OUGHT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OUGHT/subscriptions","organizations_url":"https://api.github.com/users/OUGHT/orgs","repos_url":"https://api.github.com/users/OUGHT/repos","events_url":"https://api.github.com/users/OUGHT/events{/privacy}","received_events_url":"https://api.github.com/users/OUGHT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OUGHT/memory-game-mkdev","description":"","fork":false,"url":"https://api.github.com/repos/OUGHT/memory-game-mkdev","forks_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/forks","keys_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/teams","hooks_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/hooks","issue_events_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/events{/number}","events_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/events","assignees_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/assignees{/user}","branches_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/branches{/branch}","tags_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/tags","blobs_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/refs{/sha}","trees_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/statuses/{sha}","languages_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/languages","stargazers_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/stargazers","contributors_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/contributors","subscribers_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/subscribers","subscription_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/subscription","commits_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/commits{/sha}","git_commits_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/git/commits{/sha}","comments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/comments{/number}","issue_comment_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/comments{/number}","contents_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/contents/{+path}","compare_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/merges","archive_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/downloads","issues_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues{/number}","pulls_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls{/number}","milestones_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/milestones{/number}","notifications_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/labels{/name}","releases_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/releases{/id}","deployments_url":"https://api.github.com/repos/OUGHT/memory-game-mkdev/deployments","created_at":"2016-06-19T12:15:30Z","updated_at":"2016-06-19T17:48:56Z","pushed_at":"2016-06-25T21:03:17Z","git_url":"git://github.com/OUGHT/memory-game-mkdev.git","ssh_url":"git@github.com:OUGHT/memory-game-mkdev.git","clone_url":"https://github.com/OUGHT/memory-game-mkdev.git","svn_url":"https://github.com/OUGHT/memory-game-mkdev","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2"},"html":{"href":"https://github.com/OUGHT/memory-game-mkdev/pull/2"},"issue":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/2"},"comments":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/OUGHT/memory-game-mkdev/statuses/d4f1b9cb79b266bca86611ddb67e703748ac9e6d"}}}}
{"actor":{"display_login":"ivan-kleshnin"}}