Mercurial > hg > aoc
annotate 2017/day18/problem @ 35:1d99d733cf13 default tip @
day08: replace static foreach with workaround
author  Jordi Gutiérrez Hermoso <jordigh@octave.org> 

date  Tue, 16 Jan 2018 11:28:55 0500 
parents  049fb8e56025 
children 
rev  line source 

34
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

1  Day 18: Duet  
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

2 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

3 You discover a tablet containing some strange assembly code labeled 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

4 simply "Duet". Rather than bother the sound card with it, you decide 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

5 to run the code yourself. Unfortunately, you don't see any 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

6 documentation, so you're left to figure out what the instructions mean 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

7 on your own. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

8 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

9 It seems like the assembly is meant to operate on a set of registers 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

10 that are each named with a single letter and that can each hold a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

11 single integer. You suppose each register should start with a value of 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

12 0. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

13 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

14 There aren't that many instructions, so it shouldn't be hard to figure 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

15 out what they do. Here's what you determine: 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

16 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

17 snd X plays a sound with a frequency equal to the value of X. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

18 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

19 set X Y sets register X to the value of Y. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

20 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

21 add X Y increases register X by the value of Y. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

22 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

23 mul X Y sets register X to the result of multiplying the value 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

24 contained in register X by the value of Y. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

25 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

26 mod X Y sets register X to the remainder of dividing the value 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

27 contained in register X by the value of Y (that is, it sets X to 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

28 the result of X modulo Y). 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

29 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

30 rcv X recovers the frequency of the last sound played, but only 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

31 when the value of X is not zero. (If it is zero, the command does 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

32 nothing.) 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

33 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

34 jgz X Y jumps with an offset of the value of Y, but only if the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

35 value of X is greater than zero. (An offset of 2 skips the next 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

36 instruction, an offset of 1 jumps to the previous instruction, 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

37 and so on.) 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

38 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

39 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

40 Many of the instructions can take either a register (a single letter) 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

41 or a number. The value of a register is the integer it contains; the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

42 value of a number is that number. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

43 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

44 After each jump instruction, the program continues with the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

45 instruction to which the jump jumped. After any other instruction, the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

46 program continues with the next instruction. Continuing (or jumping) 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

47 off either end of the program terminates it. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

48 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

49 For example: 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

50 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

51 set a 1 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

52 add a 2 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

53 mul a a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

54 mod a 5 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

55 snd a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

56 set a 0 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

57 rcv a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

58 jgz a 1 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

59 set a 1 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

60 jgz a 2 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

61 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

62 The first four instructions set a to 1, add 2 to it, square it, 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

63 and then set it to itself modulo 5, resulting in a value of 4. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

64 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

65 Then, a sound with frequency 4 (the value of a) is played. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

66 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

67 After that, a is set to 0, causing the subsequent rcv and jgz 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

68 instructions to both be skipped (rcv because a is 0, and jgz 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

69 because a is not greater than 0). 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

70 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

71 Finally, a is set to 1, causing the next jgz instruction to 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

72 activate, jumping back two instructions to another jump, which 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

73 jumps again to the rcv, which ultimately triggers the recover 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

74 operation. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

75 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

76 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

77 At the time the recover operation is executed, the frequency of the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

78 last sound played is 4. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

79 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

80 What is the value of the recovered frequency (the value of the most 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

81 recently played sound) the first time a rcv instruction is executed 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

82 with a nonzero value? 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

83 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

84 Your puzzle answer was 7071. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

85 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

86  Part Two  
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

87 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

88 As you congratulate yourself for a job well done, you notice that the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

89 documentation has been on the back of the tablet this entire time. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

90 While you actually got most of the instructions correct, there are a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

91 few key differences. This assembly code isn't about sound at all  
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

92 it's meant to be run twice at the same time. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

93 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

94 Each running copy of the program has its own set of registers and 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

95 follows the code independently  in fact, the programs don't even 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

96 necessarily run at the same speed. To coordinate, they use the send 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

97 (snd) and receive (rcv) instructions: 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

98 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

99 snd X sends the value of X to the other program. These values wait 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

100 in a queue until that program is ready to receive them. Each 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

101 program has its own message queue, so a program can never receive 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

102 a message it sent. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

103 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

104 rcv X receives the next value and stores it in register X. If no 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

105 values are in the queue, the program waits for a value to be sent 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

106 to it. Programs do not continue to the next instruction until they 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

107 have received a value. Values are received in the order they are 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

108 sent. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

109 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

110 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

111 Each program also has its own program ID (one 0 and the other 1); the 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

112 register p should begin with this value. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

113 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

114 For example: 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

115 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

116 snd 1 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

117 snd 2 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

118 snd p 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

119 rcv a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

120 rcv b 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

121 rcv c 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

122 rcv d 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

123 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

124 Both programs begin by sending three values to the other. Program 0 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

125 sends 1, 2, 0; program 1 sends 1, 2, 1. Then, each program receives a 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

126 value (both 1) and stores it in a, receives another value (both 2) and 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

127 stores it in b, and then each receives the program ID of the other 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

128 program (program 0 receives 1; program 1 receives 0) and stores it in 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

129 c. Each program now sees a different value in its own copy of register 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

130 c. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

131 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

132 Finally, both programs try to rcv a fourth time, but no data is 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

133 waiting for either of them, and they reach a deadlock. When this 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

134 happens, both programs terminate. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

135 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

136 It should be noted that it would be equally valid for the programs to 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

137 run at different speeds; for example, program 0 might have sent all 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

138 three values and then stopped at the first rcv before program 1 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

139 executed even its first instruction. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

140 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

141 Once both of your programs have terminated (regardless of what caused 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

142 them to do so), how many times did program 1 send a value? 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

143 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

144 Your puzzle answer was 8001. 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

145 
049fb8e56025
Add problem statements and inputs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
diff
changeset

146 Both parts of this puzzle are complete! They provide two gold stars: ** 