| Discussion: | Developer's Area |
| Topic: | JavaScript Question |
| Post a new topic to the Developers Discussion discussion |
| ||||||||
| Subject: | JavaScript Question |
| Author: | tackweed |
| Date: | May 29 2004 |
http://www2.whidbey.net/ohmsmath/webwork/javascript/dividertemp.htm
I have a question about what may be a peculiarity of JavaScript - or am I doing
something wrong..
the current source code - about line 21 (below)
// Mathod 1 - Grouping
display=display+"<b>Method 1 - Grouping</b><br>";
display=display+"Divide "+dvdnd+ " by "+ div + " or how many groups of "+div+"
are there in "+dvdnd+"?<br>";
loop1=parseInt(dvdnd/div);// total loops
checkloop=dvdnd/3925;// tells how many sets needed**
looper=parseInt(loop1/(dvdnd/3925));//size of loops
loop2=dvdnd%div;//Remainder
quotient=0;//Start the count
// for some reason 3900 items seems to be a max
var pic="";
**the program sets out the counters for the number of ticks in a divisor group.
For some reason there is a limit to the number of ticks which can be displayed
(hence the code above) The number is in the range of 3925+ Without the code
change above, and a dividend larger than 3925, the tics will stop appearing on
the screen.
Unfortunately the current fix creates a gap in the visual data - while hardly
serious - it looks odd at times. ( for example, enter the problem Divide 7865 by
26 after the 150th group of 26, there is a break in the display (due to the
loops ) Without the loop, the data would stop displaying after approximately
3925+ marks - no error message - answers correct - no more to this part of the
display.
Please understand the remainder of the script - especially part 4 is incomplete
but if anyone has any suggestions on how to make the display for the 'method 1'
part work for larger numbers without creating counting loops I would like to
hear.
Thanks,
Jeff LeMieux
| |||||||
| Post a new topic to the Developers Discussion discussion | |||||||