home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / baslib2.zip / BOXES.BAS < prev    next >
BASIC Source File  |  1987-03-26  |  1KB  |  64 lines

  1. 'Paint & tile options by John Craig, Jeff Bretz
  2. 'Converted to Quickbasic 2.01 & other rwts by Dennis Dreyer, 3/87
  3. 'BOXES.BAS
  4.  
  5. cls
  6. locate 1,10,0:Print "Boxes"
  7. locate 3,10:Print "A demonstration of Tiling & solid fill."
  8. Locate 4,10:Print "1) = Solid fill.....  2) = Tiling....."
  9. Locate 8,10:print "Select number <1> or <2> ?--->"
  10. locate 12,10:print "During the DEMO push any key to quit...."
  11.  
  12. ANS:
  13. k$=inkey$
  14. if k$="1" then goto INITIALIZE1
  15. If k$="2" then goto INITIALIZE2
  16. GOTO ANS
  17.  
  18. INITIALIZE1:
  19. clear:screen 1:color 0,0:cls
  20. size=12
  21.  
  22. Randomize CVD(TIME$)
  23.  
  24. RANDOM1:
  25. X=int(rnd*size)*319/size
  26. y=int(rnd*size)*199/size
  27. colr=int(1+3*rnd)
  28.  
  29. pnt=colr+1
  30. if pnt=4 then pnt=1
  31.  
  32. line (x,y)-(x+319/size,y+199/size),colr,B
  33. paint (x+1,y+1),pnt,colr
  34.  
  35. If inkey$="" then goto RANDOM1
  36. END
  37.  
  38. INITIALIZE2:
  39. clear:screen 1:color 1,0:cls
  40. size=5
  41.  
  42. randomize timer
  43.  
  44. RANDOM2:
  45. X=int(rnd*size)*319/size
  46. Y=int(rnd*size)*199/size
  47.  
  48. colr=int(1+3*rnd)
  49.  
  50. RANDOMPATTERN:
  51. pnt$=""
  52. for I= 1 to int(8*rnd)+1
  53. pnt$=pnt$+chr$(int(rnd*256))
  54. next I
  55. if pnt$=string$(len(pnt$),0) then goto randompattern
  56.  
  57. line (x,y)-(x+319/size,y+199/size),0,BF
  58. line (x,y)-(x+319/size,y+199/size),colr,B
  59. paint (x+1,y+1),pnt$,colr
  60.  
  61. if inkey$="" then goto RANDOM2
  62. END
  63.  
  64.