I recently needed to generate some Gray Code, and could find no mention of Frank Gray here... Sychronistically, I was listening to Deltron 3030 this morning, and would like to a mantra and a poem from "Upgrade (A Brymar College Course)" which appears on the DELTRON3030 album, and sample Gray code.
I'll school you on the art and how its texture mapped
Get your act together, my style is mega
Educate the heads of eight lonely beggars
Only shred of evidence is the virtual file
Stored within the cerebellum hit you Berkowitze Style
MANTRA (repeat): "Upgrade your gray matter, cause one day it may matter."
Code below from http://www.onpedia.com/encyclopedia/gray-code, provided under the GNU Free Documentation License.
my $depth = 16; # generate 16 Gray codes, 4 bits wide each
my @gray_codes = ( '0', '1' );
while(scalar(@gray_codes)<$depth)
{
my @forward_half=map{'0'.$_} @gray_codes;
my @reverse_half=map{'1'.$_} reverse @gray_codes);
@gray_codes=(@forward_half,@reverse_half);
}
spectre#9 -- By the time you read this, I might Be Adle
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.