1 Script started on Fri May 15 09:23:28 1998 2 [31]% ./telephone 3 Player 0 about to block waiting for initialization info 4 Player 1 about to block waiting for initialization info 5 Player 2 about to block waiting for initialization info 6 Player 3 about to block waiting for initialization info 7 Player 4 about to block waiting for initialization info 8 Player 0 awake after waiting for initialization info 9 Player 1 awake after waiting for initialization info 10 Player 2 awake after waiting for initialization info 11 Player 3 awake after waiting for initialization info 12 Player 0 about to block waiting for message 13 Player 4 awake after waiting for initialization info As can be seen from lines 3-11 and 13, the players all correct block waiting for the identities of the players who follow them in the chain. Once the information has been received, they all wake up. 14 Player 1 about to block waiting for message 15 Player 2 about to block waiting for message 16 Player 3 about to block waiting for message 17 Player 0 received message 'abcdefghijkl' and changed it to 'abcdefghijk]' on pass 1 18 Player 4 about to block waiting for message 19 Player 0 about to block waiting for message Since the game starts with player 0, the output correctly displays that all of the other tasks are blocked waiting for a message while player 0 receives the initial message on the first pass. 20 Player 0 send message to next player 21 Player 1 received message 'abcdefghijk]' and changed it to 'abcdefghi3k]' on pass 2 22 Player 0 sent message to next player 23 Player 1 about to block waiting for message 24 Player 0 about to block waiting for message 25 Player 1 send message to next player 26 Player 2 received message 'abcdefghi3k]' and changed it to 'abc2efghi3k]' on pass 3 27 Player 1 sent message to next player 28 Player 2 about to block waiting for message 29 Player 1 about to block waiting for message 30 Player 2 send message to next player 31 Player 3 received message 'abc2efghi3k]' and changed it to 'abc2efghi3:]' on pass 4 32 Player 2 sent message to next player 33 Player 3 about to block waiting for message 34 Player 2 about to block waiting for message 35 Player 3 send message to next player 36 Player 4 received message 'abc2efghi3:]' and changed it to 'abc2e;ghi3:]' on pass 5 37 Player 3 sent message to next player 38 Player 4 about to block waiting for message 39 Player 3 about to block waiting for message 40 Player 4 send message to next player 41 Player 0 received message 'abc2e;ghi3:]' and changed it to 'abc2eHghi3:]' on pass 6 42 Player 4 sent message to next player 43 Player 0 about to block waiting for message 44 Player 4 about to block waiting for message 45 Player 0 send message to next player As can be seen in the previous messages, the message is circulated from player 0 -> 1 -> .. -> 4 and back to 0 so the players form a circle as they should. As well, the pass number is correctly incremented for each message pass. With each message pass, it can be seen by comparing the messages in lines 17, 21, 26, 31, 36 and 41 that for each pass, one and only character is changed in value. The choice of the character is random, as is the amount by which it is modified. 46 Player 1 received message 'abc2eHghi3:]' and changed it to 'abc2eHgMi3:]' on pass 7 47 Player 0 sent message to next player 48 Player 1 about to block waiting for message 49 Player 0 about to block waiting for message 50 Player 1 send message to next player 51 Player 2 received message 'abc2eHgMi3:]' and changed it to 'abc2eHgMiB:]' on pass 8 52 Player 1 sent message to next player 53 Player 2 about to block waiting for message 54 Player 1 about to block waiting for message 55 Player 2 send message to next player 56 Player 3 received message 'abc2eHgMiB:]' and changed it to 'a1c2eHgMiB:]' on pass 9 57 Player 2 sent message to next player 58 Player 3 about to block waiting for message 59 Player 2 about to block waiting for message 60 Player 3 send message to next player 61 Player 4 received message 'a1c2eHgMiB:]' and changed it to 'a1c2eHUMiB:]' on pass 10 62 Player 3 sent message to next player 63 Player 4 about to block waiting for message 64 Player 3 about to block waiting for message 65 Player 4 send message to next player 66 Player 0 received message 'a1c2eHUMiB:]' and changed it to 'a1c2eHUMiB~]' on pass 11 67 Player 4 sent message to next player 68 Player 0 about to block waiting for message 69 Player 4 about to block waiting for message 70 Player 0 send message to next player 71 Player 1 received message 'a1c2eHUMiB~]' and changed it to 'a1c2eHQMiB~]' on pass 12 72 Player 0 sent message to next player 73 Player 1 about to block waiting for message Pass 12 indicates that two full complete cycles of the ring have been made. From this point on, the game switches into its termination phase. 74 Player 0 send empty message to next player 75 Player 1 send empty message to next player 76 Player 2 received message 'NULL' on pass 13 77 Player 1 sent empty message to next player 78 Player 2 about to block waiting for message 79 Player 1 terminating 80 Player 2 send empty message to next player 81 Player 1 received message 'NULL' on pass 15 82 Player 3 received message 'NULL' on pass 15 83 Player 0 sent empty message to next player 84 Player 2 sent empty message to next player 85 Player 3 about to block waiting for message 86 Player 0 terminating 87 Player 2 terminating 88 Player 3 send empty message to next player 89 Player 4 received message 'NULL' on pass 16 90 Player 3 sent empty message to next player 91 Player 4 about to block waiting for message 92 Player 3 terminating 93 Player 4 terminating As can be seen from the line pairs (76, 87), (81, 79), (82, 92), (89, 93), players 1 through 4 have terminated while lines 83 and 86 show that the instigator of the termination, player 0, has terminated. 94 Final message was: 'a1c2eHQMiB~]' The final message printed matches the one displayed on line 71, so it wasn't changed during the termination sequence which is proper behaviour. 95 (UNIX pid:29995) (uHeap *)0xb8420.uDoFree(): program terminating with 288(0x120) bytes of storage allocated but not freed. This game shows the same sequence of play, but that the changes to the message are different in this game, reinforcing that the changes made to the message are truly random. 96 [32]% ./telephone 97 Player 0 about to block waiting for initialization info 98 Player 1 about to block waiting for initialization info 99 Player 2 about to block waiting for initialization info 100 Player 3 about to block waiting for initialization info 101 Player 4 about to block waiting for initialization info 102 Player 0 awake after waiting for initialization info 103 Player 1 awake after waiting for initialization info 104 Player 2 awake after waiting for initialization info 105 Player 3 awake after waiting for initialization info 106 Player 0 about to block waiting for message 107 Player 4 awake after waiting for initialization info 108 Player 1 about to block waiting for message 109 Player 2 about to block waiting for message 110 Player 3 about to block waiting for message 111 Player 0 received message 'abcdefghijkl' and changed it to 'abcdefghijFl' on pass 1 112 Player 4 about to block waiting for message 113 Player 0 about to block waiting for message 114 Player 0 send message to next player 115 Player 1 received message 'abcdefghijFl' and changed it to 'afcdefghijFl' on pass 2 116 Player 0 sent message to next player 117 Player 1 about to block waiting for message 118 Player 0 about to block waiting for message 119 Player 1 send message to next player 120 Player 2 received message 'afcdefghijFl' and changed it to 'afcdef'hijFl' on pass 3 121 Player 1 sent message to next player 122 Player 2 about to block waiting for message 123 Player 1 about to block waiting for message 124 Player 2 send message to next player 125 Player 3 received message 'afcdef'hijFl' and changed it to 'afcdef'%ijFl' on pass 4 126 Player 2 sent message to next player 127 Player 3 about to block waiting for message 128 Player 2 about to block waiting for message 129 Player 3 send message to next player 130 Player 4 received message 'afcdef'%ijFl' and changed it to 'aJcdef'%ijFl' on pass 5 131 Player 3 sent message to next player 132 Player 4 about to block waiting for message 133 Player 3 about to block waiting for message 134 Player 4 send message to next player 135 Player 0 received message 'aJcdef'%ijFl' and changed it to 'aJNdef'%ijFl' on pass 6 136 Player 4 sent message to next player 137 Player 0 about to block waiting for message 138 Player 4 about to block waiting for message 139 Player 0 send message to next player 140 Player 1 received message 'aJNdef'%ijFl' and changed it to 'aJNdef'%ij4l' on pass 7 141 Player 0 sent message to next player 142 Player 1 about to block waiting for message 143 Player 0 about to block waiting for message 144 Player 1 send message to next player 145 Player 2 received message 'aJNdef'%ij4l' and changed it to 'aJNdef#%ij4l' on pass 8 146 Player 1 sent message to next player 147 Player 2 about to block waiting for message 148 Player 1 about to block waiting for message 149 Player 2 send message to next player 150 Player 3 received message 'aJNdef#%ij4l' and changed it to 'QJNdef#%ij4l' on pass 9 151 Player 2 sent message to next player 152 Player 3 about to block waiting for message 153 Player 2 about to block waiting for message 154 Player 3 send message to next player 155 Player 4 received message 'QJNdef#%ij4l' and changed it to 'QJN\ef#%ij4l' on pass 10 156 Player 3 sent message to next player 157 Player 4 about to block waiting for message 158 Player 3 about to block waiting for message 159 Player 4 send message to next player 160 Player 0 received message 'QJN\ef#%ij4l' and changed it to 'QJ@\ef#%ij4l' on pass 11 161 Player 4 sent message to next player 162 Player 0 about to block waiting for message 163 Player 4 about to block waiting for message 164 Player 0 send message to next player 165 Player 1 received message 'QJ@\ef#%ij4l' and changed it to 'QJ@\eY#%ij4l' on pass 12 166 Player 0 sent message to next player 167 Player 1 about to block waiting for message 168 Player 0 send empty message to next player 169 Player 1 send empty message to next player 170 Player 2 received message 'NULL' on pass 13 171 Player 1 sent empty message to next player 172 Player 2 about to block waiting for message 173 Player 1 terminating 174 Player 2 send empty message to next player 175 Player 1 received message 'NULL' on pass 15 176 Player 3 received message 'NULL' on pass 15 177 Player 0 sent empty message to next player 178 Player 2 sent empty message to next player 179 Player 3 about to block waiting for message 180 Player 0 terminating 181 Player 2 terminating 182 Player 3 send empty message to next player 183 Player 4 received message 'NULL' on pass 16 184 Player 3 sent empty message to next player 185 Player 4 about to block waiting for message 186 Player 3 terminating 187 Player 4 terminating 188 Final message was: 'QJ@\eY#%ij4l' 189 (UNIX pid:122) (uHeap *)0xb8420.uDoFree(): program terminating with 288(0x120) bytes of storage allocated but not freed. 190 [33]% exit 191 exit 192 script done on Fri May 15 09:23:54 1998 Thus: 1) Order of play is correct 2) Number of message passes is correct 3) Termination is correct 4) Modification of message is random and done properly ie. one character per pass