Reference Ranges

Efofex parameters have always supported references. These allow you to reference individual values in a parameter.

For example, if you have created a parameter like

$p=shuffle(1,6)

$p might end up being 5, 4, 6, 1, 3, 2

You can reference individual elements of $p using square brackets.

$p[4] = 1
$p[6] = 2

The latest versions allow you to use a reference range.

$p[2,5] = “4, 6, 1, 3”

Reference ranges will automatically be produced with your local separator (in this example, that is a comma).

You can also add your own separator

$p[2,5,+]

will be replaced with “4+6+1+3”

Special Reference Ranges

There are two special reference ranges you can use. The first is the empty reference range.

$p[]

This will list out ALL elements of the set. For the example above, this will produce

“5, 4, 6, 1, 3, 2”

The second special reference range is an elided reference. For this example we will use

$q=range(1,100)

If you listed out this full set, the result would be too long for one line. Instead you can use this notation.

$q[…]

which will automatically produce an elided list.

1, 2, 3, 4, 5, 6, 7, 8 … 96, 97, 98, 99, 100

You can also add your own separator

$q[…,+]

1+2+3+4+5+6+7+8+ … +96+97+98+99+100

Ideal for sequences and series questions!


Discover more from Efofex News

Subscribe to get the latest posts sent to your email.

Unknown's avatar

About efofexsoftware

Efofex Software produces graphic production software designed specifically for secondary mathematics and science teachers.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment