SCREEN 12
CONST ML = 10000
DIM x!(ML), y!(ML), xs!(ML), ys!(ML), Clr%(ML), St&
x!(1) = 320: y!(1) = 479: LA = 1
RANDOMIZE TIMER
xs!(1) = RND * 1 - .5: Clr%(1) = RND * 14 + 1: ys!(1) = -2
WHILE INKEY$ = ""
IF f! <> TIMER THEN
FOR i = 1 TO LA
Ncx! = x!(i) + xs!(i): Ncy! = y!(i) + ys!(i)
LINE (x!(i), y!(i))-(Ncx!, Ncy!), Clr%(i)
x!(i) = Ncx!: y!(i) = Ncy!
NEXT
' Разветвление линий
IF St& > 10 AND LA < 512 THEN
FOR i = 1 TO LA * 1
x!(i + LA) = x!(i)
xs!(i + LA) = RND * 6 - 3
y!(i + LA) = y!(i)
ys!(i + LA) = -2 - RND * 2
Clr%(i + LA) = RND * 14 + 1
NEXT: LA = LA * 2
St& = 0
LOCATE 1, 1: PRINT LA
END IF
f! = TIMER: St& = St& + 1
END IF
WEND
SCREEN 12
CONST ML = 256
DIM x!(ML), y!(ML), xs!(ML), ys!(ML), Clr%(ML), St&
x!(1) = 320: y!(1) = 479: LA = 1
RANDOMIZE TIMER
xs!(1) = RND * 1 - .5: Clr%(1) = RND * 14 + 1: ys!(1) = -2
WHILE INKEY$ = ""
IF f! <> TIMER THEN
FOR i = 1 TO LA
Ncx! = x!(i) + xs!(i): Ncy! = y!(i) + ys!(i)
LINE (x!(i), y!(i))-(Ncx!, Ncy!), Clr%(i)
x!(i) = Ncx!: y!(i) = Ncy!
NEXT
' Разветвление линий
IF St& > 10 AND LA < 256 THEN
FOR i = 1 TO LA * 1
x!(i + LA) = x!(i)
xs!(i + LA) = RND * 6 - 3
y!(i + LA) = y!(i)
ys!(i + LA) = -2 - RND * 2
Clr%(i + LA) = RND * 14 + 1
NEXT: LA = LA * 2
St& = 0
LOCATE 1, 1: PRINT LA
END IF
f! = TIMER: St& = St& + 1
END IF
WEND
Тестирование выполнено в программе QB64 ( Скачать )