From: David Carraher on
Hi,

For some reason, the thumbnails and snapshots in a Demonstration I just
made change after I set them the way I want them to appear on
Demonstrations.Wolfram.com.

More specifically...

I can make independent adjustments in snapshots, e.g., select different
tabs for different snapshots. But these adjustments are not retained when
the file is uploaded from my computer to my demonstrations area.
If I click on a button as part of the adjustment, all the other snapshots
update so as to look be working with the same data from the currently
active snapshot. This makes it impossible to display different fractions
in different snapshots.


I suspect that the code in the demo reinitializes when uploaded to the
demonstration area.
And that it reinitializes each time I click on the New button (in the
demo) to work with a new fraction.

The following code runs from the initialization section of the
demonstration when the New button is clicked.

toM["NewTarget", lev_] :=
Module[{minLevels = 2, maxLevels = 12, minMoves = 3, maxMoves = 12, num,
den},
(s = 0;
m = I;
{num, den} = {RandomInteger[{1, lev}], RandomInteger[{1, lev}]};

While[
Length[ContinuedFraction[num/den]] > maxLevels
Or Length[ContinuedFraction[num/den]] < minLevels
Or M[toM[num/den], "nMoves"] > maxMoves
Or M[toM[num/den], "nMoves"] < minMoves,
{num, den} = {RandomInteger[{1, lev}],
RandomInteger[{1, lev}]}];
toM[num/den])];

I can send the whole demo source code to anyone who is willing to give it
a look. It is about 300 lines long.

thanks,

david