###How?
®ḢN$Ḣ©?ṄEȧ - Link 1, print first number and yield next input: list of numbers, X
- e.g. [8,0,15,16,...] or [0,4,8,0,15,16,...]
? - if...
Ḣ - condition: yield head and modify 8([0,15,16,...]) 0([4,8,0,15,16,...])
© - (copy to register) 8 0
® - then: recall from the register 8
$ - else: last two links as a monad:
Ḣ - yield head and modify 4([8,0,15,16,...])
N negate -4
Ṅ - print that and yield it 8 -4
E - all equal (to get 0 to be truthy) 1 1
ȧ - AND the (modified) input [0,15,16,...] [8,0,15,16,...]
- (ready to be the input for the next call to this link)
ṣ0L€ÇL¿ - Main link: list e.g. [0,1,0,0,0,0,1,1]
ṣ0 - split at zeros [[],[1],[],[],[],[1,1]
L€ - length of €ach [0,1,0,0,0,2]
¿ - while...
L - condition: length 1 1 1 0 ([0,1,0,0,0,2], [0,0,0,2], [0,2], [])
Ç - action: call the last link (1) as a monad -1 0 -2 ( - 1 - 0 - 2)