(archive 'newLISPer)

October 18, 2006

Noodling around

Filed under: newLISP — newlisper @ 17:35
Tags:

Just noodling around today. Then I shall be away for a few weeks. But all I have to say is: noodles.

Would you like some source with that, sir?


#!/usr/bin/newlisp

(set 'buffer "")
(define (ps str)
 (write-line str buffer))
(define (render)
 (write-file
  (string (env "HOME") "/Desktop/noname.ps")
   (append [text]%!PS-Adobe-3.1
%%Creator: newLISP
[/text] buffer "showpage" "\r\n"))
 (exec (string "open "(env "HOME") "/Desktop/noname.ps")))

(seed (date-value)) ; randomnessity

(ps (format {gsave 0.7 setgray /Eurostile findfont
   600 scalefont setfont
   30 20 moveto (Q) show
   grestore}))

(ps (format {1 setlinecap
   10 setlinewidth
   %f %f %f setrgbcolor} 0.6 0.6 0.8))

(for (c 1 70)
 (map set '(x1 y1 x2 y2) (random (random 50 30) 300 4)) ; start and end
 (map set '(b1x b1y b2x b2y)
  (random (random 40 120) (random 60 350) 4)) ; bulgy
 (ps { newpath })
 (ps (format {1 setlinecap
  11 setlinewidth
  %f %f %f setrgbcolor} 0.7 0.7 (random 0.6 0.1))) ; back
 (ps (format {%f %f moveto} x1 y1))
 (ps (format {%f %f %f %f %f %f curveto stroke} b1x b1y b2x b2y x2 y2))
 (ps (format {1 setlinecap 9 setlinewidth %f %f %f  setrgbcolor}
  0.8 0.8 0.5)) ; middle
 (ps (format {%f %f moveto} x1 y1))
 (ps (format {%f %f %f %f %f %f curveto stroke}
  b1x b1y b2x b2y x2 y2))
 (ps (format {1 setlinecap
  8 setlinewidth %f %f %f setrgbcolor} 0.95 0.95
   (random 0.8 0.1))) ; front
 (ps (format {%f %f moveto} x1 y1))
 (ps (format {%f %f %f %f %f %f curveto stroke}
  b1x b1y b2x b2y x2 y2)))
(render)
(exit)
Advertisements

3 Comments »

  1. >Delicous, can’t wait to make my own dish.ps: where is the tomato sauce?

    Comment by don Lucio — October 19, 2006 @ 15:06 | Reply

  2. >Ah.. don Lucio, this dish seems to be based on buttery alfredo sauce!Yum!

    Comment by Bob — October 19, 2006 @ 20:53 | Reply

  3. >Daaaaamn, nicca.

    Comment by Anonymous — October 22, 2006 @ 08:49 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: