Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
micro(A)v11
#11
simple doodle Smile 

Code: (Select All)
'by "roquedrivel" 15/07/23
'this program creates a "doodle" type effect
'  which goes beyond four-leaf clovers and stuff like that
mode 1
var a1, a2, b1, b2, f1, f2, g1, g2, i1, i2, j1, j2, xx, yy
var z1, z2, d2r, xo, yo, xoff, yoff
var xa, ya, xs, ys, xl, yl, xshrink, yshrink, rr, gg, bb
var i, j, o
var x[1000], y[1000]
'"ptr" keyword is useless LOL

'initialize
d2r = (4 * atan(1)) / 180.0
xoff = 600
yoff = 400
rr = rand(32) * 4 + 96
gg = rand(32) * 4 + 96
bb = rand(32) * 4 + 96
a2 = 0
b1 = 180
b2 = 315
f1 = rand(10) / 2 + 1
f2 = rand(10) / 2 + 1
g1 = rand(11) / 4 + 1.5
g2 = rand(11) / 4 + 1.5
f1 = f1 * 100
f2 = f2 * 100
g1 = g1 * 100
g2 = g2 * 100
i1 = rand(1000) / 1000
i2 = rand(1000) / 1000
a1 = rand(1000) / 1000
if i1 > a1
    j1 = i1
    i1 = (rand(33) + 67) / 100
endif
if i2 > a1
    j2 = i2
    i2 = (rand(33) + 100) / 100
endif
i1 = i1 + rand(3)
i2 = i2 + rand(3)
j1 = j1 + rand(3)
j2 = j2 + rand(3)

o = rand(4)
a1 = 0

'create the plot
'there's no "for" loop, this really sucks! I hate "while" without "do... loop"!
i = 1
label fori01
'for i = 1 to 1000
    if o = 1
        z1 = a1 * d2r : z2 = b1 * d2r
        xx = f1 * cos(z1) + g1 * sin(z2)
        z1 = a2 * d2r : z2 = b2 * d2r
        yy = f2 * sin(z1) + g2 * sin(z2)
    endif
    if o = 2
        z1 = a1 * d2r : z2 = b1 * d2r
        xx = f1 * cos(z1) + g1 * sin(z2)
        z1 = a2 * d2r : z2 = b2 * d2r
        yy = f2 * (sin(z1) + sin(z2))
    endif
    if o = 3
        z1 = a1 * d2r : z2 = b1 * d2r
        xx = f1 * (cos(z1) + sin(z2))
        z1 = a2 * d2r : z2 = b2 * d2r
        yy = f2 * sin(z1) * g2 * sin(z2)
    endif
    if o = 4
        z1 = a1 * d2r : z2 = b1 * d2r
        xx = f1 * (cos(z1) + sin(z2))
        z1 = a2 * d2r : z2 = b2 * d2r
        yy = f2 * (sin(z1) + sin(z2))
    endif
    x[i] = int(xx)
    y[i] = int(yy)
    a1 = a1 + i1
    if a1 > 360 : a1 = a1 - 360 : endif
    a2 = a2 + i2
    if a2 > 360 : a2 = a2 - 360 : endif
    b1 = a1 + j1
    if b1 > 360 : b1 = b1 - 360 : endif
    b2 = b2 + j2
    if b2 > 360 : b2 = b2 - 360 : endif
i = i + 1
if i < 1000 : goto fori01 : endif
'next

'figure out which is the smallest of X and Y
xa = x[1]
ya = y[1]
i = 2
label fori02
'for i = 2 to 1000
    if x[i] < xa : xa = x[i] : endif
    if y[i] < ya : ya = y[i] : endif
i = i + 1
if i < 1000 : goto fori02 : endif
'next

'make all coordinates positive or zero
wcolor 0, 0, 0
xa = xa * (-1)
ya = ya * (-1)
i = 1
label fori04
    x[i] = x[i] + xa
    y[i] = y[i] + ya
i = i + 1
if i < 1000 : goto fori04 : endif

'figure out the total width and height of the plot
xs = x[1]
ys = y[1]
xl = x[1]
yl = y[1]
i = 2
label fori05
'for i = 2 to 1000
    if x[i] < xs : xs = x[i] : endif
    if y[i] < ys : ys = y[i] : endif
    if x[i] > xl : xl = x[i] : endif
    if y[i] > yl : yl = y[i] : endif
i = i + 1
if i < 1000 : goto fori05 : endif
'next

'use that information to scale the drawing to our graphics screen
xa = xl - xs
ya = yl - ys
if xa > xoff : j = 1 : endif
if ya > yoff : j = 1 : endif
if j = 1
i = 1
label fori06
    x[i] = (x[i] / xa) * xoff
    y[i] = (y[i] / ya) * yoff
i = i + 1
if i < 1000 : goto fori06 : endif
endif

'actually draw the thing
xo = x[1]
yo = y[1]
i = 2
label fori03
'for i = 1 to 1000
    fcolor rr, gg, bb
    line xo, yo, x[i], y[i]: 'swap
    xo = x[i]
    yo = y[i]
i = i + 1
if i < 1000 : goto fori03 : endif
'next
fcolor 128, 0, 216
print 0, 0, "DONE"
swap
Reply


Messages In This Thread
micro(A)v11 - by aurel - 07-07-2023, 03:05 PM
RE: mAv11 - by mnrvovrfc - 07-07-2023, 06:52 PM
RE: mAv11 - by mnrvovrfc - 07-07-2023, 07:08 PM
RE: mAv11 - by aurel - 07-07-2023, 09:30 PM
RE: mAv11 - by aurel - 07-10-2023, 04:13 PM
RE: mAv11 - by aurel - 07-10-2023, 07:17 PM
RE: micro(A)v11 - by aurel - 07-12-2023, 05:03 PM
RE: micro(A)v11 - by aurel - 07-13-2023, 06:38 PM
RE: micro(A)v11 - by mnrvovrfc - 07-13-2023, 07:08 PM
RE: micro(A)v11 - by aurel - 07-15-2023, 04:27 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 02:52 PM
RE: micro(A)v11 - by bplus - 07-16-2023, 03:56 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 06:19 PM
RE: micro(A)v11 - by bplus - 07-16-2023, 06:39 PM
RE: micro(A)v11 - by mnrvovrfc - 07-16-2023, 07:34 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 09:34 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 09:42 PM
RE: micro(A)v11 - by aurel - 07-19-2023, 11:53 AM
RE: micro(A)v11 - by aurel - 07-21-2023, 06:38 AM
RE: micro(A)v11 - by mnrvovrfc - 07-21-2023, 06:45 AM
RE: micro(A)v11 - by aurel - 07-21-2023, 09:09 PM
RE: micro(A)v11 - by mnrvovrfc - 07-24-2023, 02:23 AM
RE: micro(A)v11 - by aurel - 07-24-2023, 07:00 AM
RE: micro(A)v11 - by aurel - 07-25-2023, 09:16 PM
RE: micro(A)v11 - by aurel - 07-26-2023, 05:30 PM
RE: micro(A)v11 - by aurel - 07-26-2023, 10:42 PM
RE: micro(A)v11 - by aurel - 07-27-2023, 09:55 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 02:29 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 07:42 AM
RE: micro(A)v11 - by aurel - 07-28-2023, 06:43 AM
RE: micro(A)v11 - by aurel - 07-28-2023, 09:38 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 05:59 PM
RE: micro(A)v11 - by aurel - 07-28-2023, 07:14 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 03:09 PM
RE: micro(A)v11 - by mnrvovrfc - 07-29-2023, 07:07 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 07:45 PM
RE: micro(A)v11 - by aurel - 07-29-2023, 09:30 PM
RE: micro(A)v11 - by aurel - 07-29-2023, 09:31 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 09:53 PM
RE: micro(A)v11 - by mnrvovrfc - 07-29-2023, 10:10 PM
RE: micro(A)v11 - by aurel - 07-30-2023, 09:49 AM
RE: micro(A)v11 - by bplus - 07-30-2023, 02:35 PM
RE: micro(A)v11 - by aurel - 07-30-2023, 03:05 PM
RE: micro(A)v11 - by mnrvovrfc - 07-31-2023, 01:54 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 02:10 PM
RE: micro(A)v11 - by mnrvovrfc - 07-31-2023, 02:39 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 03:09 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 03:10 PM
RE: micro(A)v11 - by mnrvovrfc - 08-01-2023, 03:12 PM
RE: micro(A)v11 - by bplus - 08-01-2023, 03:36 PM
RE: micro(A)v11 - by mnrvovrfc - 08-01-2023, 11:49 PM
RE: micro(A)v11 - by aurel - 08-02-2023, 08:21 AM
RE: micro(A)v11 - by mnrvovrfc - 08-08-2023, 03:59 AM
RE: micro(A)v11 - by aurel - 08-08-2023, 10:18 AM
RE: micro(A)v11 - by mnrvovrfc - 08-11-2023, 08:43 AM
RE: micro(A)v11 - by bplus - 08-11-2023, 09:17 AM
RE: micro(A)v11 - by aurel - 08-11-2023, 11:39 AM
RE: micro(A)v11 - by bplus - 08-11-2023, 01:19 PM
RE: micro(A)v11 - by aurel - 08-11-2023, 07:43 PM
RE: micro(A)v11 - by aurel - 08-11-2023, 10:41 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:31 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:36 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:47 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:49 AM
RE: micro(A)v11 - by mnrvovrfc - 08-12-2023, 12:18 PM
RE: micro(A)v11 - by bplus - 08-12-2023, 12:59 PM
RE: micro(A)v11 - by mnrvovrfc - 08-12-2023, 02:49 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 07:14 PM
RE: micro(A)v11 - by bplus - 08-12-2023, 07:35 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 09:02 PM
RE: micro(A)v11 - by mnrvovrfc - 08-14-2023, 04:43 PM
RE: micro(A)v11 - by aurel - 08-15-2023, 07:36 AM
RE: micro(A)v11 - by bplus - 08-15-2023, 12:42 PM
RE: micro(A)v11 - by aurel - 08-15-2023, 06:44 PM
RE: micro(A)v11 - by mnrvovrfc - 08-15-2023, 10:07 PM
RE: micro(A)v11 - by aurel - 08-16-2023, 06:51 AM
RE: micro(A)v11 - by aurel - 08-16-2023, 09:03 AM
RE: micro(A)v11 - by aurel - 08-20-2023, 10:54 AM
RE: micro(A)v11 - by mnrvovrfc - 08-20-2023, 01:23 PM
RE: micro(A)v11 - by aurel - 08-20-2023, 03:08 PM
RE: micro(A)v11 - by dbox - 08-20-2023, 03:46 PM
RE: micro(A)v11 - by mnrvovrfc - 08-20-2023, 04:19 PM
RE: micro(A)v11 - by aurel - 08-20-2023, 09:51 PM
RE: micro(A)v11 - by aurel - 08-25-2023, 01:47 PM
RE: micro(A)v11 - by aurel - 08-30-2023, 08:24 PM
RE: micro(A)v11 - by mnrvovrfc - 08-30-2023, 08:36 PM
RE: micro(A)v11 - by TerryRitchie - 08-30-2023, 09:18 PM
RE: micro(A)v11 - by aurel - 08-30-2023, 09:20 PM
RE: micro(A)v11 - by aurel - 08-31-2023, 07:40 PM
RE: micro(A)v11 - by aurel - 08-31-2023, 08:13 PM
RE: micro(A)v11 - by bplus - 08-31-2023, 09:14 PM
RE: micro(A)v11 - by aurel - 09-01-2023, 01:18 PM
RE: micro(A)v11 - by aurel - 09-08-2023, 07:05 AM
RE: micro(A)v11 - by aurel - 05-03-2024, 08:30 AM
RE: micro(A)v11 - by aurel - 05-03-2024, 08:44 AM
RE: micro(A)v11 - by aurel - 05-05-2024, 11:43 AM
RE: micro(A)v11 - by bplus - 05-05-2024, 05:25 PM
RE: micro(A)v11 - by aurel - 05-06-2024, 05:07 AM
RE: micro(A)v11 - by aurel - 08-03-2024, 10:57 AM
RE: micro(A)v11 - by bplus - 08-03-2024, 12:04 PM
RE: micro(A)v11 - by aurel - 08-03-2024, 12:49 PM
RE: micro(A)v11 - by Pete - 08-03-2024, 01:37 PM
RE: micro(A)v11 - by aurel - 08-03-2024, 03:41 PM
RE: micro(A)v11 - by bplus - 08-03-2024, 05:13 PM
RE: micro(A)v11 - by SMcNeill - 08-04-2024, 05:51 PM
RE: micro(A)v11 - by aurel - 08-04-2024, 06:41 PM
RE: micro(A)v11 - by Pete - 08-04-2024, 08:02 PM
RE: micro(A)v11 - by aurel - 08-05-2024, 06:26 AM



Users browsing this thread: 10 Guest(s)