Slashdot Mirror


Game of Life in Postscript

smashr writes "It never really occured to me that postscript could be used for something other than printing, until I came across this page. Evidently someone has written the classic 'Game of life' entirely in postscript. You can even send it to the printer and have it output every single iteration.. now that would be a fun prank."

15 of 265 comments (clear)

  1. Duh by Anonymous Coward · · Score: 1, Informative

    Postscript is a programming language - so you can 'program' in it... whatever you want. Even something like the game of life. Crazy huh? That's technology for you.

  2. Much cooler PS hack by ocelotbob · · Score: 5, Informative

    PS-HTTPD - a webserver in PostScript.

    --

    Marxism is the opiate of dumbasses

  3. Can't print every iteration by Anonymous Coward · · Score: 2, Informative

    That postscript document has just one page that is never finished -- what you see on the ghostview screen is the first page being drawn, forever. So if you go and send this to a printer, the job never finishes and the printer "hangs" until you cancel the print job on the printer.

  4. Re:OS by Art+Tatum · · Score: 3, Informative

    That's meant as a joke but NeXTSTEP used PostScript to write their window server. Not quite an OS, but still low-level system software. They added some stuff for window management and event handling and so on. One of the nice features was that all NeXT software had perfect WYSIWYG.

  5. PostScript Fractals by e271828 · · Score: 4, Informative

    If you like this sort of thing, check out the PostScript Fractals page. You can print out very detailed images from tiny PostScript files.

  6. Re:Webserver by Xonea · · Score: 5, Informative

    Yes, it can be found here

    It must be used with inetd though, because postscript doesn't support sockets...

  7. PS-HTTPD by SweetAndSourJesus · · Score: 4, Informative

    I've never used it, but you're talking about PS-HTTPD.

    Pretty cool, eh?

    --

    --
    the strongest word is still the word "free"
  8. Re:So why is this a good thing? by WolfWithoutAClause · · Score: 4, Informative
    It's not exactly a scripting language. It's actually a very close cousin of 'forth'. It runs quite quickly, and doesn't particularly excel at text processing, which most scripting languages do.

    As other people have pointed out, it's useful to have a fairly powerful language in a printer since it allows the printer to adapt the printed stuff to the paper size and so forth (no pun intended).

    Another language that is very closely related is pdf; as I understand it, it's pretty much postscript with a few cludges on the side to make it run faster.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  9. don't exaggerate by Baki · · Score: 3, Informative

    It is a programming language (stack based, like forth), which is amazing for its primary purpose: printing.

    But to call the language itself "extremely powerful" is an exaggeration. As a programming language it is quite primitive and incomprehensible, compared to more powerful languages such as C++, java, ML, yes even forth.

  10. Re:So why is this a good thing? by Matthias+Wiesmann · · Score: 4, Informative
    Shouldn't the actual processing of data be solely handled by the computer? I mean, this article clearly says that it can tie up the printer for a long time if you actually try this.
    The main advantage of postscript is that it is versatile. Of course coding games or fractals is extreme, but there are many other uses:
    • You can send the graphical data in a very compact form, vectors and compressed bitmaps (the Apple drivers could compress bitmaps in JPEG and would transmit a JPEG decompresser postscript program).
    • You can transmit your own data format. Instead of transforming your data into "real" postscript, you send a set of postscript procedures that reproduce the behaviour of your graphic language. This was actually one of the primary requirements of postscript, something that could handle quickdraw (Apple's graphic language pre OS-X) reasonably well. DVI2PS does a similar trick.
    • You can factorise out common data. For instance you could transmit a form once, and then only send the data to fill out multiple versions of the form.
    • Pre-loading - you can upload common fonts to the printer, this saves you the time of including them in all jobs. Some high-end postscript printer even have hard drives to store those fonts.
    • Precision handling - instead of calculating word justification on the computer, you send a procedure to calculate word positioning to the printer, this ensures that justification is done using the printer's font metrics and knowing the printer's resolution.
    • Special handling and configuration. Special printer configuraton can be handled using postscript. For instance on certain printers, the user has to enter a PIN to trigger output. This is very usefull for sending sensitive documents to shared printers.
    • On the fly reconfiguration - for instance you can reprogram the printer to do 2-up or 4-up printing quite easily.
    This design made a lot of sense when postscript printers started, bandwidth to the printer was bad (serial, parrallel or localtalk) and processing power on the machines was low - in fact it was common to have a laserwriter II (68020) attached to a classic 9' macintosh (68000).

    Even nowadays this design makes sense for network attached shared printers - this ensures that page composition is not tied to the client machines. Also you have to realise the bitmap of printing page is quite large: an uncompressed A4 page 300 DPI black/white bitmap is around 15MB. Today's laser printer support 2400 DPI, that means nearly a Gigabyte per page.

  11. Easy to view postscript files by mnemonic_ · · Score: 4, Informative

    Install Ghostscript first, then use GSView to open the .ps files.

  12. Re:Other way around by Anonymous Coward · · Score: 1, Informative

    Here is a Turing Machine implemented in the game of life.

  13. Tetris ending by yerricde · · Score: 2, Informative

    (Context: debating an assertion that Conway's Game of Life has no end condition; therefore, it's not a game. wo1verin3 brings an analogy to Tetris brand games.)

    do you know anyone who has "finished" Tetris?

    Some falling tetramino games, including Tetris brand games, display fireworks and credits after the player has completed specific objectives. For example, in The New Tetris for N64, it's 500,000 lines summed over all games played.

    --
    Will I retire or break 10K?
  14. Thinking in PostScript by c · · Score: 4, Informative

    The best source about PostScript as a programming language is book "Thinking in PostScript" (http://www.rightbrain.com/pages/books.html).

    I read it originally to learn PostScript from a printing perspective, which was somewhat futile. Very little of the book actually talks about printing or page layout at all.

    Anyhow, a quick read of the table of contents would be enough to understand that the Game of Life in PostScript is neither difficult nor terribly interesting.

    c.

    --
    Log in or piss off.
  15. Re:stupid postscript tricks by BigDish · · Score: 2, Informative

    This is made for Xerox printers, but I've used it with other brands:
    ftp://ftp.tekcolor.com/ftp_dir/ALL/W9NT2000/NA/Fil e Downloader Utility.exe