{"action":"opened","issue":{"url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016/issues/1025","repository_url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016","labels_url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016/issues/1025/labels{/name}","comments_url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016/issues/1025/comments","events_url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016/issues/1025/events","html_url":"https://github.com/piwakawaka-2016/piwakawaka-2016/issues/1025","id":177675882,"number":1025,"title":"6.3 Minesweeper: win some, lose some","user":{"login":"eda-waffler","id":19367633,"avatar_url":"https://avatars.githubusercontent.com/u/19367633?v=3","gravatar_id":"","url":"https://api.github.com/users/eda-waffler","html_url":"https://github.com/eda-waffler","followers_url":"https://api.github.com/users/eda-waffler/followers","following_url":"https://api.github.com/users/eda-waffler/following{/other_user}","gists_url":"https://api.github.com/users/eda-waffler/gists{/gist_id}","starred_url":"https://api.github.com/users/eda-waffler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eda-waffler/subscriptions","organizations_url":"https://api.github.com/users/eda-waffler/orgs","repos_url":"https://api.github.com/users/eda-waffler/repos","events_url":"https://api.github.com/users/eda-waffler/events{/privacy}","received_events_url":"https://api.github.com/users/eda-waffler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwakawaka-2016/piwakawaka-2016/labels/sprint-6","name":"sprint-6","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"sarah-rose-loh","id":21000622,"avatar_url":"https://avatars.githubusercontent.com/u/21000622?v=3","gravatar_id":"","url":"https://api.github.com/users/sarah-rose-loh","html_url":"https://github.com/sarah-rose-loh","followers_url":"https://api.github.com/users/sarah-rose-loh/followers","following_url":"https://api.github.com/users/sarah-rose-loh/following{/other_user}","gists_url":"https://api.github.com/users/sarah-rose-loh/gists{/gist_id}","starred_url":"https://api.github.com/users/sarah-rose-loh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarah-rose-loh/subscriptions","organizations_url":"https://api.github.com/users/sarah-rose-loh/orgs","repos_url":"https://api.github.com/users/sarah-rose-loh/repos","events_url":"https://api.github.com/users/sarah-rose-loh/events{/privacy}","received_events_url":"https://api.github.com/users/sarah-rose-loh/received_events","type":"User","site_admin":false},"assignees":[{"login":"sarah-rose-loh","id":21000622,"avatar_url":"https://avatars.githubusercontent.com/u/21000622?v=3","gravatar_id":"","url":"https://api.github.com/users/sarah-rose-loh","html_url":"https://github.com/sarah-rose-loh","followers_url":"https://api.github.com/users/sarah-rose-loh/followers","following_url":"https://api.github.com/users/sarah-rose-loh/following{/other_user}","gists_url":"https://api.github.com/users/sarah-rose-loh/gists{/gist_id}","starred_url":"https://api.github.com/users/sarah-rose-loh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarah-rose-loh/subscriptions","organizations_url":"https://api.github.com/users/sarah-rose-loh/orgs","repos_url":"https://api.github.com/users/sarah-rose-loh/repos","events_url":"https://api.github.com/users/sarah-rose-loh/events{/privacy}","received_events_url":"https://api.github.com/users/sarah-rose-loh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-09-18T20:47:31Z","updated_at":"2016-09-18T20:47:31Z","closed_at":null,"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- [ ] 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- [ ] 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- [ ] Define the `checkForWin` function. It should loop through all of `board.cells`.\n  - [ ] 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  - [ ] 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  - [ ] 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- [ ] 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":"eda-waffler"}}