proc makepanel
	filen	cells.icn
	local	0,001000,n
	local	1,001000,m
	local	2,001000,cellsize
	local	3,001000,fg
	local	4,001000,bg
	local	5,001000,pg
	local	6,000020,window
	local	7,000020,x
	local	8,000020,y
	local	9,000020,width
	local	10,000020,height
	local	11,000020,panel
	local	12,000000,WOpen
	local	13,000000,Panel
	local	14,000000,clearpanel
	con	0,010000,5,142,154,141,143,153
	con	1,010000,5,167,150,151,164,145
	con	2,002000,2,10
	con	3,002000,1,1
	con	4,010000,6,167,151,144,164,150,075
	con	5,010000,7,150,145,151,147,150,164,075
	con	6,010000,3,146,147,075
	con	7,010000,3,142,147,075
	con	8,010000,13,143,141,156,166,141,163,075,150,151,144,144,145,156
	declend
	line	64
	colm	11
	mark	L1
	pnull
	pnull
	var	3
	line	67
	colm	4
	null
	str	0
	line	67
	colm	8
	asgn
	unmark
lab L1
	mark	L2
	pnull
	pnull
	var	4
	line	68
	colm	4
	null
	str	1
	line	68
	colm	8
	asgn
	unmark
lab L2
	mark	L3
	pnull
	pnull
	var	2
	line	70
	colm	4
	null
	int	2
	line	70
	colm	14
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	9
	pnull
	pnull
	var	0
	var	2
	line	72
	colm	16
	mult
	int	3
	line	72
	colm	28
	plus
	line	72
	colm	10
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	10
	pnull
	pnull
	var	1
	var	2
	line	73
	colm	17
	mult
	int	3
	line	73
	colm	29
	plus
	line	73
	colm	11
	asgn
	unmark
lab L5
	mark	L6
	pnull
	var	6
	mark	L7
	var	12
	pnull
	str	4
	var	9
	line	75
	colm	29
	cat
	pnull
	str	5
	var	10
	line	75
	colm	49
	cat
	pnull
	str	6
	var	3
	line	76
	colm	13
	cat
	pnull
	str	7
	var	4
	line	76
	colm	26
	cat
	str	8
	line	75
	colm	19
	invoke	5
	esusp
	goto	L8
lab L7
	line	76
	colm	52
	pfail
lab L8
	line	75
	colm	11
	asgn
	unmark
lab L6
	mark	L9
	pnull
	var	11
	var	13
	var	6
	var	0
	var	1
	var	2
	var	3
	var	4
	var	5
	line	78
	colm	18
	invoke	7
	line	78
	colm	10
	asgn
	unmark
lab L9
	mark	L10
	var	14
	var	11
	line	80
	colm	14
	invoke	1
	unmark
lab L10
	mark	L11
	mark	L12
	var	11
	line	82
	colm	4
	pret
lab L12
	pfail
	unmark
lab L11
	pnull
	line	84
	colm	1
	pfail
	end
proc clearpanel
	local	0,001000,panel
	local	1,000020,width
	local	2,000020,height
	local	3,000020,x
	local	4,000020,y
	local	5,000000,WAttrib
	local	6,000000,Pattern
	local	7,000000,Bg
	local	8,000000,Fg
	local	9,000000,DrawLine
	con	0,010000,18,146,151,154,154,163,164,171,154,145,075,164,145,170,164,165,162,145,144
	con	1,010000,8,143,150,145,143,153,145,162,163
	con	2,010000,14,166,145,162,171,040,144,141,162,153,040,147,162,141,171
	con	3,010000,5,167,151,144,164,150
	con	4,010000,6,150,145,151,147,150,164
	con	5,002000,1,0
	con	6,010000,15,146,151,154,154,163,164,171,154,145,075,163,157,154,151,144
	declend
	line	86
	colm	11
	mark	L1
	mark	L2
	pnull
	pnull
	var	0
	line	89
	colm	13
	field	pg
	line	89
	colm	7
	nonnull
	unmark
	mark	L4
	var	5
	pnull
	var	0
	line	90
	colm	20
	field	window
	str	0
	line	90
	colm	14
	invoke	2
	unmark
lab L4
	mark	L5
	var	6
	pnull
	var	0
	line	91
	colm	20
	field	window
	str	1
	line	91
	colm	14
	invoke	2
	unmark
lab L5
	var	7
	pnull
	var	0
	line	92
	colm	15
	field	window
	str	2
	line	92
	colm	9
	invoke	2
	goto	L3
lab L2
	var	8
	pnull
	var	0
	line	94
	colm	17
	field	window
	pnull
	var	0
	line	94
	colm	31
	field	fg
	line	94
	colm	11
	invoke	2
lab L3
	unmark
lab L1
	mark	L6
	pnull
	var	1
	var	5
	pnull
	var	0
	line	96
	colm	26
	field	window
	str	3
	line	96
	colm	20
	invoke	2
	line	96
	colm	10
	asgn
	unmark
lab L6
	mark	L7
	pnull
	var	2
	var	5
	pnull
	var	0
	line	97
	colm	27
	field	window
	str	4
	line	97
	colm	21
	invoke	2
	line	97
	colm	11
	asgn
	unmark
lab L7
	mark	L8
	mark0
	pnull
	var	3
	pnull
	int	5
	var	1
	pnull
	var	0
	line	99
	colm	34
	field	size
	line	99
	colm	17
	toby
	line	99
	colm	12
	asgn
	pop
	mark0
	var	9
	pnull
	var	0
	line	100
	colm	21
	field	window
	var	3
	int	5
	var	3
	var	2
	line	100
	colm	15
	invoke	5
	unmark
lab L9
	efail
lab L10
	unmark
lab L8
	mark	L11
	mark0
	pnull
	var	4
	pnull
	int	5
	var	2
	pnull
	var	0
	line	102
	colm	35
	field	size
	line	102
	colm	17
	toby
	line	102
	colm	12
	asgn
	pop
	mark0
	var	9
	pnull
	var	0
	line	103
	colm	21
	field	window
	int	5
	var	4
	var	1
	var	4
	line	103
	colm	15
	invoke	5
	unmark
lab L12
	efail
lab L13
	unmark
lab L11
	mark	L14
	var	5
	pnull
	var	0
	line	105
	colm	17
	field	window
	str	6
	line	105
	colm	11
	invoke	2
	unmark
lab L14
	mark	L15
	mark	L16
	var	0
	line	107
	colm	4
	pret
lab L16
	pfail
	unmark
lab L15
	pnull
	line	109
	colm	1
	pfail
	end
proc matrixpanel
	local	0,001000,matrix
	local	1,001000,cellsize
	local	2,001000,fg
	local	3,001000,bg
	local	4,001000,pg
	local	5,000000,makepanel
	con	0,002000,1,1
	declend
	line	111
	colm	11
	mark	L1
	mark	L2
	var	5
	pnull
	pnull
	var	0
	int	0
	line	113
	colm	28
	subsc
	line	113
	colm	21
	size
	pnull
	var	0
	line	113
	colm	33
	size
	var	1
	var	2
	var	3
	line	113
	colm	20
	invoke	5
	line	113
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	115
	colm	1
	pfail
	end
proc colorcell
	local	0,001000,panel
	local	1,001000,n
	local	2,001000,m
	local	3,001000,color
	local	4,000020,cellsize
	local	5,000000,integer
	local	6,000000,stop
	local	7,000000,image
	local	8,000000,Fg
	local	9,000000,FillRectangle
	con	0,010000,36,116,157,156,055,151,156,164,145,147,145,162,040,166,141,154,165,145,040,164,157,040,143,157,154,157,162,143,145,154,154,050,051,056,040,156,075
	con	1,010000,3,040,155,075
	con	2,002000,1,1
	declend
	line	117
	colm	11
	mark	L1
	mark0
	mark	L2
	var	5
	var	1
	line	120
	colm	18
	invoke	1
	pop
	var	5
	var	2
	line	120
	colm	31
	invoke	1
	unmark
	efail
lab L2
	pnull
	unmark
	var	6
	str	0
	var	7
	var	1
	line	121
	colm	57
	invoke	1
	str	1
	var	7
	var	2
	line	121
	colm	74
	invoke	1
	line	121
	colm	11
	invoke	4
	unmark
lab L1
	mark	L3
	pnull
	var	4
	pnull
	var	0
	line	123
	colm	21
	field	size
	line	123
	colm	13
	asgn
	unmark
lab L3
	mark	L4
	var	8
	pnull
	var	0
	line	125
	colm	12
	field	window
	var	3
	line	125
	colm	6
	invoke	2
	unmark
lab L4
	mark	L5
	var	9
	pnull
	var	0
	line	127
	colm	23
	field	window
	pnull
	pnull
	pnull
	var	1
	int	2
	line	127
	colm	35
	minus
	var	4
	line	127
	colm	40
	mult
	int	2
	line	127
	colm	51
	plus
	pnull
	pnull
	pnull
	var	2
	int	2
	line	127
	colm	59
	minus
	var	4
	line	127
	colm	64
	mult
	int	2
	line	127
	colm	75
	plus
	pnull
	var	4
	int	2
	line	128
	colm	17
	minus
	pnull
	var	4
	int	2
	line	128
	colm	31
	minus
	line	127
	colm	17
	invoke	5
	unmark
lab L5
	mark	L6
	mark	L7
	var	0
	line	130
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	132
	colm	1
	pfail
	end
proc colorcells
	local	0,001000,panel
	local	1,001000,matrix
	local	2,000020,i
	local	3,000020,j
	local	4,000020,n
	local	5,000020,m
	local	6,000020,cellsize
	local	7,000000,Fg
	local	8,000000,stop
	local	9,000000,FillRectangle
	con	0,002000,1,1
	con	1,010000,1,061
	con	2,010000,5,167,150,151,164,145
	con	3,010000,1,060
	con	4,010000,5,142,154,141,143,153
	con	5,010000,40,106,147,050,051,040,146,141,151,154,145,144,040,151,156,040,143,157,154,157,162,143,145,154,154,163,050,051,040,167,151,164,150,040,155,141,164,162,151,170,133
	con	6,010000,1,054
	con	7,010000,2,135,075
	con	8,010000,1,056
	declend
	line	134
	colm	11
	mark	L1
	pnull
	var	6
	pnull
	var	0
	line	137
	colm	21
	field	size
	line	137
	colm	13
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	5
	pnull
	var	1
	line	139
	colm	9
	size
	line	139
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	4
	pnull
	pnull
	var	1
	int	0
	line	140
	colm	16
	subsc
	line	140
	colm	9
	size
	line	140
	colm	6
	asgn
	unmark
lab L3
	mark	L4
	mark0
	pnull
	var	2
	pnull
	int	0
	var	5
	push1
	line	142
	colm	17
	toby
	line	142
	colm	12
	asgn
	pop
	mark0
	mark0
	pnull
	var	3
	pnull
	int	0
	var	4
	push1
	line	143
	colm	20
	toby
	line	143
	colm	15
	asgn
	pop
	mark0
	mark	L9
	mark	L10
	pnull
	pnull
	pnull
	var	1
	var	2
	line	145
	colm	19
	subsc
	var	3
	subsc
	str	1
	line	145
	colm	26
	eqv
	unmark
	pnull
	pnull
	pnull
	var	1
	var	2
	line	145
	colm	45
	subsc
	var	3
	subsc
	str	2
	line	145
	colm	52
	asgn
	goto	L11
lab L10
	mark0
	pnull
	pnull
	pnull
	var	1
	var	2
	line	146
	colm	24
	subsc
	var	3
	subsc
	str	3
	line	146
	colm	31
	eqv
	unmark
	pnull
	pnull
	pnull
	var	1
	var	2
	line	146
	colm	50
	subsc
	var	3
	subsc
	str	4
	line	146
	colm	57
	asgn
lab L11
	unmark
lab L9
	mark	L12
	var	7
	pnull
	var	0
	line	147
	colm	18
	field	window
	pnull
	pnull
	var	1
	var	2
	line	147
	colm	33
	subsc
	var	3
	subsc
	line	147
	colm	12
	invoke	2
	unmark
lab L12
	mark	L13
	var	8
	pnull
	pnull
	pnull
	pnull
	pnull
	pnull
	str	5
	var	2
	line	148
	colm	61
	cat
	str	6
	line	149
	colm	17
	cat
	var	3
	line	149
	colm	24
	cat
	str	7
	line	149
	colm	29
	cat
	pnull
	pnull
	var	1
	var	2
	line	149
	colm	46
	subsc
	var	3
	subsc
	line	149
	colm	37
	cat
	str	8
	line	149
	colm	53
	cat
	line	148
	colm	17
	invoke	1
	unmark
lab L13
	var	9
	pnull
	var	0
	line	150
	colm	29
	field	window
	pnull
	pnull
	pnull
	var	3
	int	0
	line	150
	colm	41
	minus
	var	6
	line	150
	colm	46
	mult
	int	0
	line	150
	colm	57
	plus
	pnull
	pnull
	pnull
	var	2
	int	0
	line	150
	colm	65
	minus
	var	6
	line	150
	colm	70
	mult
	int	0
	line	150
	colm	81
	plus
	pnull
	var	6
	int	0
	line	151
	colm	22
	minus
	pnull
	var	6
	int	0
	line	151
	colm	36
	minus
	line	150
	colm	23
	invoke	5
	unmark
lab L7
	efail
lab L8
	unmark
lab L5
	efail
lab L6
	unmark
lab L4
	mark	L14
	mark	L15
	var	0
	line	155
	colm	4
	pret
lab L15
	pfail
	unmark
lab L14
	pnull
	line	157
	colm	1
	pfail
	end
proc tiercells
	local	0,001000,panel
	local	1,001000,tier
	local	2,000020,i
	local	3,000020,j
	local	4,000020,n
	local	5,000020,m
	local	6,000020,cellsize
	local	7,000020,matrix
	local	8,000000,Fg
	local	9,000000,FillRectangle
	con	0,002000,1,1
	con	1,010000,1,061
	con	2,010000,5,167,150,151,164,145
	con	3,010000,5,142,154,141,143,153
	declend
	line	159
	colm	11
	mark	L1
	pnull
	var	6
	pnull
	var	0
	line	162
	colm	21
	field	size
	line	162
	colm	13
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	5
	pnull
	var	1
	line	164
	colm	13
	field	shafts
	line	164
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	4
	pnull
	var	1
	line	165
	colm	13
	field	treadles
	line	165
	colm	6
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	7
	pnull
	var	1
	line	166
	colm	18
	field	matrix
	line	166
	colm	11
	asgn
	unmark
lab L4
	mark	L5
	mark0
	pnull
	var	2
	pnull
	int	0
	var	5
	push1
	line	168
	colm	17
	toby
	line	168
	colm	12
	asgn
	pop
	mark0
	mark0
	pnull
	var	3
	pnull
	int	0
	var	4
	push1
	line	169
	colm	20
	toby
	line	169
	colm	15
	asgn
	pop
	mark0
	mark	L10
	mark	L11
	pnull
	pnull
	pnull
	var	7
	var	2
	line	170
	colm	19
	subsc
	var	3
	subsc
	str	1
	line	170
	colm	26
	eqv
	unmark
	var	8
	pnull
	var	0
	line	170
	colm	47
	field	window
	str	2
	line	170
	colm	41
	invoke	2
	goto	L12
lab L11
	var	8
	pnull
	var	0
	line	171
	colm	23
	field	window
	str	3
	line	171
	colm	17
	invoke	2
lab L12
	unmark
lab L10
	var	9
	pnull
	var	0
	line	172
	colm	29
	field	window
	pnull
	pnull
	pnull
	var	3
	int	0
	line	172
	colm	41
	minus
	var	6
	line	172
	colm	46
	mult
	int	0
	line	172
	colm	57
	plus
	pnull
	pnull
	pnull
	var	2
	int	0
	line	172
	colm	65
	minus
	var	6
	line	172
	colm	70
	mult
	int	0
	line	172
	colm	81
	plus
	pnull
	var	6
	int	0
	line	173
	colm	22
	minus
	pnull
	var	6
	int	0
	line	173
	colm	36
	minus
	line	172
	colm	23
	invoke	5
	unmark
lab L8
	efail
lab L9
	unmark
lab L6
	efail
lab L7
	unmark
lab L5
	mark	L13
	mark	L14
	var	0
	line	177
	colm	4
	pret
lab L14
	pfail
	unmark
lab L13
	pnull
	line	179
	colm	1
	pfail
	end
proc cell
	local	0,001000,panel
	local	1,001000,x
	local	2,001000,y
	local	3,000020,n
	local	4,000020,m
	local	5,000000,Cell
	local	6,000000,Pixel
	con	0,002000,1,1
	declend
	line	181
	colm	11
	mark	L1
	pnull
	var	3
	pnull
	pnull
	var	1
	pnull
	var	0
	line	184
	colm	18
	field	size
	line	184
	colm	11
	div
	int	0
	line	184
	colm	24
	plus
	line	184
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	4
	pnull
	pnull
	var	2
	pnull
	var	0
	line	185
	colm	18
	field	size
	line	185
	colm	11
	div
	int	0
	line	185
	colm	24
	plus
	line	185
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	mark0
	mark	L4
	pnull
	var	3
	pnull
	var	0
	line	187
	colm	17
	field	n
	line	187
	colm	10
	numgt
	esusp
	goto	L5
lab L4
	pnull
	var	4
	pnull
	var	0
	line	187
	colm	33
	field	m
	line	187
	colm	26
	numgt
lab L5
	unmark
	line	187
	colm	42
	pfail
	unmark
lab L3
	mark	L6
	mark	L7
	var	5
	var	3
	var	4
	var	6
	pnull
	var	0
	line	189
	colm	33
	field	window
	var	1
	var	2
	line	189
	colm	27
	invoke	3
	line	189
	colm	15
	invoke	3
	line	189
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	191
	colm	1
	pfail
	end
