File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ var rxIndex: Int?
42
42
let verbose = switch CommandLine . arguments. last {
43
43
case " -v " : 1
44
44
case " -vv " : 2
45
+ case " -vvv " : 3
45
46
default : 0
46
47
}
47
48
@@ -158,7 +159,7 @@ func simulate(modules: inout [Module]) -> (Int, Int) {
158
159
159
160
var ( ct, cf) = ( 0 , 0 )
160
161
func count( _ pulse: Pulse ) {
161
- if ( verbose > 1 ) {
162
+ if ( verbose > 2 ) {
162
163
print ( pulse)
163
164
}
164
165
if pulse. value { ct += 1 }
@@ -190,15 +191,17 @@ func simulate(modules: inout [Module]) -> (Int, Int) {
190
191
}
191
192
}
192
193
193
- if verbose > 0 {
194
+ if verbose > 1 {
194
195
print ( " counts " , ct, cf)
195
196
}
196
197
return ( ct * cf, rxn ?? 0 )
197
198
}
198
199
199
200
func show( modules: [ Module ] ) {
200
- if verbose > 0 {
201
+ if verbose > 1 {
201
202
print ( modules. map ( { $0. description } ) . joined ( separator: " · " ) )
203
+ } else if verbose > 0 {
204
+ print ( modules. compactMap ( { $0. stateString } ) . joined ( separator: " · " ) )
202
205
}
203
206
}
204
207
You can’t perform that action at this time.
0 commit comments