The Software Arts
Warren Sack
MIT Press
- Every Icon: Thinking about numbers as black and white squares
- This is a reimplementation of John Simon's artwork Every Icon.
- Press the <space> key to start it counting.
- Press the <p> key to take a snap shot of the current state of the display.
- View the source of the file to see how the automaton and the display are implemented.
- Arithmetic: Thinking about rules as black and white squares
- This is an implementation of addition and subtraction as a mobile automaton. (See figures 4.2 through 4.6 in the book.)
- It will start running a few seconds after the page has loaded. The two numbers to be added or subtracted are at the top. The list of eight IF-THEN rules are shown at the bottom of the page.
- View the source of the file to see how the automaton, the rules, and the display are implemented.
- 1D Automata: 256 possible programming languages
- This is an implementation of a one-dimensional automaton (illustrated in figures 6.1 through 6.17 in the book).
- Rule set 110 will run immediately after the page has loaded. If you want to run a different rule set, edit the source code in the file "Automata/1D/index.html". The input to the automaton is the first line of black and white squares shown at the top of the page. Each successive state of the computation is shown in the subsequent rows of black and white squares, all the way down the page.
- View the source of the file to see how the automaton, the rules, and the display are implemented.
- Try some of the various initial states for rule set 110 listed in the file "Automata/1D/configurations.js".
- Look at the execution histories of all 256 automata each given a single black square as input. The histories can be found in figures 6.6 and 6.7 of the book.
- To render a rule set as a series of figures of black and white squares, use this script: "Automata/1D/displayRuleSet.html" It will display rule set 110. If you want to see a different rule set, edit the source code of the file.
- 2D Automata: trillions and trillions of possible programming languages
- This is an implementation of 2D automata. The "Game of Life" is one such automaton: "Automata/2D/index.html".
- Press the <space> key to start or stop the execution of the automaton.
- Press the <p> key to take a snap shot of the current state of the display.
- Click the mouse over a square to turn it white or black.
- View the source of the file to see how the automaton, the rules, and the display are implemented.
- The rules for the "Game of Life" are computed by this script: "Automata/2D/Life/life.js".
- Try some of the various initial states listed for the "Game of Life" in the file "Automata/2D/configurations.js".
- To render a rule set as a series of figures of black and white squares, use this script: "Automata/2D/displayRuleSet.html". It will display a graphic form of the rules for the "Game of Life." Edit the source code in the file if you want to display a different rule set.
- Circuit Simulator
- This is the implementation of the boolean logic circuit simulator (discussed in the book starting on page 133).
- When you click on the link above, you will only see a blank page. To see the simulator working you will need to open the JavaScript Console in the browser. The menu item to open the JavaScript Console is in different places in different browsers. For example, in the Google Chrome browser, you will find it under VIEW >> DEVELOPER >> JAVASCRIPT CONSOLE.
- In the JavaScript Console you should see something like this:
value for wire a @ time 0 is 1
value for wire a @ time 3 is 0
This is the output for the simulation of a simple clock, as discussed on page [] of the book.
- If you want to see the simulation of a different boolean circuit edit the source code in this file
- Programming in Logic and Chomskyan Grammars
- Each of the first three files listed below is discussed in the chapter on logic. Each of the second three files is discussed in the chapter on grammar. All six files are written in the Prolog programming language. To try them out you will need to cut and past the code from the source of the files into a Prolog interpreter, like the one that can be found here.
- First version of the predicate mortal/1 is here. This predicate is discussed on page 139 of the book.
- Second version of the predicate mortal/1 is here. This predicate is discussed on page 139 of the book.
- Third version of the predicate mortal/1 is here. This predicate is discussed on page 139 of the book.
- The first version of a Chomskyan grammar written as a DCG can be found here. This grammar is discussed on page 235 of the book.
- The second version of a Chomskyan grammar written as a DCG can be found here. This grammar is discussed on page 235 of the book.
- This is the definition of a Chomskyan active-to-passive transformation rule. This rule is discussed on page 236 of the book.
- Code