
-----------------------------------
bass_maniac
Fri Sep 30, 2005 11:29 am

Not sure why it won't appear...
-----------------------------------
Ok, here's the code,

var radius : int
var centerx := maxx div 2
var centery := maxy div 2
var xDist, yDist := 0

put "Create a sphere with a radius of (pixels): " ..
get radius

cls
View.Set ("nocursor")
var sph1x : array 1 .. 2 * radius of int
var sph1y : array 1 .. 2 * radius of int
var sph1z : array 1 .. 2 * radius of int

for a : 1 .. 2 * radius
    for b : 1 .. 2 * radius
        xDist := a - centerx
        yDist := b - centery
        if sqrt (xDist ** 2 + yDist ** 2)  600 then
    radius := 600
elsif radius < 150 then
    radius := 150
end if

View.Set ("graphics:" + intstr (radius) + ";" + intstr (radius) + ",nobuttonbar,position:center;center")
var centerx := maxx div 2
var centery := maxy div 2
process thing
    var c : int := 1
    for i : 1 .. radius
        for q : 1 .. 360
            drawdot (round (centerx - i * sind (q)), round (centery - i * cosd (q)), Rand.Int (16, 28))
        end for
    end for
end thing

cls

loop
    fork thing
    Time.Delay (radius * 10)
    exit when hasch
end loop


-----------------------------------
Mr. T
Fri Sep 30, 2005 4:12 pm

Alex's Opinion
-----------------------------------
Your second code doesn't work.  :?

-----------------------------------
beard0
Fri Sep 30, 2005 6:56 pm

Re: Alex's Opinion
-----------------------------------
Your second code doesn't work.  :?

Yes it does - notice where the's an emoticon?  He had "28))" and it got changed on him to "2http://www.compsci.ca/v2/images/smiles/icon_cool.gif)" because 8) is the symbol to create that emoticon.  Change it back and it works fine http://www.compsci.ca/v2/images/smiles/icon_biggrin.gif.

-----------------------------------
Cervantes
Fri Sep 30, 2005 8:24 pm

Re: a suggestion
-----------------------------------
put the x and y coordinates of the pixel into 2 arrays (or a 2d array if you can figure it out)

2 1D arrays are NOT the same as a 2D array.  Unless the second dimension of the 2D array has only 2 elements, in which case they are similar.

-----------------------------------
ZeroPaladn
Sat Oct 01, 2005 3:51 pm


-----------------------------------
really, i thought that 2d arrays and 1d arrays were the same thing, cept for the fact that you can store 2 kinds of data in a 2D array  :oops:

-----------------------------------
beard0
Sat Oct 01, 2005 3:57 pm


-----------------------------------
Nope.  A 1D array is just a list.  A 2d array is like a table, so that if each index goes from 0-9, you have 100 elements in your array.

-----------------------------------
ZeroPaladn
Sat Oct 01, 2005 4:00 pm


-----------------------------------
you learn sumthing new everyday now dont we?
