Note 17.6.1.
The outer
for
loop in the code below on line 8 executes 20 times and the inner for
loop on line 13 executes 5 times for each of the outer loop values, 5 times when the outer loop value is 0, 5 times when the outer loop value is 1, 5 times when the outer loop value is 2, and so on. The inner loop is executed a total of 20 * 5 = 100 times. The turtle can take a long time to finish drawing this pattern. Normally code in the browser is limited to only running in 10 seconds or less. But, we can use the sys
library (short for system) setExecutionLimit(milliseconds)
procedure which will let the code run for up to the specified number of milliseconds. One second is 1,000 milliseconds, so 50,0000 milliseconds is 50 seconds.