by jjo (5 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd March 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Draws a dragon
Private Sub Form_Load()
Caption = ""
Icon = LoadPicture("")
End Sub
Private Sub Form_Paint()
Cls
ReDim a(3), b(3), c(3), d(3), e(3), f(3)
Scale (0, 0)-(2000, 2000)
Dim x As Single, y As Single, newX As Single, newY As Single
Dim k As Integer, n As Long, iter As Long, mag As Single
a(1) = 0.5: b(1) = 0.5: c(1) = -0.5: d(1) = 0.5: e(1) = -1: f(1) = 1
a(2) = 0.5: b(2) = 0.5: c(2) = -0.5: d(2) = 0.5: e(2) = -1: f(2) = 1
a(3) = 0.5: b(3) = 0.5: c(3) = -0.5: d(3) = 0.5: e(3) = 1: f(3) = 1
mag = 350
iter = 150000
For n = 1 To iter
k = Int(3 * Rnd) + 1
newX = a(k) * x + b(k) * y + e(k)
newY = c(k) * x + d(k) * y + f(k)
x = newX: y = newY
PSet (x * mag + 700, y * mag + 700), QBColor(k)
Next n
End Sub