-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
406 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"program": "${workspaceFolder}/app.js" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,94 @@ | ||
// TODO - Try the new ES6 Convention - https://chatgpt.com/share/8e4d1ab5-a275-4fce-b43b-37ca988b81ba | ||
|
||
console.log('1st test message'); | ||
// console.log('1st test message'); | ||
|
||
const Scorecard = require('./src/Scorecard.js'); | ||
|
||
let myScorecard = new Scorecard(); | ||
console.log(myScorecard.getCurrentScore()); // Zero as expected. | ||
// let myScorecard = new Scorecard(); | ||
// console.log(myScorecard.getCurrentScore()); // Zero as expected. | ||
|
||
myScorecard.addFrame(2,5); | ||
console.log(myScorecard.getCurrentScore()); // 7 as expected. | ||
// myScorecard.addFrame(2,5); | ||
// console.log(myScorecard.getCurrentScore()); // 7 as expected. | ||
|
||
myScorecard.addFrame(3,5); // 15 as expected. | ||
console.log(myScorecard.getCurrentScore()); | ||
console.log("Number of frames: " + myScorecard.getNumberofFrames()); | ||
// myScorecard.addFrame(3,5); // 15 as expected. | ||
// console.log(myScorecard.getCurrentScore()); | ||
// console.log("Number of frames: " + myScorecard.getNumberofFrames()); | ||
|
||
myScorecard = new Scorecard(); | ||
console.log(myScorecard.getCurrentScore()); // 0 as expected. | ||
// console.log("strike or spare?"); | ||
// myScorecard = new Scorecard(); | ||
// console.log(myScorecard.getCurrentScore()); // 0 as expected. | ||
// myScorecard.addFrame(3,5); | ||
// myScorecard.addFrame(5,5); | ||
// myScorecard.addFrame(10,0); | ||
// myScorecard.getFinalScore(); | ||
|
||
// myScorecard = new Scorecard(); | ||
// myScorecard.addFrame(9,5); | ||
// console.log(myScorecard.getScore()); // 0 as expected. | ||
|
||
// myScorecard = new Scorecard(); | ||
// myScorecard.addFrame('',5); | ||
// console.log(myScorecard.getScore()); // 0 as expected. | ||
// console.log(myScorecard.getScore()); // 0 as expected. | ||
|
||
|
||
// Test strike | ||
|
||
|
||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
|
||
|
||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
|
||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
// scorecard14.addFrame(10,0); | ||
|
||
// scorecard14.addFrame(10,0); | ||
|
||
// // Bonus rolls due to strike. | ||
// scorecard14.addFrame(10,0); // bonus round. | ||
// scorecard14.addFrame(10,0); // bonus round. | ||
|
||
|
||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
|
||
|
||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
|
||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
// scorecard13.addFrame(1,1); | ||
|
||
// scorecard13.addFrame(10,0); | ||
|
||
// // Bonus roll due to STRIKE. Next two rolls to be included. | ||
// scorecard13.addFrame(5,4); | ||
|
||
// // Should be 37 instead of 42. | ||
// // I shouldn't be adding the last 5 and 4 as a forward bonus as I'm on the last round. | ||
// console.log(scorecard13.getFinalScore()); | ||
let scorecard9 = new Scorecard(); | ||
|
||
scorecard9.addFrame(0,0); | ||
scorecard9.addFrame(5,5); | ||
scorecard9.addFrame(1,8); | ||
|
||
scorecard9.addFrame(0,0); | ||
scorecard9.addFrame(0,0); | ||
scorecard9.addFrame(0,0); | ||
|
||
scorecard9.addFrame(0,0); | ||
scorecard9.addFrame(0,0); | ||
scorecard9.addFrame(0,0); | ||
|
||
scorecard9.addFrame(0,0); | ||
|
||
console.log(scorecard9.getFinalScore()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.