'=========================================================================== ' Subject: 90 DEGREE KALEIDOSCOPE Date: 06-19-98 (18:22) ' Author: Leandro Pardini Code: QB, QBasic, PDS ' Origin: lpardini@cefex.com Packet: GRAPHICS.ABC '=========================================================================== '========================================================================== ' 90 degree caleidoscope v1.0 lpardini@cefex.com '========================================================================== ' This a simple caleidoscope I created today (06-19-98) at work. It's very ' simple, and I think that put any comment here will be useless. :-) ' Enjoy! '========================================================================== ' | I like mail, so contact me for ' __________ ____---____ | any doubt or suggestion you ' \_________D /-/---_----' LL&P | have for this/another program, ' _H__/_/ Leandro Pardini | for get my last routines, to ' '-_____|( lpardini@cefex.com | chat about computers and/or ' | programming or to say "Hello". '========================================================================== '$STATIC DEFINT A-Z 'Initialize random number generator. RANDOMIZE TIMER 'Set graphics mode 640x480. SCREEN 12 'Set random values to line's coordinates. x1 = CINT(RND * 319) y1 = CINT(RND * 239) x2 = CINT(RND * 319) y2 = CINT(RND * 239) 'Set random values to change the line's coordinates. x1i = CINT(RND * 4) y1i = CINT(RND * 4) x2i = CINT(RND * 4) y2i = CINT(RND * 4) 'Set the starting line's color c = CINT(RND * 15) 'Loop until a key is pressed. WHILE INKEY$ = "" 'This will change the line's color every 100 lines. IF cc = 100 THEN c = CINT(RND * 15): cc = 0 cc = cc + 1 'This will clear the screen every 10000 lines. 'If you don't want to clear the screen, just comment these lines. IF lc = 10000 THEN CLS lc = lc + 1 'Change line's coordinates. x1 = x1 + x1i y1 = y1 + y1i x2 = x2 + x2i y2 = y2 + y2i 'Check that coordinates don't go out of bounds. IF x1 >= 319 THEN x1i = CINT(RND * -5): x1 = 319 IF x1 <= 0 THEN x1i = CINT(RND * 5): x1 = 0 IF x2 >= 319 THEN x2i = CINT(RND * -5): x2 = 319 IF x2 <= 0 THEN x2i = CINT(RND * 5): x2 = 0 IF y1 >= 239 THEN y1i = CINT(RND * -5): y1 = 239 IF y1 <= 0 THEN y1i = CINT(RND * 5): y1 = 0 IF y2 >= 239 THEN y2i = CINT(RND * -5): y2 = 239 IF y2 <= 0 THEN y2i = CINT(RND * 5): y2 = 0 'Draw the lines! LINE (x1, y1)-(x2, y2), c LINE (639 - x1, y1)-(639 - x2, y2), c LINE (x1, 479 - y1)-(x2, 479 - y2), c LINE (639 - x1, 479 - y1)-(639 - x2, 479 - y2), c 'Set here the proper delay for your system. FOR Delay% = 0 TO 4095: NEXT Delay% WEND 'Restore screen mode and exit. SCREEN 0 SYSTEM