'* 649.bas -prints blocks of 9 lines with numbers 1-49 picked at random '* '* Justin Keswick '* Qbasic Developer '* Business Consultant '* 89 Beachview Crescent '* Toronto, Ontario '* cell 416-707-8904 '* home 416-691-9956 '* email jkeswick@interlog.com '* website www.interlog.com/~jkeswick '* '* If you require services, please call today. '* '* If you win 6/49, please forward '* a small contribution to me =) DEFINT A-Z DIM SHARED BallDrum(1 TO 49) DIM SHARED Item(1 TO 9, 1 TO 6) CLS COLOR 11 RANDOMIZE TIMER FOR b = 1 TO 1 FOR i = 1 TO 49: BallDrum(i) = i: NEXT i FOR i = 1 TO 8 NumItems = 0 FOR j = 1 TO 6 DO: Ball = BallDrum(1 + INT(49 * RND)): LOOP UNTIL Ball <> 0 BallDrum(Ball) = 0: Number = Ball: Position = 1 DO WHILE (Position <= NumItems) AND (Number > Lines(i, Position)) Position = Position + 1 LOOP FOR k = Position TO (NumItems + 1) Temp = Lines(i, k) Lines(i, k) = Number Number = Temp NEXT k NumItems = NumItems + 1 NEXT j NEXT i DO: Ball = BallDrum(1 + INT(49 * RND)): LOOP UNTIL Ball <> 0 FOR i = 1 TO 49: BallDrum(i) = i: NEXT i BallDrum(Ball) = 0 Lines(9, 1) = Ball NumItems = 1 FOR i = 2 TO 6 DO: Ball = BallDrum(1 + INT(49 * RND)): LOOP UNTIL Ball <> 0 BallDrum(Ball) = 0: Number = Ball: Position = 1 DO WHILE (Position <= NumItems) AND (Number > Lines(9, Position)) Position = Position + 1 LOOP FOR k = Position TO (NumItems + 1) Temp = Lines(9, k) Lines(9, k) = Number Number = Temp NEXT k NumItems = NumItems + 1 NEXT i FOR i = 1 TO 9 FOR j = 1 TO 5 PRINT USING "##"; Lines(i, j); PRINT " - "; NEXT j PRINT USING "##"; Lines(i, 6) NEXT i PRINT NEXT b END