Parametric (originally by catalyst in C++)
Author |
Message |
TheOneTrueGod

|
Posted: Sun May 14, 2006 12:03 am Post subject: 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
code: | 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 |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
upthescale
|
Posted: Sun May 14, 2006 12:07 am Post subject: (No subject) |
|
|
imporessive...i changed the coding around and messed it up lol |
|
|
|
|
 |
jamonathin

|
Posted: Sun May 14, 2006 12:08 am Post subject: (No subject) |
|
|
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

|
Posted: Sun May 14, 2006 8:30 am Post subject: (No subject) |
|
|
Yarr, I knew it, but I didn't know how to implement it what character do you use to separate different commands? |
|
|
|
|
 |
AzureFire

|
Posted: Sun May 14, 2006 8:47 am Post subject: (No subject) |
|
|
you use a comma like this;
code: | View.Set("graphics:300;200, nobuttonbar, noecho") |
etc.
And isn't offscreenonly set by default? |
|
|
|
|
 |
Cervantes

|
Posted: Sun May 14, 2006 9:42 am Post subject: (No subject) |
|
|
AzureFire wrote: And isn't offscreenonly set by default?
No, offscreenonly is not set by default. |
|
|
|
|
 |
Delos

|
Posted: Sun May 14, 2006 11:11 am Post subject: (No subject) |
|
|
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. |
|
|
|
|
 |
|
|