Project1 update - #36
Open
G174 wants to merge 18 commits into
Open
Conversation
primaulia
reviewed
Oct 6, 2017
| var submitAnswer = "" | ||
|
|
||
| var country =["vietnam", "china", "italy", "mexico", "india"] | ||
| var image = ["url(./assets/img/vietnam.png)","url(./assets/img/china.png)", |
Contributor
There was a problem hiding this comment.
Why don't you store just the string of the image instead?
Glow
Grow & Things to look out for
|
shumin13
reviewed
Oct 13, 2017
| // console.log(usedIndex) | ||
| randomIndex = Math.floor(Math.random()*5) | ||
| if (usedIndex.length < 5){ | ||
| while (usedIndex.includes(randomIndex)) { |
primaulia
reviewed
Oct 15, 2017
| function shuffleImg() { | ||
| // console.log(usedIndex) | ||
| randomIndex = Math.floor(Math.random()*5) | ||
| if (usedIndex.length < 5){ |
Contributor
There was a problem hiding this comment.
Can you explain the loop more here
| timerObj.startTimer() | ||
| if (randomIndex === 0) { | ||
| $('<input type="text" class="input" placeholder="* * * * * * *">').insertBefore(".submit"); | ||
| } else if (randomIndex === 1) { |
Contributor
There was a problem hiding this comment.
What's the randomIndex variable are for
| $('.submit').click(function() { | ||
| var $input = $('.input') | ||
| submitAnswer = $input.val() | ||
| checkAnswer() |
Contributor
There was a problem hiding this comment.
Why don't you pass the answer into the checkAnswer function
|
|
||
| //does submitAnswer match answer | ||
| function checkAnswer() { | ||
| if(submitAnswer === answer && timerObj.seconds < 5) { |
Contributor
There was a problem hiding this comment.
Can we not repeat these all conditions?
Contributor
|
Project Workflow: 3 / 5 Glow
Grow
Things to look out for
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.