The Amazing Interactive Turing MachineAn interactive fiction by J.D. Clemens (2006) - the Inform 7 source text | ||||||
| Home page Contents Previous Next Complete text | Section 7 - The Tape
The tape is a backdrop. It is everywhere. The description is "The tape currently shows: [tape contents]." Instead of examining the tape when the player is in the bowels, say "You can only see one cell at a time from here." Before examining the tape for the first time, say "The tape is old and yellowed, probably military surplus, and frayed from rough edges on the machine head. A square of red cellophane in the machine head highlights one of the tape squares. [run paragraph on]". To say tape contents: say "[fixed letter spacing]"; let table end be the head position; repeat with N running from table end to the number of rows in the Table of Tape Values begin; choose row N in the Table of Tape Values; if there is a Symbol entry begin; if the Symbol entry is 1, change table end to N; end if; end repeat; let zeros be the number of rows in the Table of Tape Values - table end; repeat with N running from 0 to the table end begin; if the head position is N, say "[bold type][red letters]"; if N is 0 begin; say "*"; otherwise; choose row N in the Table of Tape Values; if there is a Symbol entry, say "[Symbol entry]"; otherwise say "0"; end if; say "[default letters][roman type]"; end repeat; say "[variable letter spacing]" After reading a command: if the player's command includes "set tape to" or the player's command includes "set the tape to" begin; repeat with N running from 1 to the number of rows in the Table of Tape Values begin; choose row N in the Table of Tape Values; if the player's command includes "[number]" begin; if the number understood > 1 begin; say "The tape can contain only 0 and 1."; reject the player's command; end if; change the Temp entry to the number understood; cut the matched text; otherwise; change the Temp entry to 0; end if; end repeat; end if. Instead of setting the tape to when the player is in the bowels, say "You need to set the tape in the control room." Instead of setting the tape to: repeat through the Table of Tape Values begin; change the Symbol entry to Temp entry; end repeat; say "You set the tape to: [tape contents]." To clear the tape: repeat with N running from 1 to the number of rows in the Table of Tape Values begin; choose row N in the Table of Tape Values; change the Symbol entry to 0; end repeat. Table of Tape Values
|