SCORE inputVector resultVariable {resultVariable}

Appends the nth element of the input vector to the nth result variable. If there is only one result variable, then only one number (the first) from the input vector is used. Note that unlike other commands, this one does NOT replace the contents of the result variable.

SCORE is used to accumulate the results of multiple trials run during a WHILE or REPEAT loop.

In nested loops with the SCORE command it is often necessary to use the CLEAR command to clear the scoring vector for the next pass through the outer loop. See the example in the CLEAR command.

SCORE 5 A
SCORE (1 2 3) B
SCORE (1 2 3) C D E F
PRINT A B C D E F 

produces:

A: 5.0
B: 1.0
C: 1.0
D: 2.0
E: 3.0
F: ()

Note that SCORE does not clear its result vectors, therefore, this

COPY 1 counter
REPEAT 5
   SCORE counter scores
   ADD counter 1 counter
END
PRINT scores

produces this output:

scores: (1.0 2.0 3.0 4.0 5.0)

See practical examples in CLEAR, IF, MULTIPLES, and REPEAT.