Visualizzare sequenze di numeri con passo +1, -1, +2, -2
Il codice
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
For i=1 To 10 TextWindow.Write(i+" ") EndFor TextWindow.WriteLine("") TextWindow.WriteLine("----------------------------------") For i=1 To 10 Step 2 TextWindow.Write(i+" ") EndFor TextWindow.WriteLine("") TextWindow.WriteLine("----------------------------------") For i=10 To 1 Step -1 TextWindow.Write(i+" ") EndFor TextWindow.WriteLine("") TextWindow.WriteLine("----------------------------------") For i=10 To 1 Step -2 TextWindow.Write(i+" ") EndFor TextWindow.WriteLine("") TextWindow.WriteLine("----------------------------------") |
Aggiungi nuovi blocchi di codice con
-
1i=-10 To 10 Step 3
-
1i=-10 To 10 Step 1.5
-
1i=10 To -10 Step -3
-
1i=10 To -10 Step -4
Quali sequenze appariranno sullo schermo?