home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EXAMP1.ZIP / UMEX233.BAS < prev    next >
BASIC Source File  |  1990-03-29  |  1KB  |  43 lines

  1. 'User's Manual Example, Page 234.
  2.  
  3. DEFINT a-z
  4. SCREEN 1
  5.  
  6. CALL backgrd
  7. CALL drawcircles            'normal--no viewpoint
  8. X$ = INPUT$(1)
  9.  
  10. CALL backgrd                'viewport set to middle, orginal at upper left
  11. CALL drawcircles
  12. VIEW SCREEN (75,60)-(220,140)
  13. X$ = INPUT$(1)
  14.  
  15. CALL backgrd                'same viewport, but original reletive to viewport
  16. VIEW SCREEN (75,60)-(220,140)
  17. CALL drawcircles
  18. X$ = INPUT$(1)
  19. CLS                         'note that only viewport is cleared
  20. X$ = INPUT$(1)
  21.  
  22. END
  23.  
  24. SUB backgrd                 'create a noisy background
  25.   VIEW                      'reset to full screen
  26.   CLS
  27.   FOR i = 1 TO 20
  28.     c = 1 + i MOD 3
  29.     LINE(INT(RND*50)+10,INT(RND*90)+10)-(INT(RND*50)+250,INT(RND*100)+60),c
  30.   NEXT i
  31. END SUB
  32.  
  33. SUB drawcircles             'draw circles and fill them
  34.   FOR i = 1 TO 30
  35.     x = INT(RND*80) + 80
  36.     y = INT(RND*80) + 40
  37.     c = 1 + i MOD 3         'cycle through colors
  38.     CIRCLE (x,y), INT(RND*15)+5,c
  39.     PAINT (x,y),c
  40.   NEXT i
  41. END SUB
  42.  
  43.