-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocumentation.txt
1 lines (1 loc) · 1.4 KB
/
documentation.txt
1
class game should be created wuth the methods to generate runs , timer function and to add total of it. There will be another method which handles the toggle of between two teams and will be based on timer function. To insert values in the table , we can run a for loop where id will be matched with for loop variable for example id= ``$1{i}`. (i is the for loop index and 1 stands for the table element) . In toggle method once the set timeput funciton executes its first run, the former button shall be updated with the class "disabled" ( Bootstrap UI is used). The first team is chosen to play first by default. Runs are genrated by using Math.floor(Math.random() * 7) ( to produce runs withon 0-6 ) every time when hit button click event occurs. If run. generated is zero , the player shall be terminated , in code it will exit the for loop which is running for the particular row. Every time a row for loop is completed total run calculation method has to call to calculate the sum of run scored in that row. When all the rows are completed or the timer function has completed the run then Total of all totals have to be displayed. After two runs of timer functions. There will be another method to compare the two mega totals and sys which team won . Additionally to know the man of match (the person who scored maximum runs) , it will have to use to one more for loop to loop through all row totla elements and find the maximum.