Pisanje programa

     
 

Rješenja zadataka

  1. to natpis :tekst :n
    repeat :n[clean setpc random 20 label :tekst rt 30  wait 100]
    end
  2. to spirala :m :n :s
    repeat :m[fd :s rt 360/:n make "s :s+5]
    end
  3. to pravokutnik :a :b
    repeat 2[fd :a rt 90 fd :b rt 90]
    end

    to ljestve :a :b :n
    repeat :n [pravokutnik :a :b pu fd :a pd]
    end
  4. to kvadrat :a
    setpc random 15
    repeat 4[fd :a rt 90]
    end

    to red :n :a
    repeat :n[kvadrat :a pu rt 90 fd :a lt 90 pd]
    end
  5. to pravokutnik :a :b
    repeat 2[fd :a rt 90 fd :b rt 90]
    end

    to red :n :a :b
    repeat :n[pravokutnik :a :b pu rt 90 fd :b lt 90 pd]
    end

    to zid :m :n :a :b
    repeat :m[red :n :a :b pu rt 90 bk :b*:n lt 90 fd :a pd ]
    end
  6. to racun :x :y
    make "zbroj :x+:y
    make "razlika :x-:y
    make "umnozak :x*:y
    make "kolicnik :x/:y
    print (se "zbroj "je :zbroj)
    print (se "razlika "je :razlika)
    print (se "umnožak "je :umnozak)
    print (se "količnik "je :kolicnik)
    end
  7. to pogodi
    print random 25
    end
  8. to kvadrat
    make "a (random 70) + 30
    repeat 4[fd :a rt 90]
    make "opseg 4*:a
    make "povrsina :a*:a
    print (se "Opseg "je :opseg)
    print (se "Povrsina "je :povrsina)
    end
  9. to krak :a
    fd :a bk :a
    end

    to zvijezda :n :a
    repeat :n[krak :a rt 360/:n make "a :a*2]
    end
  10. to paralelogram :a :b :kut
    repeat 2[fd :a rt :kut fd :b rt (180-:kut)]
    end