- NodeJS >=12.18.2
-
Update
index.js
-
Run
npm start
, results will output in the terminale.g.
0-0, 15-15
0-0, 40-15
0-0, Deuce
0-0, Advantage player 1
1-0
npm install
npm run test
- Finite-state machine, I have initially tried to use this design pattern to manage all the state changes, but eventually realize this task isn't a good fit of this task.
- Strategy pattern
- yii Behavior Class Doc
- tennis-score, only referenced this when I was struggle to implement the strategy pattern.