[0.15.17] Decider combinator bug
-
- Manual Inserter
- Posts: 3
- Joined: Sun Apr 23, 2017 7:28 pm
- Contact:
[0.15.17] Decider combinator bug
Decider will pass any 'Everything' conditional if input has no signals.
- Attachments
-
- Screenshot - 01_06_2017 , 21_02_27.png (180.39 KiB) Viewed 1191 times
-
- Screenshot - 01_06_2017 , 21_33_34.png (188.62 KiB) Viewed 1191 times
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.15.17] Decider combinator bug
Not a bug, this is intentional for consistancy with pretty much every programming languge that has a multi-argument AND, and is correct behaviour. "Everything" additionally only handles nonzero signals, as well, since a zero signal is the same as an absent signal.
You'll notice all of these tests are consistant with the actual game.
Code: Select all
? (defun combinator-equal-1 (&rest signal-values)
(every (lambda (v) (= v 1))
(remove-if #'zerop signal-values)))
COMBINATOR-EQUAL-1
? (combinator-equal-1 1 1 1) ; 3 signals, all are one
T
? (combinator-equal-1 1 2 1) ; 3 signals, two are one and one is two
NIL
? (combinator-equal-1 1 2) ; 2 signals, a one and a two
NIL
? (combinator-equal-1 1 1) ; 2 signals, both one
T
? (combinator-equal-1 1) ; 1 signal, a one
T
? (combinator-equal-1 2) ; 1 signal, a two
NIL
? (combinator-equal-1) ; No signals
T
? (combinator-equal-1 1 0 1) ; "3" signals, two ones and a zero (the zero is ignored)
T
? (combinator-equal-1 0) ; "1" signal, a zero (which is ignored)
T