# A message from the Creator

July 26 2006 at 5:41 AM
Forum Owner

Response to But it just has delay loops

RANDOMIZE TIMER
DEFINT A-Z
TYPE p
x1 AS INTEGER
y1 AS INTEGER
x2 AS INTEGER
y2 AS INTEGER
x3 AS INTEGER
y3 AS INTEGER
c0 AS INTEGER
a AS SINGLE
END TYPE
DIM p(341) AS p
FOR i = 1 TO 341
p(i).a = i * ((8 * ATN(1)) / 341)
NEXT i
FOR i = 1 TO 341
r = 1 + INT(RND * 341)
SWAP p(i), p(r)
NEXT i
FOR i = 1 TO 341
p(i).x1 = x + 249
p(i).y1 = y + 208
r! = (50 * RND) + (300 * RND)
p(i).x2 = 320 + (r! * SIN(p(i).a))
p(i).y2 = 210 + (r! * COS(p(i).a))
SELECT CASE x
CASE IS < 13: p(i).c0 = 4
CASE IS < 26: p(i).c0 = 5
CASE IS < 39: p(i).c0 = 6
CASE IS < 52: p(i).c0 = 4
CASE IS < 65: p(i).c0 = 5
CASE IS < 78: p(i).c0 = 6
CASE IS < 91: p(i).c0 = 4
CASE IS < 104: p(i).c0 = 5
CASE ELSE: STOP
END SELECT
NEXT i
FOR j = 1 TO 3
FOR i = 1 TO 341
r = 1 + INT(RND * 341)
SWAP p(i), p(r)
NEXT i
NEXT j
SCREEN 12
CIRCLE (320, 240), 10, 15
PAINT (320, 240), 15, 15
LINE INPUT "Press Enter"; e\$
LOCATE 1, 1: PRINT SPACE\$(50);
' Big Bang!
FOR i = 10 TO 1 STEP -1
FOR j = 1 TO 8: WAIT &H3DA, 8: WAIT &H3DA, 8, 8: NEXT j
CIRCLE (321, 240), i, 0
CIRCLE (320, 240), i, 0
NEXT i
FOR j = 1 TO 3
FOR i = 1 TO 341
LINE (320, 240)-(p(i).x2, p(i).y2), 1 + INT(RND * 8)
NEXT i
NEXT j
FOR i = 1 TO 4: WAIT &H3DA, 8: WAIT &H3DA, 8, 8: NEXT i
CLS
' Place Galaxies in Universe
FOR i = 1 TO 341
PSET (p(i).x2, p(i).y2), 15
NEXT i
' Converge Galaxies
q = 300
DO
FOR i = 1 TO SQR(q) / 3
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
NEXT i
IF q > 0 THEN q = q - 1
done = -1
FOR i = 1 TO 341
dx = ABS(p(i).x1 - p(i).x2): dy = ABS(p(i).y1 - p(i).y2)
IF dx > 0 OR dy > 0 THEN
done = 0
IF dx > dy THEN
GOSUB MoveX
p(i).y3 = p(i).y2
ELSEIF dy > dx THEN
p(i).x3 = p(i).x2
GOSUB MoveY
ELSE
GOSUB MoveX
GOSUB MoveY
END IF
ELSE
FOR j = 1 TO 200: NEXT j
END IF
NEXT i
IF done THEN EXIT DO
FOR i = 1 TO 341
IF p(i).x2 <> p(i).x3 OR p(i).y2 <> p(i).y3 THEN
PSET (p(i).x2, p(i).y2), 0
END IF
NEXT i
FOR i = 1 TO 341
p(i).x2 = p(i).x3: p(i).y2 = p(i).y3
PSET (p(i).x2, p(i).y2), 15
NEXT i
LOOP WHILE INKEY\$ = ""
FOR j = 1 TO 3
FOR i = 1 TO 341
r = 1 + INT(RND * 341)
SWAP p(i), p(r)
NEXT i
NEXT j
FOR i = 1 TO 5: WAIT &H3DA, 8: WAIT &H3DA, 8, 8: NEXT i
FOR i = 1 TO 341
IF RND > .8 THEN WAIT &H3DA, 8: WAIT &H3DA, 8, 8
PSET (p(i).x1, p(i).y1), p(i).c0
NEXT i
CIRCLE (300, 240), 10, 1
PAINT (300, 240), 1, 1
LINE INPUT "Press Enter"; e\$
CLS
SYSTEM

MoveX:
IF RND < .6 THEN p(i).x3 = p(i).x2: RETURN
IF p(i).x1 > p(i).x2 THEN
p(i).x3 = p(i).x2 + 1
ELSEIF p(i).x1 < p(i).x2 THEN
p(i).x3 = p(i).x2 - 1
END IF
RETURN

MoveY:
IF RND < .6 THEN p(i).y3 = p(i).y2: RETURN
IF p(i).y1 > p(i).y2 THEN
p(i).y3 = p(i).y2 + 1
ELSEIF p(i).y1 < p(i).y2 THEN
p(i).y3 = p(i).y2 - 1
END IF
RETURN

DATA 0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,1,2,1,3,1,4,1,5
DATA 1,6,1,7,1,8,1,9,1,10,1,11,2,6,3,6,4,6,5,2,5,3,5,4,5,5,5,6
DATA 5,7,5,8,5,9,5,10,5,11,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10
DATA 6,11,8,6,8,7,8,8,8,9,8,10,9,5,9,6,9,7,9,8,9,9,9,10,9,11,10
DATA 5,10,7,10,11,11,5,11,7,11,11,12,5,12,7,12,11,13,5,13,6,13
DATA 7,13,10,13,11,14,6,14,7,14,10,18,2,18,11,19,2,19,3,19,4,19
DATA 5,19,6,19,7,19,8,19,9,19,10,19,11,20,2,20,3,20,4,20,5,20,6
DATA 20,7,20,8,20,9,20,10,20,11,21,11,26,2,26,11,27,2,27,3,27,4
DATA 27,5,27,6,27,7,27,8,27,9,27,10,27,11,28,2,28,3,28,4,28,5,28
DATA 6,28,7,28,8,28,9,28,10,28,11,29,11,32,6,32,7,32,8,32,9,32
DATA 10,33,5,33,6,33,7,33,8,33,9,33,10,33,11,34,5,34,11,35,5,35
DATA 11,36,5,36,11,37,5,37,6,37,7,37,8,37,9,37,10,37,11,38,6,38
DATA 7,38,8,38,9,38,10,42,12,43,9,43,10,43,11,43,12,44,9,44,10,44
DATA 11,56,2,56,3,56,4,56,5,56,6,56,7,56,8,56,9,56,10,57,2,57,3
DATA 57,4,57,5,57,6,57,7,57,8,57,9,57,10,57,11,58,9,58,10,58,11
DATA 59,6,59,7,59,8,59,9,60,9,60,10,60,11,61,2,61,3,61,4,61,5,61
DATA 6,61,7,61,8,61,9,61,10,61,11,62,2,62,3,62,4,62,5,62,6,62,7
DATA 62,8,62,9,62,10,64,6,64,7,64,8,64,9,64,10,65,5,65,6,65,7,65
DATA 8,65,9,65,10,65,11,66,5,66,11,67,5,67,11,68,5,68,11,69,5,69
DATA 6,69,7,69,8,69,9,69,10,69,11,70,6,70,7,70,8,70,9,70,10,72,5
DATA 72,11,73,5,73,6,73,7,73,8,73,9,73,10,73,11,74,6,74,7,74,8,74
DATA 9,74,10,74,11,75,5,75,6,75,11,76,5,77,5,77,6,77,7,78,6,78,7
DATA 82,2,82,11,83,2,83,3,83,4,83,5,83,6,83,7,83,8,83,9,83,10,83
DATA 11,84,2,84,3,84,4,84,5,84,6,84,7,84,8,84,9,84,10,84,11,85,11
DATA 88,7,88,8,88,9,88,10,89,6,89,7,89,8,89,9,89,10,89,11,90,5,90
DATA 6,90,11,91,2,91,5,91,11,92,2,92,3,92,4,92,5,92,6,92,7,92,8,92
DATA 9,92,10,93,2,93,3,93,4,93,5,93,6,93,7,93,8,93,9,93,10,93,11
DATA 94,11,98,3,98,4,98,5,99,2,99,3,99,4,99,5,99,6,99,7,99,8,99,10
DATA 99,11,100,2,100,3,100,4,100,5,100,6,100,7,100,8,100,10,100,11
DATA 101,3,101,4,101,5

 This message has been edited by iorr5t on Jun 3, 2007 8:28 PMThis message has been edited by iorr5t on Jul 26, 2006 4:23 PM

 Respond to this message
Responses