Created
November 21, 2017 13:58
-
-
Save tomatohammado/5a18adcf317ae9725e3c7a49b1036312 to your computer and use it in GitHub Desktop.
Vestibule Week 2 day 1, memory card exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GAs-MacBook-Air:~ ga$ cd ga-wdi/sandbox/ | |
| GAs-MacBook-Air:sandbox ga$ ls | |
| conditionals_exercise html-intro-test week1_day3_layout_exercise | |
| css-test vestibule_day1_test | |
| GAs-MacBook-Air:sandbox ga$ mkdir dom_test && $_ | |
| -bash: dom_test: command not found | |
| GAs-MacBook-Air:sandbox ga$ mkdir dom_test | |
| mkdir: dom_test: File exists | |
| GAs-MacBook-Air:sandbox ga$ ls | |
| conditionals_exercise dom_test vestibule_day1_test | |
| css-test html-intro-test week1_day3_layout_exercise | |
| GAs-MacBook-Air:sandbox ga$ cd dom_test | |
| GAs-MacBook-Air:dom_test ga$ touch index.html script.js | |
| GAs-MacBook-Air:dom_test ga$ code . | |
| GAs-MacBook-Air:dom_test ga$ open . | |
| GAs-MacBook-Air:dom_test ga$ cd .. | |
| GAs-MacBook-Air:sandbox ga$ cd .. | |
| GAs-MacBook-Air:ga-wdi ga$ cd fundamentals/wdi-fundamentals-memorygame/ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| nothing to commit, working tree clean | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "changed cards array to hold objects representing rank, suit, and image source of the cards." | |
| [master cd6e3c7] changed cards array to hold objects representing rank, suit, and image source of the cards. | |
| 1 file changed, 22 insertions(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "reordered conditional statements in the checkForMatchFunction. No real reason, I just like it better. Now the last statement (else) is for when there aren't exactly two cards to compare, which makes more sense to me. I guess." | |
| [master 8f9f166] reordered conditional statements in the checkForMatchFunction. No real reason, I just like it better. Now the last statement (else) is for when there aren't exactly two cards to compare, which makes more sense to me. I guess. | |
| 1 file changed, 5 insertions(+), 5 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 2 commits. | |
| (use "git push" to publish your local commits) | |
| nothing to commit, working tree clean | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "added consol.log statements to print out the image path and suit for each card as it is flipped." | |
| [master d95cbc2] added consol.log statements to print out the image path and suit for each card as it is flipped. | |
| 1 file changed, 2 insertions(+) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 12, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (9/9), done. | |
| Writing objects: 100% (12/12), 1.46 KiB | 499.00 KiB/s, done. | |
| Total 12 (delta 5), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (5/5), completed with 1 local object. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| ee15890..d95cbc2 master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add index.html | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "commented out original div with cards in it, replaced it with an empty div with a #game-board id." | |
| [master 71bc126] commented out original div with cards in it, replaced it with an empty div with a #game-board id. | |
| 1 file changed, 5 insertions(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 1 commit. | |
| (use "git push" to publish your local commits) | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "created a createBoard function, however the event handler for flipping over the cards when a user clicks on them doesn't work. I need to figure out how to pass the argument to the function, because it has a parameter." | |
| [master e7a0736] created a createBoard function, however the event handler for flipping over the cards when a user clicks on them doesn't work. I need to figure out how to pass the argument to the function, because it has a parameter. | |
| 1 file changed, 14 insertions(+), 2 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 7, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (6/6), done. | |
| Writing objects: 100% (7/7), 1.05 KiB | 1.05 MiB/s, done. | |
| Total 7 (delta 4), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (4/4), completed with 3 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| d95cbc2..e7a0736 master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git ass js/main.js | |
| git: 'ass' is not a git command. See 'git --help'. | |
| The most similar commands are | |
| add | |
| stash | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "well, I got lucky and figured out how to get the flipCard function to work with the event handler. The instructions are not helping things." | |
| [master dfc2ddd] well, I got lucky and figured out how to get the flipCard function to work with the event handler. The instructions are not helping things. | |
| 1 file changed, 16 insertions(+), 3 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 4, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (3/3), done. | |
| Writing objects: 100% (4/4), 670 bytes | 670.00 KiB/s, done. | |
| Total 4 (delta 2), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (2/2), completed with 2 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| e7a0736..dfc2ddd master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "alright, so it turns out a couple slides later it gives a solution to fix the flipCard function that is a little different than the one I found, but allow the event handler to just take `flipCard` and not the anonymous function so you can evoke flipCard with an argument. A note on the slides earlier would have helped..." | |
| -bash: flipCard: command not found | |
| [master fb4d34e] alright, so it turns out a couple slides later it gives a solution to fix the flipCard function that is a little different than the one I found, but allow the event handler to just take and not the anonymous function so you can evoke flipCard with an argument. A note on the slides earlier would have helped... | |
| 1 file changed, 8 insertions(+), 4 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 4, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (3/3), done. | |
| Writing objects: 100% (4/4), 570 bytes | 570.00 KiB/s, done. | |
| Total 4 (delta 2), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (2/2), completed with 2 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| dfc2ddd..fb4d34e master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "added setAttribute to add image source to flipCard function to reveal card faces when clicked." | |
| [master 26f924a] added setAttribute to add image source to flipCard function to reveal card faces when clicked. | |
| 1 file changed, 6 insertions(+), 4 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 1 commit. | |
| (use "git push" to publish your local commits) | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: css/style.css | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add css/style.css | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "added styles to footer to make it fixed on the bottom of the page no matter how heigh the window is. Unfortunately, it covers up the very bottom of the cards, and marging/padding doesn't seem to work too well. Actually, let me try padding..." | |
| [master b08b6cd] added styles to footer to make it fixed on the bottom of the page no matter how heigh the window is. Unfortunately, it covers up the very bottom of the cards, and marging/padding doesn't seem to work too well. Actually, let me try padding... | |
| 1 file changed, 5 insertions(+) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add css/style.css | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "fixed margin and padding on main and img tags to look good with footer on small window heights. Fiiiiiiiinally." | |
| [master 5a63ff1] fixed margin and padding on main and img tags to look good with footer on small window heights. Fiiiiiiiinally. | |
| 1 file changed, 2 insertions(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 3 commits. | |
| (use "git push" to publish your local commits) | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: index.html | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 3 commits. | |
| (use "git push" to publish your local commits) | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: index.html | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add index.html | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "removed superfluous .clearfix class. The instructions told us to add it where we don't need it in a later exercise." | |
| [master d2e683f] removed superfluous .clearfix class. The instructions told us to add it where we don't need it in a later exercise. | |
| 1 file changed, 1 insertion(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "added conditional for checkForMatch to move in the flipCard function, so it won't run if there are more than two cards. The way it works now, you can't even flip more than two cards. Took longer to get the conditional right than I care to admit." | |
| [master d247efa] added conditional for checkForMatch to move in the flipCard function, so it won't run if there are more than two cards. The way it works now, you can't even flip more than two cards. Took longer to get the conditional right than I care to admit. | |
| 1 file changed, 4 insertions(+) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 19, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (15/15), done. | |
| Writing objects: 100% (19/19), 2.24 KiB | 765.00 KiB/s, done. | |
| Total 19 (delta 9), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (9/9), completed with 4 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| fb4d34e..d247efa master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| nothing to commit, working tree clean | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ ls .. | |
| World github_resume wdi-fundamentals-memorygame | |
| cell_phone_html_css thinking_like_a_programmer | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ code ../cell_phone_html_css/ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: css/style.css | |
| modified: index.html | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add . | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "adding reset button. Had to redo where the cards would be placed in the JS, added the button to the HTML, and styles in the css." | |
| [master 1ca36b6] adding reset button. Had to redo where the cards would be placed in the JS, added the button to the HTML, and styles in the css. | |
| 3 files changed, 23 insertions(+), 4 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 1 commit. | |
| (use "git push" to publish your local commits) | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git checkout -- js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is ahead of 'origin/master' by 1 commit. | |
| (use "git push" to publish your local commits) | |
| nothing to commit, working tree clean | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 7, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (5/5), done. | |
| Writing objects: 100% (7/7), 967 bytes | 241.00 KiB/s, done. | |
| Total 7 (delta 3), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (3/3), completed with 3 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| d247efa..1ca36b6 master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log('Up and running!') | |
| -bash: syntax error near unexpected token `'Up and running!'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ var cards = [ | |
| -bash: var: command not found | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ { | |
| > rank: 'queen', | |
| > suit: 'hearts', | |
| > cardImage: 'images/queen-of-hearts.png' | |
| > }, | |
| > { | |
| > rank: 'queen', | |
| > suit: 'diamonds', | |
| > cardImage: 'images/queen-of-diamonds.png' | |
| > }, | |
| > { | |
| > rank: 'king', | |
| > suit: 'hearts', | |
| > cardImage: 'images/king-of-hearts.png' | |
| > }, | |
| > { | |
| > rank: 'king', | |
| > suit: 'diamonds', | |
| > cardImage: 'images/king-of-diamonds.png' | |
| > } | |
| > ] | |
| > var cardsInPlay = [] | |
| > | |
| > var checkForMatch = function () { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ if (cardsInPlay[0] === cardsInPlay[1]) { | |
| -bash: syntax error near unexpected token `{' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log('You found a match!') | |
| -bash: syntax error near unexpected token `'You found a match!'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } else { | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log('Sorry, try again.') | |
| -bash: syntax error near unexpected token `'Sorry, try again.'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ var flipCard = function () { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ var cardId = this.getAttribute('data-id') | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ if (cardsInPlay.length >= 2) { | |
| -bash: syntax error near unexpected token `{' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ return | |
| -bash: return: can only `return' from a function or sourced script | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } else if (cardsInPlay[0].cardImage === this.getAttribute('src')) { | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log('Cannot choose the same card twice') | |
| -bash: syntax error near unexpected token `'Cannot choose the same card twice'' | |
| return | |
| } | |
| this.classList.add('flipped') | |
| console.log('User flipped ' + cards[cardId].rank) | |
| // console.log(cards[cardId].cardImage) | |
| // console.log(cards[cardId].suit) | |
| cardsInPlay.push(cards[cardId].rank) | |
| this.setAttribute('src', cards[cardId].cardImage) | |
| if (cardsInPlay.length === 2) { | |
| checkForMatch() | |
| } | |
| } | |
| var createBoard = function () { | |
| for (var i = 0; i < cards.length; i++) { | |
| var cardElement = document.createElement('img') | |
| cardElement.setAttribute('src', 'images/back.png') | |
| cardElement.setAttribute('data-id', i) | |
| // console.log('i:' + i) | |
| // console.log('#data-id: ' + cardElement.getAttribute('data-id')) | |
| // cardElement.addEventListener('click', function () { | |
| // console.log('i:' + i) | |
| // console.log('#data-id: ' + cardElement.getAttribute('data-id')) | |
| // console.log('this#data-id: ' + this.getAttribute('data-id')) | |
| // flipCard(i) | |
| // thank god for stackoverflow https://stackoverflow.com/questionsGAs-MacBook-Air:wdi-fundamentals-memorygame ga$ return | |
| -bash: return: can only `return' from a function or sourced script | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ this.classList.add('flipped') | |
| -bash: syntax error near unexpected token `'flipped'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log('User flipped ' + cards[cardId].rank) | |
| -bash: syntax error near unexpected token `'User flipped '' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log(cards[cardId].cardImage) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log(cards[cardId].suit) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ cardsInPlay.push(cards[cardId].rank) | |
| -bash: syntax error near unexpected token `cards[cardId].rank' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ this.setAttribute('src', cards[cardId].cardImage) | |
| -bash: syntax error near unexpected token `'src',' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ if (cardsInPlay.length === 2) { | |
| -bash: syntax error near unexpected token `{' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ checkForMatch() | |
| > } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ var createBoard = function () { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ for (var i = 0; i < cards.length; i++) { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ var cardElement = document.createElement('img') | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ cardElement.setAttribute('src', 'images/back.png') | |
| -bash: syntax error near unexpected token `'src',' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ cardElement.setAttribute('data-id', i) | |
| -bash: syntax error near unexpected token `'data-id',' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log('i:' + i) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log('#data-id: ' + cardElement.getAttribute('data-id')) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // cardElement.addEventListener('click', function () { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log('i:' + i) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log('#data-id: ' + cardElement.getAttribute('data-id')) | |
| -bash: syntax error near unexpected token `(' | |
| // console.log('this#data-id: ' + this.getAttribute('data-id')) | |
| // flipCard(i) | |
| // thank god for stackoverflow https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function. | |
| // flipCard(this.getAttribute('data-id')) | |
| // }) | |
| cardElement.addEventListener('click', flipCard) | |
| // document.getElementById('game-board').appendChild(cardElement) | |
| // document.getElementById('game-board').insertBefore(cardElement, document.querySelector('.reset-button')) | |
| document.getElementById('game-board').insertBefore(cardElement, document.querySelector('#game-board div')) | |
| } | |
| } | |
| document.querySelector('.reset-button').addEventListener('click', function () { | |
| console.log(document.querySelectorAll('.flipped')) | |
| for (var i = 0; i < cardsInPlay.length; i++) { | |
| console.log(document.querySelectorAll('.flipped')[i]) | |
| document.querySelectorAll('.flipped')[i].classList.remove('flipped') | |
| } | |
| cardsInPlay = [] | |
| }) | |
| // flipCaGAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // console.log('this#data-id: ' + this.getAttribute('data-id')) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // flipCard(i) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // thank god for stackoverflow https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function. | |
| -bash: //: is a directory | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // flipCard(this.getAttribute('data-id')) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // }) | |
| -bash: syntax error near unexpected token `)' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ cardElement.addEventListener('click', flipCard) | |
| -bash: syntax error near unexpected token `'click',' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // document.getElementById('game-board').appendChild(cardElement) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // document.getElementById('game-board').insertBefore(cardElement, document.querySelector('.reset-button')) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ document.getElementById('game-board').insertBefore(cardElement, document.querySelector('#game-board div')) | |
| -bash: syntax error near unexpected token `'game-board'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ document.querySelector('.reset-button').addEventListener('click', function () { | |
| -bash: syntax error near unexpected token `'.reset-button'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log(document.querySelectorAll('.flipped')) | |
| -bash: syntax error near unexpected token `document.querySelectorAll' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ for (var i = 0; i < cardsInPlay.length; i++) { | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ console.log(document.querySelectorAll('.flipped')[i]) | |
| -bash: syntax error near unexpected token `document.querySelectorAll' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ document.querySelectorAll('.flipped')[i].classList.remove('flipped') | |
| -bash: syntax error near unexpected token `'.flipped'' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ } | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ cardsInPlay = [] | |
| }) | |
| // flipCard(0) | |
| // flipCard(2) | |
| createBoard() | |
| -bash: cardsInPlay: command not found | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ }) | |
| -bash: syntax error near unexpected token `}' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // flipCard(0) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ // flipCard(2) | |
| -bash: syntax error near unexpected token `(' | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ createBoard() | |
| > | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "refactored js so you can't flip the same card more than once." | |
| [master 4354d36] refactored js so you can't flip the same card more than once. | |
| 1 file changed, 20 insertions(+), 5 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 4, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (3/3), done. | |
| Writing objects: 100% (4/4), 694 bytes | 694.00 KiB/s, done. | |
| Total 4 (delta 2), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (2/2), completed with 2 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| 1ca36b6..4354d36 master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git status | |
| On branch master | |
| Your branch is up to date with 'origin/master'. | |
| Changes not staged for commit: | |
| (use "git add <file>..." to update what will be committed) | |
| (use "git checkout -- <file>..." to discard changes in working directory) | |
| modified: js/main.js | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add js/main.js | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "finally got the reset-button event listener to work. Not the first way I wanted to do it, I am removing then invoking the createBoard() function again to do it, when I would rather just reassign the img src, but that was glitching out on me. This works, I'm happy." | |
| [master 8884a78] finally got the reset-button event listener to work. Not the first way I wanted to do it, I am removing then invoking the createBoard() function again to do it, when I would rather just reassign the img src, but that was glitching out on me. This works, I'm happy. | |
| 1 file changed, 4 insertions(+), 6 deletions(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add css/style.css | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "added opacity to reset-button, make it look a little more distinct than the header of the same color with full opacity." | |
| [master 3804b6e] added opacity to reset-button, make it look a little more distinct than the header of the same color with full opacity. | |
| 1 file changed, 1 insertion(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git add css/style.css | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git commit -m "figured out the width problem, it was a set width on the main section in line 57. So I commented it out, and added some padding to the sides of the <p>." | |
| [master f7ca84d] figured out the width problem, it was a set width on the main section in line 57. So I commented it out, and added some padding to the sides of the <p>. | |
| 1 file changed, 2 insertions(+), 1 deletion(-) | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ git push | |
| Counting objects: 12, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (9/9), done. | |
| Writing objects: 100% (12/12), 1.44 KiB | 295.00 KiB/s, done. | |
| Total 12 (delta 6), reused 0 (delta 0) | |
| remote: Resolving deltas: 100% (6/6), completed with 3 local objects. | |
| To https://github.com/tomatohammado/wdi-fundamentals-memorygame.git | |
| 4354d36..f7ca84d master -> master | |
| GAs-MacBook-Air:wdi-fundamentals-memorygame ga$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment