256 Colors

 BBS: Inland Empire Archive
Date: 04-01-93 (23:42)             Number: 301
From: EARL MONTGOMERY              Refer#: NONE
  To: MIKHAIL FERDMAN               Recvd: NO  
Subj: 256 Colors                     Conf: (2) Quik_Bas
' Mikhail, I think this will help you.
' Study the source code.
' Special note for Victor Yiu: I wrote this program about 2
' years ago. I didn't feel up to changing the WAIT1: etc <smile>
     SCREEN 9: CLS : COLOR 14: RANDOMIZE TIMER: DEFINT R
     PRINT "In the VGA (320*200*256) mode the palette command can";
     PRINT "use values between 0 and 63. Did you realize that";
     PRINT "regardless of the color you select that the color";
     PRINT "changes from black to bright orange? Not much of a";
     PRINT " selection!"
     PRINT "Want to see what I mean?"
     PRINT
     PRINT "                      Press any key to continue."
wait1:
     i$ = INKEY$
     IF i$ = "" THEN
         GOTO wait1
     END IF
     SCREEN 13

     COLOR 8
     LINE (0, 0)-(319, 199), , B
     FOR y = 0 TO 169 STEP 10
     LINE (0, y)-(319, y)
     NEXT
     FOR X = 0 TO 319 STEP 20
     LINE (X, 0)-(X, 160)
     NEXT
     y = 4
loop1:
     FOR X = 12 TO 319 STEP 20
     PAINT (X, y), c, 8
     c = c + 1
     NEXT
     y = y + 10
     IF y > 156 THEN
         GOTO loop2
     ELSE
          GOTO loop1
     END IF
loop2:
     r = RND * 255: IF r = 8 THEN GOTO loop2
     IF r = 0 THEN GOTO loop2
     FOR X = 0 TO 63
     t = TIMER
     WHILE TIMER < t + .1
     WEND
     COLOR 14
     LOCATE 22, 2
     PRINT "Color "; r;
     LOCATE 22, 26
     PRINT "Palette "; X
     PALETTE r, X
     NEXT
     ct = ct + 1
     IF ct = 4 THEN
         ct = 0
         GOTO Text2
' End of part one of four parts.

--- Maximus 2.01wb
 * Origin: Verbose Ink * Dallas * 214-437-0914 * V32b/HST (1:124/5125)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET