package org.teachingkidsprogramming.section01forloops;

import org.teachingextensions.logo.Tortoise;
import org.teachingextensions.logo.utils.ColorUtils.ColorWheel;
import org.teachingextensions.logo.utils.ColorUtils.PenColors;
import org.teachingextensions.logo.utils.EventUtils.MessageBox;

public class Spiral
{
  public static void main(String[] args)
  {
    //    Show the tortoise --#1
    Tortoise.show();
    //    Make the tortoise go as fast as possible --#4
    Tortoise.setSpeed(10);
    //    Add Blue Violet to the Color Wheel --#7 HINT: Use the ColorWheel object
    ColorWheel.addColor(PenColors.Purples.BlueViolet);
    //    Add Violet to the Color Wheel --#8
    ColorWheel.addColor(PenColors.Purples.Violet);
    //    Add Purple to the Color Wheel --#9
    ColorWheel.addColor(PenColors.Purples.Purple);
    //    Do the following 75 times --#3.1
    for (int i = 0; i < 75; i++)
    {     
    try
    {
      //         Change the pen color of the line the tortoise draws the next color on the Color Wheel --#6
      Tortoise.setPenColor(ColorWheel.getNextColor());     
      //         Move the tortoise 5 times the current line number you are drawing --#5
      Tortoise.move(5 * i);
      //         Turn the tortoise 1/3 of 360 degrees to the right --#2
      Tortoise.turn(360 / 3);
    }
    catch (RuntimeException re)
    {
      MessageBox.showMessage("Hold up: " + re);
    }
    //    End Repeat --#3.2
    }
  }
    
    
}

@@ -349,24 +349,90 @@
 %5D args)%0A  %7B%0A
+    int j = MessageBox.askForNumericalInput(%22Quanti lati vuoi?%22);%0A
     //    Sh
@@ -1262,17 +1262,17 @@
 se.move(
-5
+3
  * i);%0A 
@@ -1342,16 +1342,23 @@
 ht --#2%0A
+      %0A
       To
@@ -1376,12 +1376,14 @@
 (360
+.0
  / 
-3
+j
 );%0A 

Revert "Revert "spirale 2.0""