(loader '((title |triang.lo|)))
(loader'((fentry check-triang subr0)
(entry check-triang subr0)
(mov 't a2)
(mov '(test-triang 1) a1)
(jmp check-value)
))
(loader'((fentry meter-triang subr0)
(entry meter-triang subr0)
(mov 'triang a2)
(mov '(gogogo 22) a1)
(jmp perform-meter)
))
(loader'((fentry test-triang subr1)
(entry test-triang subr1)
(cabne a1 '1 104)
(mov '22 a1)
(bra gogogo)
103
(push a1)
(mov '22 a1)
(call gogogo)
(pop a1)
104
(sobgez a1 103)
(mov 't a1)
(return)
))
(loader'((entry vector-to-list subr1)
(push a1)
(hgsize a1 a4)
(diff '1 a4)
(push nil)
(push a4)
101
(cnblt (& 0) '0 102)
(hpxmov (& 2) (& 0) a1)
(mov (& 1) a2)
(jcall cons)
(mov a1 (& 1))
(mov (& 0) a4)
(diff '1 a4)
(mov a4 (& 0))
(bra 101)
102
(mov (& 1) a1)
(adjstk '3)
(return)
))
(defvar triang-board (makevector 16 1))
(defvar triang-sequence (makevector 14 0))
(defvar triang-a (vector 1 2 4 3 5 6 1 3 6 2 5 4 11 12 13 7 8 4 4 7 11 8 12 13 6 10 15 9 14 13 13 14 15 9 10 6 6))
(defvar triang-b (vector 2 4 7 5 8 9 3 6 10 5 9 8 12 13 14 8 9 5 2 4 7 5 8 9 3 6 10 5 9 8 12 13 14 8 9 5 5))
(defvar triang-c (vector 4 7 11 8 12 13 6 10 15 9 14 13 13 14 15 9 10 6 1 2 4 3 5 6 1 3 6 2 5 4 11 12 13 7 8 4 4))
(defvar triang-answer)
(defvar triang-final)
((lambda (g104) ((lambda (g105) ((lambda (g103) (vset g104 g105 g103)) 0)) 5)) triang-board)
(loader'((entry triang-last-position subr0)
(push '1)
101
(cabeq (& 0) '16 102)
(hpxmov (cvalq triang-board) (& 0) a4)
(cabeq '1 a4 102)
(mov (& 0) a4)
(plus '1 a4)
(mov a4 (& 0))
(bra 101)
102
(cabne (& 0) '16 103)
(mov '0 a1)
(adjstk '1)
(return)
103
(mov (& 0) a1)
(adjstk '1)
(return)
))
(loader'((entry triang-try subr2)
(push a2)
(push a1)
(cabne a2 '14 101)
(call triang-last-position)
(push a1)
(mov (cvalq triang-final) a2)
(jcall member)
(bfnil a1 104)
(mov (cvalq triang-final) a2)
(mov (& 0) a1)
(jcall cons)
(mov a1 (cvalq triang-final))
104
(adjstk '1)
(mov (cvalq triang-sequence) a1)
(call vector-to-list)
(mov (cvalq triang-answer) a2)
(mov (cdr a1) a1)
(jcall cons)
(mov a1 (cvalq triang-answer))
(mov 't a1)
(adjstk '2)
(return)
101
(hpxmov (cvalq triang-a) a1 a4)
(hpxmov (cvalq triang-board) a4 a4)
(cabne '1 a4 105)
(hpxmov (cvalq triang-b) a1 a4)
(hpxmov (cvalq triang-board) a4 a4)
(cabne '1 a4 105)
(hpxmov (cvalq triang-c) a1 a4)
(hpxmov (cvalq triang-board) a4 a4)
(cabne '0 a4 105)
(push (cvalq triang-board))
(hpxmov (cvalq triang-a) a1 a4)
(push '0)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(push (cvalq triang-board))
(hpxmov (cvalq triang-b) a1 a4)
(push '0)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(push (cvalq triang-board))
(hpxmov (cvalq triang-c) a1 a4)
(push '1)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(push (cvalq triang-sequence))
(hpmovx a1 (& 0) a2)
(adjstk '1)
(mov (& 1) a4)
(plus '1 a4)
(push '0)
(push a4)
107
(cabeq (& 1) '36 108)
(mov (& 0) a2)
(mov (& 1) a1)
(call triang-try)
(bfnil a1 108)
(mov (& 1) a4)
(plus '1 a4)
(mov a4 (& 1))
(bra 107)
108
(adjstk '2)
(push (cvalq triang-board))
(hpxmov (cvalq triang-a) (& 1) a4)
(push '1)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(push (cvalq triang-board))
(hpxmov (cvalq triang-b) (& 1) a4)
(push '1)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(push (cvalq triang-board))
(hpxmov (cvalq triang-c) (& 1) a4)
(push '0)
(hpmovx (& 0) (& 1) a4)
(adjstk '2)
(mov nil a1)
(adjstk '2)
(return)
105
(mov nil a1)
(adjstk '2)
(return)
))
(loader'((entry gogogo subr1)
(push nil)
(push nil)
(push (cvalq triang-final))
(mov (& 1) (cvalq triang-final))
(push (cvalq triang-answer))
(mov (& 3) (cvalq triang-answer))
(push '2)
(push '(triang-final triang-answer))
(push 'lambda)
(push llink)
(push dlink)
(push cbindn)
(stack dlink)
(mov '1 a2)
(call triang-try)
(mov (& 1) dlink)
(mov (& 6) (cvalq triang-answer))
(mov (& 7) (cvalq triang-final))
(adjstk '10)
(return)
))
(loader '((end)))