
-----------------------------------
civicstar
Fri Mar 11, 2005 10:59 am

help me with turing!!!
-----------------------------------
k we r learning turing in class and i have an assignment due and i dont even know where to start..so if anyone who uis farmiliar with this program could u plz help me out

heres the question:

Using you "looping structures" and out new "locate" function, attempt to create an animation "face". Your face will alternate between "happy", and a "sad" face.
(Hint : use "loops", delays, and cls(clear screen))

thx! :lol:

-----------------------------------
Tony
Fri Mar 11, 2005 11:56 am


-----------------------------------

var i : int := 0
loop
    i += 1
    locate (round (maxrow / 2), round (maxcol / 2))
    put "=" + chr (40 + i mod 2)
    delay (500)
end loop

browse our tutorials to learn about loops. use of locate() can be found in Turing's help files F10

-----------------------------------
Mazer
Fri Mar 11, 2005 1:21 pm


-----------------------------------
1) Should be more specific in subject.
2) Should be in Turing Help.
3) Moved.

-----------------------------------
ssr
Fri Mar 11, 2005 8:51 pm


-----------------------------------
loop
locate (1,1)
put "= ("
delay (500)
locate (1,1)
put "= )"
delay (500)
end loop 
lol :lol:

-----------------------------------
MysticVegeta
Fri Mar 11, 2005 9:58 pm


-----------------------------------
var lol : boolean := true
var expression : string
loop
    if lol then
        expression:= chr (41)
        lol := false
    else
        expression:= chr (47)
        lol := true
    end if
    locate (round (maxrow / 2), round (maxcol / 2))
    put "=", expression
    delay (1000)
end loop


my type lol

-----------------------------------
illu45
Sat Mar 12, 2005 7:00 pm


-----------------------------------

var i : int := 0
loop
    i += 1
    locate (round (maxrow / 2), round (maxcol / 2))
    put "=" + chr (40 + i mod 2)
    delay (500)
end loop

browse our tutorials to learn about loops. use of locate() can be found in Turing's help files F10

Lol, that's great.

Here's my slighlty more deltailed happy face... No locate statements, though...

var i : int := 0
loop
    if i = 0 then
        delay (1000)
        cls
        drawoval (320, 200, 100, 100, 1)
        drawoval (275, 230, 20, 20, 1)
        drawoval (360, 230, 20, 20, 1)
        drawline (320, 200, 320, 170, 1)
        drawarc (320, 150, 50, 25, 180, 0, 1)
        i := 1
    elsif i = 1 then
        delay (1000)
        cls
        drawoval (320, 200, 100, 100, 1)
        drawoval (275, 230, 20, 20, 1)
        drawoval (360, 230, 20, 20, 1)
        drawline (320, 200, 320, 170, 1)
        drawarc (320, 125, 50, 25, 0, 180, 1)
        i := 0
    end if
end loop


-----------------------------------
Token
Sat Mar 12, 2005 8:48 pm


-----------------------------------
Heh, ssr i was thinking the exact same thing  :lol: 
and Illu45, i fixed up ur code to include 3 locate statements  :wink: 


var i : int := 0
locate (1, 30)
put "This is illu45's face"

loop
    if i = 0 then
        delay (1000)
        cls
        locate (1, 30)
        put "This is illu45's face"
        drawoval (320, 200, 100, 100, 1)
        drawoval (275, 230, 20, 20, 1)
        drawoval (360, 230, 20, 20, 1)
        drawline (320, 200, 320, 170, 1)
        drawarc (320, 150, 50, 25, 180, 0, 1)
        i := 1
    elsif i = 1 then
        delay (1000)
        cls
        locate (1, 30)
        put "This is illu45's face"
        drawoval (320, 200, 100, 100, 1)
        drawoval (275, 230, 20, 20, 1)
        drawoval (360, 230, 20, 20, 1)
        drawline (320, 200, 320, 170, 1)
        drawarc (320, 125, 50, 25, 0, 180, 1)
        i := 0
    end if
end loop


-----------------------------------
ssr
Sat Mar 12, 2005 9:20 pm


-----------------------------------
View.Set ("offscreenonly")
proc face
    drawfilloval (320, 200, 100, 100, yellow)
    drawfilloval (275, 230, 20, 20, blue)
    drawfilloval (360, 230, 20, 20, blue)
    drawline (320, 210, 320, 190, 1)
end face
loop
    for decreasing i : 25 .. 1
        face
        drawarc (320, 150, 50, i, 0, 180, brightred)
        delay (100)
        View.Update
        cls
    end for
    for i : 1 .. 25
        face
        drawarc (320, 150, 50, i, 180, 0, brightred)
        delay (100)
        View.Update
        cls
    end for
    for decreasing i : 25 .. 1
        face
        drawarc (320, 150, 50, i, 180, 0, brightred)
        delay (100)
        View.Update
        cls
    end for
    for i : 1 .. 25
        face
        drawarc (320, 150, 50, i, 0, 180, brightred)
        delay (100)
        View.Update
        cls
    end for
end loop
Another face :D  :(  8)

-----------------------------------
illu45
Sat Mar 12, 2005 9:34 pm


-----------------------------------
Here's another face, with wrinkles and tears... Still no locate statements.. I really see no need for them in a program like this one. 


var i : int := 0
var r2, r1 : int

loop
for decreasing z : 40 .. 0 by 5
    r2 := z
    drawoval (320, 200, 125, 125, 1)
    drawoval (275, 230, 20, 20, 1)
    drawoval (360, 230, 20, 20, 1)
    drawline (320, 200, 320, 170, 1)
    drawarc (320, 130, 50, r2, 180, 0, 1)
    if z >= 35 then
        drawline (225, 250, 260, 250, 1)
        drawline (225, 210, 260, 210, 1)
        drawline (250, 230, 210, 230, 1)
        drawline (210, 230, 205, 240, 1)
        drawline (375, 250, 400, 250, 1)
        drawline (375, 210, 400, 210, 1)
        drawline (385, 230, 420, 230, 1)
        drawline (420, 230, 425, 240, 1)
    elsif z >= 30 or z >= 25 then
        drawline (250, 230, 210, 230, 1)
        drawline (210, 230, 205, 240, 1)
        drawline (385, 230, 420, 230, 1)
        drawline (420, 230, 425, 240, 1)
    elsif z >= 20 or z >= 10 then
        drawline (250, 230, 210, 230, 1)
        drawline (385, 230, 420, 230, 1)
    end if
    delay (250)
    cls
end for

for x : 0 .. 30 by 5
    r1 := x
    drawoval (320, 200, 125, 125, 1)
    drawoval (275, 230, 20, 20, 1)
    drawoval (360, 230, 20, 20, 1)
    drawline (320, 200, 320, 170, 1)
    drawarc (320, 130, 50, r1, 0, 180, 1)
    if x = 5 and x < 10 then
        drawoval (375, 200, 5, 5, 1)
    elsif x = 10 and x < 15 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
    elsif x = 15 and x < 20 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
    elsif x = 20 and x < 25 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
        drawoval (290, 170, 5, 5, 1)
    elsif x >= 25 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
        drawoval (290, 170, 5, 5, 1)
        drawoval (375, 160, 5, 5, 1)
    end if
    delay (250)
    cls
end for

for decreasing x2 : 30 .. 0 by 5
    r1 := x2
    drawoval (320, 200, 125, 125, 1)
    drawoval (275, 230, 20, 20, 1)
    drawoval (360, 230, 20, 20, 1)
    drawline (320, 200, 320, 170, 1)
    drawarc (320, 130, 50, r1, 0, 180, 1)
    if x2 = 5 and x2 < 10 then
        drawoval (375, 200, 5, 5, 1)
    elsif x2 = 10 and x2 < 15 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
    elsif x2 = 15 and x2 < 20 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
    elsif x2 = 20 and x2 < 25 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
        drawoval (290, 170, 5, 5, 1)
    elsif x2 >= 25 then
        drawoval (375, 200, 5, 5, 1)
        drawoval (290, 190, 5, 5, 1)
        drawoval (375, 180, 5, 5, 1)
        drawoval (290, 170, 5, 5, 1)
        drawoval (375, 160, 5, 5, 1)
    end if
    delay (250)
    cls
end for

for z2 : 0 .. 40 by 5
    r2 := z2
    drawoval (320, 200, 125, 125, 1)
    drawoval (275, 230, 20, 20, 1)
    drawoval (360, 230, 20, 20, 1)
    drawline (320, 200, 320, 170, 1)
    drawarc (320, 130, 50, r2, 180, 0, 1)
    if z2 >= 35 then
        drawline (225, 250, 260, 250, 1)
        drawline (225, 210, 260, 210, 1)
        drawline (250, 230, 210, 230, 1)
        drawline (210, 230, 205, 240, 1)
        drawline (375, 250, 400, 250, 1)
        drawline (375, 210, 400, 210, 1)
        drawline (385, 230, 420, 230, 1)
        drawline (420, 230, 425, 240, 1)
    elsif z2 >= 30 or z2 >= 25 then
        drawline (250, 230, 210, 230, 1)
        drawline (210, 230, 205, 240, 1)
        drawline (385, 230, 420, 230, 1)
        drawline (420, 230, 425, 240, 1)
    elsif z2 >= 20 or z2 >= 10 then
        drawline (250, 230, 210, 230, 1)
        drawline (385, 230, 420, 230, 1)
    end if
    delay (250)
    cls
end for
end loop



Yes, I know its long... Gimme a break. If you can find a way to shorten it, feel free.

-----------------------------------
MysticVegeta
Sun Mar 20, 2005 11:48 am


-----------------------------------
Wow ppl actually spent time on faces lol

-----------------------------------
ssr
Sun Mar 20, 2005 9:11 pm


-----------------------------------
lol yes we LOVE human faces  :D  :(  :o  :lol:  :?  :shock:  :x  :P  :cry:  :oops:  :(  :)  :D  :roll:  :wink:
