Skip to content

Commit

Permalink
Adding question to the game and verifying the user entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjayKumarr committed Aug 28, 2017
1 parent 3782c8a commit a3f45da
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions js/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@ function setQuestion() {

case 8:

/*
- Here, you will generate the question to be displayed to the user while practising your trick.
question_num is the number involved in your trick. If it involves more than one number, use it as an array.
question_num = getRandomInt(Range-min, Range-max)
question_txt is the text set on the screen.
Use question_txt.setText() function to do it.
You must have noticed that we have three helpers on the screen to help the user with clues.
You can set the text of each helper using the following variables to their corresponsing places.
- answer_helper_left
- answer_helper_middle
- answer_helper_right
Now, you need to add a case in the verifyAnser function to verify the user answer entry.
*/

case 9:

default:
Expand Down Expand Up @@ -252,6 +270,14 @@ function verifyAnswer() {
}
break;

case 8:
/*
user_answer will have the user entry.
question_num will be a number for a single entry or an array for multiple entries as you have defined it above.
Set the answered_right to true if the user has answerd right.
*/
break;

default:
break;
}
Expand Down

0 comments on commit a3f45da

Please sign in to comment.