madplot.frink

Download or view madplot.frink in plain text format


// A program from Mad Magazine, 1985.
// https://atariprojects.org/2018/09/11/mad-magazine-basic-program-10-15-min/s
// https://forums.atariage.com/topic/20395-mad-magazines-computer-program/

use lineWrapper.frink

r = read["https://forums.atariage.com/applications/core/interface/file/attachment.php?id=300452"]

full = new array

// Read the DATA blocks from the binary BASIC file and turn them into a clean
// array
for [data] = r =~ %r/([\-\d, ]{8,})/g
   full.pushAll[eval[split[",", data]]]

// Pretty-print all the coordinates
println[wrap[join[", ", full],78]]

g = new graphics
g.stroke[1.2]
w = g.show[]

for i=0 to length[full]-1 step 4
{
   [x1, y1, x2, y2] = sliceLength[full, i, 4]
   if x1 != 999
      g.line[x1,-y1,x2,-y2]

   sleep[0.1 s]
   w.replaceGraphics[g]
}

// Write the image to a file (letting it scale height appropriately.)
g.write["madplot.png", 1000, undef]


Download or view madplot.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20143 days, 10 hours, 3 minutes ago.