File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -92,20 +92,21 @@ function scorerPrompt() {
92
92
while ( scorerProgramIndex < 0 || scorerProgramIndex > 2 || isNaN ( scorerProgramIndex ) ) {
93
93
scorerProgramIndex = input . question ( `Please enter a number from 0-2. What scoring algorithym would you like to use? ${ scorerOptions } ` ) ;
94
94
}
95
- return scoringAlgorithms [ scorerProgramIndex ] ;
95
+ return scoringAlgorithms [ scorerProgramIndex ] . scorerFunction ;
96
96
} ;
97
97
// create an array with the scorer functions, from the user input, call the relavant algorithym and print the word and score
98
98
99
99
function transform ( ) { } ;
100
100
101
101
function runProgram ( ) {
102
- initialPrompt ( ) ;
103
- scorerPrompt ( ) ;
104
-
105
- // Somehow I need to take the returned index from the user's response and call the selected algorithym, printing the word and score
102
+ let wordInput = initialPrompt ( ) ;
103
+ let scorerFunction = scorerPrompt ( ) ;
104
+ let score = scorerFunction ( wordInput ) ;
105
+ console . log ( `Score for' ${ wordInput } ': ${ score } ` ) ;
106
106
}
107
- console . log ( "algorithym name: " , scoringAlgorithms [ 2 ] . name ) ;
108
- console . log ( "scorerFunction result: " , scoringAlgorithms [ 2 ] . scorerFunction ( 'JavaScript' ) ) ;
107
+ // console.log("algorithym name: ", scoringAlgorithms[2].name);
108
+ // console.log("scorerFunction result: ", scoringAlgorithms[2].scorerFunction('JavaScript'));
109
+
109
110
// Don't write any code below this line //
110
111
// And don't change these or your program will not run as expected //
111
112
module . exports = {
You can’t perform that action at this time.
0 commit comments