home *** CD-ROM | disk | FTP | other *** search
- \\ LINES.SEQ A simple graphic demo, draws lines on CGA or HERCULES
-
- Here is an example file that will work on either CGA/EGA/VGA or HERCULES.
-
- Compile with the following command line:
-
- TCOM LINES /OPT /NOINIT <Enter>
-
- {
-
- needs therc.seq
- needs tgraph.seq
-
- 0 value dinc
- 0 value -hdots
- 0 value -vdots
-
- : ?kexit ( -- )
- key? if text-mode bye then ;
-
- : dolines ( -- )
- vdots 0 do 0 0 -hdots i line dinc +loop
- ?kexit hdots 0 do 0 0 -hdots i - -vdots line dinc +loop
- ?kexit vdots 0 do -hdots 0 0 i line dinc +loop
- ?kexit hdots 0 do -hdots 0 i -vdots line dinc +loop
- ?kexit vdots 0 do -hdots -vdots 0 -vdots i - line dinc +loop
- ?kexit hdots 0 do -hdots -vdots i 0 line dinc +loop
- ?kexit vdots 0 do 0 -vdots -hdots -vdots i - line dinc +loop
- ?kexit hdots 0 do 0 -vdots -hdots i - 0 line dinc +loop
- ?kexit COLOR @ 127 AND 1+ 15 AND 128 OR COLOR !
- ;
-
- : draw_lines ( n1 -- )
- vdots 1- =: -vdots
- hdots 1- =: -hdots
- dup 0= if drop 16 then =: dinc
- begin dolines
- key? until ;
-
- : lines ( -- )
- graph-init
- if 320x200x4
- 132 color !
- else hercules
- 132 color !
- then
- 10 draw_lines
- %key drop
- text-mode ;
- }
-