Oct 31, 2009
Random GATC generator and a book cover
For a recent book cover design, I needed to generate a bunch of code to look like the DNA sequence. Here’s the flash actionscript I used to generate 10,000 random characters of DNA code. The code is pretty subtle on the book cover, it’s in the DNA smear. Buy the book to see it better [smile] Or, maybe just click and scroll a little farther
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
for (var i = 0; i < 10000; i++) {
var n:Number = randRange(1, 4)
switch (n) {
case 1 :
trace("G");
break;
case 2 :
trace("A");
break;
case 3 :
trace("T");
break;
case 4 :
trace("C");
break;
default :
trace("some other message");
}
}
Responsibilities:
- Layout
- Typography
- Photography found on the book cover
- Flash script to generate GATC sequence.
Here’s the book:

