This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; | |
| ; Hercbyt -- write out a byte's worth of dots in the correct position | |
| ; for the Hercules graphics board. This is a variation on hercdot, | |
| ; which writes out only a dot at a time. | |
| ; | |
| ; Invocation: hercbyt(the_byte, y, x) | |
| ; the_byte = {0..255} | |
| ; y = {0..347} | |
| ; x = {0..712}, a multiple of 8, to stay on a byte boundry. | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; | |
| ; Hercdot -- write out a dot in the correct position for the Hercules | |
| ; graphics board. There are only two colors available: black or white. | |
| ; | |
| ; Invocation: hercdot(color, y, x) | |
| ; color = {0, 1} | |
| ; y = {0..347} | |
| ; x = {0..719} | |
| ; | |
| ; In order to use the hercules graphics board, you have to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; HERCMODE -- Mode switch for Hercules Graphics board. | |
| ; Copied from the Hercules owner's manual, edition 2.1, pg 20. | |
| ; | |
| ; port address | |
| index equ 03b4h | |
| cntrl equ 03b8h | |
| ; | |
| ; control codes | |
| scrn_on equ 8 | |
| grph equ 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Offsets for creating the highest prime that fits in n bits; the | |
| // highest prime less than 2**n. | |
| // | |
| // n can range from 1 .. 128. If arrays are zero-based in the language | |
| // you want to use, subtract 1 from n before indexing. | |
| // | |
| // I.e., | |
| // hp24 = (1 << 24) - hiprimeoffset[24]; | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %! | |
| % M. C. Escher style impossible triangle | |
| % written by Guy Shaw | |
| % Things that are easy to play with: | |
| % Position on paper, overall size, and linewidth | |
| /inch { 72 mul } bind def | |
| 2 inch dup translate | |
| 3 inch dup scale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %!PS-Adobe-1.0 | |
| % hexpaper.ps - Version 1.0 : Hexagon mapping paper in PostScript | |
| % | |
| % Copyright 1994 by Daniel C. Nygren | |
| % Current e-mail: nygren@tecnet1.jcte.jcs.mil | |
| % | |
| % Permission to use and modify this software for any purpose other than | |
| % commercial use or its incorporation into a commercial product is | |
| % hereby granted without fee. Permission to copy and distribute this software | |
| % only for non-commercial use is also granted without fee, provided that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # @bits = bitpattern($pattern, $length, $offset); | |
| # | |
| # Create a list of bits in a cyclic pattern. | |
| # | |
| # $pattern is an array reference containing the on (ones) and | |
| # off (zeros) sequence of the pattern. | |
| # | |
| # $length is the length of the bitpattern to return. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # For calculating the diagonal distance, it is important to | |
| # know which columns are shifted up (see the diagram below in | |
| # the hexagon_distance() function). | |
| # | |
| # For the purposes of this code snippet we have a simple | |
| # function that defines the odd-numbered columns as 'up'. | |
| # | |
| sub upcolumn | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C | |
| C Subroutine spiro simulates the designs of the toy spirograph. | |
| C Where: | |
| C R1 -- The radius of the stationary wheel. | |
| C R2 -- The radius of the moving 'pen' wheel. | |
| C P -- The pen's distance from the center of the 'pen' wheel. | |
| C ANGLE -- The angle by which the drawn figure is rotated, in degrees. | |
| C STEP -- The increment of rotation of the pen wheel around the | |
| C stationary wheel, in degrees. | |
| C X, Y -- Arrays to hold the X and Y coordinates of the design. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =head3 list_from_file() | |
| @list = &list_from_file($filename, $comment_patrn, $keep_empty); | |
| $filename - The file to open. | |
| $comment_patrn - (Optional) A pattern that represents end-of-line style comments. | |
| $keep_empty - (Optional) Add or do not add empty (no non-blank characters) lines. | |
| Take a file containing a list of items. For each line, strip off any | |
| characters following and including the comment character(s). Strip off |
NewerOlder