Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript Docume
- var count =0;
- var count2 = 0;
- var totalScore = 0;
- var rolls = [];
- var Game = {
- roll : function roll(pins){
- if (count>=20){
- totalScore = 0;
- count = 0;
- count2=0;
- }
- if (count2 < 2){
- count2++;
- }
- else{
- count2 = 1;
- }
- totalScore += pins;
- count++;
- },
- score : function score(){
- return totalScore;
- },
- test : function test(){
- return count2;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement