Computer Science Canada Turing - Is there an easier way to do this? |
Author: | ObeseStalker [ Fri Mar 03, 2017 9:44 am ] |
Post subject: | Turing - Is there an easier way to do this? |
Hello, this is my code. I'm wondering if theres any way i can do this more easily. I'm pretty new to turing. Thanks. setscreen ("graphics:vga") for i : 1 .. 10000 drawoval (320, 200, i, i, 7) drawoval (320, 200, i - 5, i - 5, 8) drawoval (320, 200, i - 10, i - 10, 9) drawoval (320, 200, i - 15, i - 15, 10) drawoval (320, 200, i - 20, i - 20, 11) drawoval (320, 200, i - 25, i - 25, 12) drawoval (320, 200, i - 30, i - 30, 13) drawoval (320, 200, i - 35, i - 35, 14) drawoval (320, 200, i - 40, i - 40, 7) drawoval (320, 200, i - 45, i - 45, 8) drawoval (320, 200, i - 50, i - 50, 9) drawoval (320, 200, i - 55, i - 55, 10) drawoval (320, 200, i - 60, i - 60, 11) drawoval (320, 200, i - 65, i - 65, 12) drawoval (320, 200, i - 70, i - 70, 13) drawoval (320, 200, i - 75, i - 75, 14) drawoval (320, 200, i - 80, i - 80, 7) drawoval (320, 200, i - 85, i - 85, 8) drawoval (320, 200, i - 90, i - 90, 9) drawoval (320, 200, i - 95, i - 95, 10) drawoval (320, 200, i - 100, i - 100, 11) drawoval (320, 200, i - 105, i - 105, 12) drawoval (320, 200, i - 110, i - 110, 13) drawoval (320, 200, i - 115, i - 115, 14) drawoval (320, 200, i - 120, i - 120, 7) drawoval (320, 200, i - 125, i - 125, 8) drawoval (320, 200, i - 130, i - 130, 9) drawoval (320, 200, i - 135, i - 135, 10) drawoval (320, 200, i - 140, i - 140, 11) drawoval (320, 200, i - 145, i - 145, 12) drawoval (320, 200, i - 150, i - 150, 13) drawoval (320, 200, i - 155, i - 155, 14) drawoval (320, 200, i - 160, i - 160, 7) drawoval (320, 200, i - 165, i - 165, 8) drawoval (320, 200, i - 170, i - 170, 9) drawoval (320, 200, i - 175, i - 175, 10) drawoval (320, 200, i - 180, i - 180, 11) drawoval (320, 200, i - 185, i - 185, 12) drawoval (320, 200, i - 190, i - 190, 13) drawoval (320, 200, i - 195, i - 195, 14) drawoval (320, 200, i - 200, i - 200, 7) drawoval (320, 200, i - 205, i - 205, 8) drawoval (320, 200, i - 210, i - 210, 9) drawoval (320, 200, i - 215, i - 215, 10) drawoval (320, 200, i - 220, i - 220, 11) drawoval (320, 200, i - 225, i - 225, 12) drawoval (320, 200, i - 230, i - 230, 13) drawoval (320, 200, i - 235, i - 235, 14) drawoval (320, 200, i - 240, i - 240, 7) drawoval (320, 200, i - 245, i - 245, 8) drawoval (320, 200, i - 250, i - 250, 9) drawoval (320, 200, i - 255, i - 255, 10) drawoval (320, 200, i - 260, i - 260, 11) drawoval (320, 200, i - 265, i - 265, 12) drawoval (320, 200, i - 270, i - 270, 13) drawoval (320, 200, i - 275, i - 275, 14) drawoval (320, 200, i - 280, i - 280, 7) drawoval (320, 200, i - 285, i - 285, 8) drawoval (320, 200, i - 290, i - 290, 9) drawoval (320, 200, i - 295, i - 295, 10) drawoval (320, 200, i - 300, i - 300, 11) drawoval (320, 200, i - 305, i - 305, 12) drawoval (320, 200, i - 310, i - 310, 13) drawoval (320, 200, i - 315, i - 315, 14) drawoval (320, 200, i - 320, i - 320, 7) drawoval (320, 200, i - 325, i - 325, 8) drawoval (320, 200, i - 330, i - 330, 9) drawoval (320, 200, i - 335, i - 335, 10) drawoval (320, 200, i - 340, i - 340, 11) drawoval (320, 200, i - 345, i - 345, 12) drawoval (320, 200, i - 350, i - 350, 13) drawoval (320, 200, i - 355, i - 355, 14) drawoval (320, 200, i - 360, i - 360, 7) drawoval (320, 200, i - 365, i - 365, 8) drawoval (320, 200, i - 370, i - 370, 9) drawoval (320, 200, i - 375, i - 375, 10) drawoval (320, 200, i - 380, i - 380, 11) drawoval (320, 200, i - 385, i - 385, 12) drawoval (320, 200, i - 390, i - 390, 13) drawoval (320, 200, i - 395, i - 395, 14) drawoval (320, 200, i - 400, i - 400, 7) drawoval (320, 200, i - 405, i - 405, 8) drawoval (320, 200, i - 410, i - 410, 9) drawoval (320, 200, i - 415, i - 415, 10) drawoval (320, 200, i - 420, i - 420, 11) drawoval (320, 200, i - 425, i - 425, 12) drawoval (320, 200, i - 430, i - 430, 13) drawoval (320, 200, i - 435, i - 435, 14) drawoval (320, 200, i - 440, i - 440, 7) drawoval (320, 200, i - 445, i - 445, 8) drawoval (320, 200, i - 450, i - 450, 9) drawoval (320, 200, i - 455, i - 455, 10) drawoval (320, 200, i - 460, i - 460, 11) drawoval (320, 200, i - 465, i - 465, 12) drawoval (320, 200, i - 470, i - 470, 13) drawoval (320, 200, i - 475, i - 475, 14) drawoval (320, 200, i - 480, i - 480, 7) drawoval (320, 200, i - 485, i - 485, 8) drawoval (320, 200, i - 490, i - 490, 9) drawoval (320, 200, i - 495, i - 495, 10) drawoval (320, 200, i - 500, i - 500, 11) drawoval (320, 200, i - 505, i - 505, 12) drawoval (320, 200, i - 510, i - 510, 13) drawoval (320, 200, i - 515, i - 515, 14) drawoval (320, 200, i - 520, i - 520, 7) drawoval (320, 200, i - 525, i - 525, 8) drawoval (320, 200, i - 530, i - 530, 9) drawoval (320, 200, i - 535, i - 535, 10) drawoval (320, 200, i - 540, i - 540, 11) drawoval (320, 200, i - 545, i - 545, 12) drawoval (320, 200, i - 550, i - 550, 13) drawoval (320, 200, i - 555, i - 555, 14) drawoval (320, 200, i - 560, i - 560, 7) drawoval (320, 200, i - 565, i - 565, 8) drawoval (320, 200, i - 570, i - 570, 9) drawoval (320, 200, i - 575, i - 575, 10) drawoval (320, 200, i - 580, i - 580, 11) drawoval (320, 200, i - 585, i - 585, 12) drawoval (320, 200, i - 590, i - 590, 13) drawoval (320, 200, i - 595, i - 595, 14) drawoval (320, 200, i - 600, i - 600, 7) drawoval (320, 200, i - 605, i - 605, 8) drawoval (320, 200, i - 610, i - 610, 9) drawoval (320, 200, i - 615, i - 615, 10) drawoval (320, 200, i - 620, i - 620, 11) drawoval (320, 200, i - 625, i - 625, 12) drawoval (320, 200, i - 630, i - 630, 13) drawoval (320, 200, i - 635, i - 635, 14) drawoval (320, 200, i - 640, i - 640, 7) drawoval (320, 200, i - 645, i - 645, 8) drawoval (320, 200, i - 650, i - 650, 9) drawoval (320, 200, i - 655, i - 655, 10) drawoval (320, 200, i - 660, i - 660, 11) drawoval (320, 200, i - 665, i - 665, 12) drawoval (320, 200, i - 670, i - 670, 13) drawoval (320, 200, i - 675, i - 675, 14) drawoval (320, 200, i - 680, i - 680, 7) drawoval (320, 200, i - 685, i - 685, 8) drawoval (320, 200, i - 690, i - 690, 9) drawoval (320, 200, i - 695, i - 695, 10) drawoval (320, 200, i - 700, i - 700, 11) drawoval (320, 200, i - 705, i - 705, 12) drawoval (320, 200, i - 710, i - 710, 13) drawoval (320, 200, i - 715, i - 715, 14) drawoval (320, 200, i - 720, i - 720, 7) drawoval (320, 200, i - 725, i - 725, 8) drawoval (320, 200, i - 730, i - 730, 9) drawoval (320, 200, i - 735, i - 735, 10) drawoval (320, 200, i - 740, i - 740, 11) drawoval (320, 200, i - 745, i - 745, 12) drawoval (320, 200, i - 750, i - 750, 13) drawoval (320, 200, i - 755, i - 755, 14) drawoval (320, 200, i - 760, i - 760, 7) drawoval (320, 200, i - 765, i - 765, 8) drawoval (320, 200, i - 770, i - 770, 9) drawoval (320, 200, i - 775, i - 775, 10) drawoval (320, 200, i - 780, i - 780, 11) drawoval (320, 200, i - 785, i - 785, 12) drawoval (320, 200, i - 790, i - 790, 13) drawoval (320, 200, i - 795, i - 795, 14) drawoval (320, 200, i - 800, i - 800, 7) drawoval (320, 200, i - 805, i - 805, 12) drawoval (320, 200, i - 810, i - 810, 13) drawoval (320, 200, i - 815, i - 815, 14) drawoval (320, 200, i - 820, i - 820, 7) drawoval (320, 200, i - 825, i - 825, 8) drawoval (320, 200, i - 830, i - 830, 9) drawoval (320, 200, i - 835, i - 835, 10) drawoval (320, 200, i - 840, i - 840, 11) drawoval (320, 200, i - 845, i - 845, 12) drawoval (320, 200, i - 850, i - 850, 13) drawoval (320, 200, i - 855, i - 855, 14) drawoval (320, 200, i - 860, i - 860, 7) drawoval (320, 200, i - 865, i - 865, 8) drawoval (320, 200, i - 870, i - 870, 9) drawoval (320, 200, i - 875, i - 875, 10) drawoval (320, 200, i - 880, i - 880, 11) drawoval (320, 200, i - 885, i - 885, 12) drawoval (320, 200, i - 890, i - 890, 13) drawoval (320, 200, i - 895, i - 895, 14) drawoval (320, 200, i - 900, i - 900, 7) drawoval (320, 200, i - 905, i - 905, 12) drawoval (320, 200, i - 910, i - 910, 13) drawoval (320, 200, i - 915, i - 915, 14) drawoval (320, 200, i - 920, i - 920, 7) drawoval (320, 200, i - 925, i - 925, 8) drawoval (320, 200, i - 930, i - 930, 9) drawoval (320, 200, i - 935, i - 935, 10) drawoval (320, 200, i - 940, i - 940, 11) drawoval (320, 200, i - 945, i - 945, 12) drawoval (320, 200, i - 950, i - 950, 13) drawoval (320, 200, i - 955, i - 955, 14) drawoval (320, 200, i - 960, i - 960, 7) drawoval (320, 200, i - 965, i - 965, 8) drawoval (320, 200, i - 970, i - 970, 9) drawoval (320, 200, i - 975, i - 975, 10) drawoval (320, 200, i - 980, i - 980, 11) drawoval (320, 200, i - 985, i - 985, 12) drawoval (320, 200, i - 990, i - 990, 13) drawoval (320, 200, i - 995, i - 995, 14) drawoval (320, 200, i - 1000, i - 1000, 7) end for |
Author: | Insectoid [ Sat Mar 04, 2017 8:53 am ] |
Post subject: | RE:Turing - Is there an easier way to do this? |
take a look at For Loops. They are exactly what you want. |
Author: | ObeseStalker [ Sun Mar 05, 2017 5:10 pm ] |
Post subject: | RE:Turing - Is there an easier way to do this? |
I am using a for loop, but is it possible to have 2 for loops going at once? i tried it but it didnt work |
Author: | DemonWasp [ Tue Mar 07, 2017 7:59 pm ] | ||
Post subject: | RE:Turing - Is there an easier way to do this? | ||
You need to use different variables to hold the for-loop counters. Try this example program:
Note that the inner loop runs through all of its iterations on each run of the outer loop. |