# Khan/khan-exercises

Use ordinal function

1 parent bc728f6 commit 04c8cdcf319f21b0d2b8611beefae00a6f0a1a8c petercollingridge committed Feb 19, 2013
Showing with 7 additions and 6 deletions.
1. +7 −6 exercises/integer_sums.html
 @@ -1,5 +1,5 @@ - + Integer sums @@ -12,8 +12,6 @@ randRange(2, 6) randRange(1, 2) randRange(1, SEQ_LENGTH) - ["zeroth", "first", "second", "third", "forth", "fifth", "sixth"][TARGET_NUMBER] - DIFFERENCE * SEQ_LENGTH * (SEQ_LENGTH - 1) / 2 FIRST_NUM * SEQ_LENGTH + C @@ -42,7 +40,7 @@

The sum of SEQ_LENGTH consecutive SEQ_TYPEs is SUM.

-

What is the ORDINAL number in this sequence?

+

What is the ordinal(TARGET_NUMBER) number in this sequence?

@@ -61,8 +59,11 @@

Thus, the first number is ANSWER.

-

Since x is the first number, x + (TARGET_NUMBER - 1) * DIFFERENCE is the ORDINAL SEQ_TYPE.

-

Thus, the ORDINAL number in the sequence is ANSWER.

+

+ Since x is the first number, x + (TARGET_NUMBER - 1) * DIFFERENCE + is the ordinal(TARGET_NUMBER) SEQ_TYPE. +

+

Thus, the ordinal(TARGET_NUMBER) number in the sequence is ANSWER.