
-----------------------------------
TheOneTrueGod
Sun May 14, 2006 12:03 am

Parametric (originally by catalyst in C++)
-----------------------------------
I saw this really cool program done by catalyst in C++, and I decided to bring it over into turing :D

const startValue := 30
const maxValue := 70
const incrementAmount := 0.1
const maxDist := 700

procedure DrawLine (x, y : real, angle : real, dist : real, inc : real)
    Draw.ThickLine (round (x), round (y), round (x + cosd (angle) * dist), round (y + sind (angle) * dist), 1, white)
    if dist > maxDist then
        return
    end if
    DrawLine (round (x + cosd (angle) * dist), round (y + sind (angle) * dist), angle + inc, dist + 1, inc)
end DrawLine

View.Set ('graphics:500,500')
View.Set ('offscreenonly')
View.Set ('nobuttonbar')
View.Set ('position:centre;centre')

Text.ColourBack (black)
cls
var a : real := startValue
loop
    a += incrementAmount
    if a > maxValue then
        a := startValue
    end if

    DrawLine (maxx div 2, maxy div 2, 0, 0, a)
    View.Update
    Time.DelaySinceLast (50)
    cls
end loop

-----------------------------------
upthescale
Sun May 14, 2006 12:07 am


-----------------------------------
imporessive...i changed the coding around and messed it up lol

-----------------------------------
jamonathin
Sun May 14, 2006 12:08 am


-----------------------------------
Ah yes, the catalyst programs.  Very cool.  
Go Recursion!
(the View.Set's can be in 1 line, but im shure u know that)

-----------------------------------
TheOneTrueGod
Sun May 14, 2006 8:30 am


-----------------------------------
Yarr, I knew it, but I didn't know how to implement it :P what character do you use to separate different commands?

-----------------------------------
AzureFire
Sun May 14, 2006 8:47 am


-----------------------------------
you use a comma like this;

View.Set("graphics:300;200, nobuttonbar, noecho")
etc.

And isn't offscreenonly set by default?

-----------------------------------
Cervantes
Sun May 14, 2006 9:42 am


-----------------------------------
And isn't offscreenonly set by default?
No, offscreenonly is not set by default.

-----------------------------------
Delos
Sun May 14, 2006 11:11 am


-----------------------------------
Heh, not bad at all.  It's been a while since we've had anyone attempt this programme (yeah, we've had quite a few such submissions in the past).  Good job though.  Methinks zylum did this a while back too - see if you can track down his code and do a comparisson.
