; fortune: one saying from the old days of computing, picked by the ; clock (the same one for the whole second). (def usage "usage: fortune\nOne saying from the old days of computing, a different one each second.") (def SAYINGS (list "Simplicity is prerequisite for reliability.\n\t\t-- Edsger W. Dijkstra" "Premature optimization is the root of all evil.\n\t\t-- Donald Knuth" "When in doubt, use brute force.\n\t\t-- Ken Thompson" "One of my most productive days was throwing away 1000 lines of code.\n\t\t-- Ken Thompson" "Controlling complexity is the essence of computer programming.\n\t\t-- Brian Kernighan" "Debugging is twice as hard as writing the code in the first place.\n\t\t-- Brian Kernighan" "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.\n\t\t-- Dennis Ritchie" "Data dominates.\n\t\t-- Rob Pike" "Talk is cheap. Show me the code.\n\t\t-- Linus Torvalds" "The best way to predict the future is to invent it.\n\t\t-- Alan Kay" "Any sufficiently advanced technology is indistinguishable from magic.\n\t\t-- Arthur C. Clarke" "Programs must be written for people to read, and only incidentally for machines to execute.\n\t\t-- Abelson & Sussman" "A language that doesn't affect the way you think about programming is not worth knowing.\n\t\t-- Alan Perlis" "Adding manpower to a late software project makes it later.\n\t\t-- Fred Brooks" "Real programmers can write assembly code in any language.\n\t\t-- Larry Wall" "It's not a bug, it's an undocumented feature.\n\t\t-- anonymous" "There are two ways of constructing a software design: make it so simple that there are obviously no deficiencies, or so complicated that there are no obvious deficiencies.\n\t\t-- C. A. R. Hoare" "Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away.\n\t\t-- Antoine de Saint-Exupery" "Weeks of coding can save you hours of planning.\n\t\t-- anonymous" "In theory, there is no difference between theory and practice. In practice, there is.\n\t\t-- anonymous" "NO CARRIER\n\t\t-- your modem, at the worst moment" "Press any key to continue... no, not that one.\n\t\t-- anonymous")) (letv (opts words bad) (getopt ARGS "h") (cond ((not (= bad "")) (do (err-write "fortune: bad option -" bad "\n" usage "\n") (exit-status 2))) ((not (is-empty opts)) (out-write usage "\n")) ((not (is-empty words)) (do (err-write usage "\n") (exit-status 2))) (else (let ((t (now))) (out-write (nth SAYINGS (% (if (is-nil t) 0 t) (length SAYINGS))) "\n")))))