{"action":"closed","issue":{"url":"https://api.github.com/repos/phase-0/phase-0/issues/5533","repository_url":"https://api.github.com/repos/phase-0/phase-0","labels_url":"https://api.github.com/repos/phase-0/phase-0/issues/5533/labels{/name}","comments_url":"https://api.github.com/repos/phase-0/phase-0/issues/5533/comments","events_url":"https://api.github.com/repos/phase-0/phase-0/issues/5533/events","html_url":"https://github.com/phase-0/phase-0/issues/5533","id":360083409,"node_id":"MDU6SXNzdWUzNjAwODM0MDk=","number":5533,"title":"6.3 Minesweeper: win some, lose some","user":{"login":"engie15","id":34586511,"node_id":"MDQ6VXNlcjM0NTg2NTEx","avatar_url":"https://avatars3.githubusercontent.com/u/34586511?v=4","gravatar_id":"","url":"https://api.github.com/users/engie15","html_url":"https://github.com/engie15","followers_url":"https://api.github.com/users/engie15/followers","following_url":"https://api.github.com/users/engie15/following{/other_user}","gists_url":"https://api.github.com/users/engie15/gists{/gist_id}","starred_url":"https://api.github.com/users/engie15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/engie15/subscriptions","organizations_url":"https://api.github.com/users/engie15/orgs","repos_url":"https://api.github.com/users/engie15/repos","events_url":"https://api.github.com/users/engie15/events{/privacy}","received_events_url":"https://api.github.com/users/engie15/received_events","type":"User","site_admin":false},"labels":[{"id":797676345,"node_id":"MDU6TGFiZWw3OTc2NzYzNDU=","url":"https://api.github.com/repos/phase-0/phase-0/labels/done","name":"done","color":"e6e6e6","default":false},{"id":815843224,"node_id":"MDU6TGFiZWw4MTU4NDMyMjQ=","url":"https://api.github.com/repos/phase-0/phase-0/labels/sprint-6","name":"sprint-6","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"catherineedwards","id":18477196,"node_id":"MDQ6VXNlcjE4NDc3MTk2","avatar_url":"https://avatars0.githubusercontent.com/u/18477196?v=4","gravatar_id":"","url":"https://api.github.com/users/catherineedwards","html_url":"https://github.com/catherineedwards","followers_url":"https://api.github.com/users/catherineedwards/followers","following_url":"https://api.github.com/users/catherineedwards/following{/other_user}","gists_url":"https://api.github.com/users/catherineedwards/gists{/gist_id}","starred_url":"https://api.github.com/users/catherineedwards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catherineedwards/subscriptions","organizations_url":"https://api.github.com/users/catherineedwards/orgs","repos_url":"https://api.github.com/users/catherineedwards/repos","events_url":"https://api.github.com/users/catherineedwards/events{/privacy}","received_events_url":"https://api.github.com/users/catherineedwards/received_events","type":"User","site_admin":false},"assignees":[{"login":"catherineedwards","id":18477196,"node_id":"MDQ6VXNlcjE4NDc3MTk2","avatar_url":"https://avatars0.githubusercontent.com/u/18477196?v=4","gravatar_id":"","url":"https://api.github.com/users/catherineedwards","html_url":"https://github.com/catherineedwards","followers_url":"https://api.github.com/users/catherineedwards/followers","following_url":"https://api.github.com/users/catherineedwards/following{/other_user}","gists_url":"https://api.github.com/users/catherineedwards/gists{/gist_id}","starred_url":"https://api.github.com/users/catherineedwards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catherineedwards/subscriptions","organizations_url":"https://api.github.com/users/catherineedwards/orgs","repos_url":"https://api.github.com/users/catherineedwards/repos","events_url":"https://api.github.com/users/catherineedwards/events{/privacy}","received_events_url":"https://api.github.com/users/catherineedwards/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-09-13T22:04:57Z","updated_at":"2018-10-03T22:42:25Z","closed_at":"2018-10-03T22:42:25Z","author_association":"CONTRIBUTOR","body":"# 6.3 Minesweeper: win some, lose some\n\nSo now we can play a game... almost! You've probably noticed that there's no real way to declare a winner. You can just continue merrily uncovering cells to your heart's content. We can change that now by creating a _win condition_: a way to tell our game that it's over.\n\nYou should go into this knowing that the way to win a game of Minesweeper is to have correctly marked all of the mines and uncovered every other cell.\n\n- [x] Remember event handlers? You defined some of them in Sprint 5. In `startGame`, use `document.addEventListener` to call `checkForWin` every time the left mouse button is clicked.\n- [x] When you've done that, add another one that calls `checkForWin` when the right mouse button is clicked.\n  - Remember, a player can win either by clearing the last hidden cell, or marking the last mine.\n- [x] Define the `checkForWin` function. It should loop through all of `board.cells`.\n  - [x] For each cell, check to see if _both_ `.isMine` and `.isMarked` are true. If any mine still exists that isn't marked, the player hasn't won yet and you can return out of the function.\n  - [x] If every mine is marked, but there are still cells with the `hidden` property set to true, the player hasn't won yet and you can return out of the function.\n  - [x] If both these criteria pass, the player has won! There's a `displayMessage` function call at the bottom of `checkForWin` you can use to tell them so.\n  - Take a moment to notice something: we're defining small functions that only have _one job_, rather than big complex chunks of code. This is an important principle of software development which we will be spending more time on later: where possible, try to have your functions _do one thing_, and name them appropriately.\n- [x] When you're done, commit your code!\n\nHey, it's a game! The next assignment contains some finishing off tasks and stretch goals.\n"}}
{"actor":{"display_login":"engie15"}}