Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- //function Player(name, symbol, score, onTurn)
- function Player(n, s, p, b)
- {
- var name = n;
- var symbol = s;
- var score = p;
- var onTurn = b;
- this.getName = getName;
- this.getSymbol = getSymbol;
- this.getScore = getScore;
- this.setScore = setScore;
- this.raiseScore = raiseScore;
- this.getOnTurn = getOnTurn;
- this.setTurn = setOnTurn;
- this.setOffTurn = setOffTurn;
- function getName() { return name; }
- function getSymbol() { return symbol; }
- function getScore() { return score; }
- function setScore(points) { score = points; }
- function raiseScore() { score++; }
- function getOnTurn() { return turn; }
- function setOnTurn() { turn = true; }
- function setOffTurn() { turn = false;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement