spinix-hive/lerner/lerner.spin

1542 lines
66 KiB
Plaintext

'**********************************************
'* Spin code generated by cspin version 0.066 *
'**********************************************
{
Lerner 0.08
Copyright (c) 2011, Dave Hein
See end of file for terms of use
}
CON
_clkmode = xinput
_xinfreq = $4e495053 ' SPIN
OBJ
c : "clib"
ser : "cserial"
'i2c : "Basic_I2C_Driver"
spinix : "exit"
' Constants
CON
TYPE_NOUN = 1
TYPE_VERB = 2
TYPE_PRONOUN = 3
TYPE_ADJECT = 4
TYPE_OTHER = 5
TYPE_NAME = 6
TYPE_ARTICLE = 7
TYPE_QUERY = 8
TYPE_RELATED = 32
TYPE_EQUATE = 33
TYPE_RELATE2 = 34
TYPE_MASK = $3f
DELETE_MASK = $40
MEMORY_MASK = 31
BUF_SIZE = 10000
' Global variables
DAT
speak long 0
seed long 1
debugmode long 0
changeflag long 0
MemoryIndex long 0
datstr byte "noun", 0, "verb", 0, "pronoun", 0, "adjective", 0
byte "other", 0, "name", 0, "article", 0, "query", 0
types long @datstr + 16, @datstr + 21, @datstr + 26, @datstr + 34
long @datstr + 44, @datstr + 50, @datstr + 55, @datstr + 63
' Basic vocabulary
basicsize long 249
basicvocab byte
byte $03,$49,$00,$00,$19,$02,$61,$6d,$00,$00,$6b,$07,$61,$00,$00,$00
byte $01,$68,$75,$6d,$61,$6e,$00,$00,$00,$20,$00,$05,$00,$10,$00,$00
byte $03,$79,$6f,$75,$00,$00,$38,$02,$61,$72,$65,$00,$00,$70,$06,$4c
byte $65,$72,$6e,$65,$72,$00,$00,$50,$20,$00,$27,$00,$2e,$00,$61,$02
byte $69,$73,$00,$00,$75,$01,$70,$72,$6f,$67,$72,$61,$6d,$00,$00,$00
byte $20,$00,$3f,$00,$45,$00,$66,$02,$65,$71,$75,$61,$6c,$73,$00,$01
byte $17,$21,$00,$2e,$00,$00,$21,$00,$20,$00,$00,$21,$00,$27,$00,$7a
byte $21,$00,$05,$01,$04,$21,$00,$05,$00,$7f,$21,$00,$3f,$00,$00,$21
byte $00,$27,$00,$00,$21,$00,$3f,$00,$00,$02,$65,$71,$75,$61,$6c,$00
byte $01,$12,$21,$00,$57,$00,$00,$21,$01,$09,$00,$00,$08,$77,$68,$6f
byte $00,$01,$2b,$08,$77,$68,$61,$74,$00,$01,$30,$21,$01,$23,$00,$00
byte $21,$01,$1c,$00,$00,$01,$63,$6f,$6d,$70,$75,$74,$65,$72,$00,$01
byte $49,$02,$72,$75,$6e,$73,$00,$01,$74,$20,$01,$41,$00,$45,$00,$00
byte $02,$64,$6f,$65,$73,$00,$01,$6a,$02,$72,$75,$6e,$00,$01,$6f,$02
byte $64,$6f,$00,$01,$65,$21,$01,$50,$00,$00,$21,$01,$5f,$00,$00,$21
byte $01,$41,$00,$00,$21,$01,$58,$00,$00
' ****************************************************
' Replace the following lines with the dumped output
' ****************************************************
version long 2
size long 6923
vocab byte
byte $03,$49,$00,$00,$14,$02,$61,$6d,$00,$00,$53,$01,$68,$75,$6d,$61
byte $6e,$00,$00,$6d,$20,$00,$05,$00,$0b,$00,$2e,$01,$70,$72,$6f,$67
byte $72,$61,$6d,$00,$01,$59,$01,$50,$72,$6f,$70,$00,$02,$0f,$20,$00
byte $1b,$00,$26,$00,$45,$02,$63,$61,$6e,$00,$00,$00,$06,$73,$6c,$65
byte $65,$70,$00,$03,$1d,$20,$00,$35,$00,$3c,$00,$00,$02,$61,$72,$65
byte $00,$03,$26,$21,$00,$4c,$00,$5e,$02,$69,$73,$00,$03,$30,$21,$00
byte $58,$00,$00,$01,$6d,$61,$6d,$6d,$61,$6c,$00,$03,$44,$20,$00,$58
byte $00,$63,$00,$7e,$04,$6c,$69,$76,$69,$6e,$67,$00,$03,$62,$20,$00
byte $58,$00,$74,$01,$05,$20,$00,$35,$00,$3c,$01,$15,$04,$74,$68,$69
byte $6e,$6b,$00,$04,$07,$20,$00,$35,$01,$0c,$01,$25,$01,$62,$65,$69
byte $6e,$67,$00,$31,$53,$22,$00,$58,$00,$74,$01,$1c,$01,$38,$01,$68
byte $75,$6d,$61,$6e,$73,$00,$35,$2f,$21,$01,$2e,$01,$46,$02,$6c,$65
byte $61,$72,$6e,$00,$2f,$4e,$20,$00,$35,$01,$3d,$00,$00,$06,$73,$6f
byte $66,$74,$77,$61,$72,$65,$00,$04,$13,$20,$00,$58,$01,$4d,$01,$6f
byte $01,$61,$70,$70,$6c,$69,$63,$61,$74,$69,$6f,$6e,$00,$04,$1a,$20
byte $00,$58,$01,$60,$02,$02,$01,$70,$72,$6f,$67,$72,$61,$6d,$73,$00
byte $14,$62,$21,$01,$76,$00,$00,$01,$70,$72,$6f,$70,$00,$04,$21,$21
byte $02,$07,$02,$21,$01,$70,$72,$6f,$70,$65,$6c,$6c,$65,$72,$00,$05
byte $7a,$21,$02,$14,$02,$33,$01,$50,$72,$6f,$70,$65,$6c,$6c,$65,$72
byte $00,$06,$6a,$21,$02,$26,$02,$40,$02,$72,$75,$6e,$73,$00,$07,$73
byte $20,$02,$38,$01,$4d,$02,$53,$06,$68,$61,$72,$64,$77,$61,$72,$65
byte $00,$08,$01,$20,$00,$58,$02,$47,$02,$6d,$02,$68,$61,$73,$00,$08
byte $33,$01,$63,$6f,$75,$6e,$74,$65,$72,$73,$00,$08,$45,$20,$02,$5a
byte $02,$61,$02,$7c,$02,$75,$73,$65,$73,$00,$08,$63,$20,$02,$74,$02
byte $61,$03,$0b,$01,$63,$68,$69,$70,$00,$08,$73,$20,$00,$58,$03,$03
byte $00,$00,$04,$64,$6f,$72,$6d,$61,$6e,$74,$00,$35,$74,$22,$00,$58
byte $01,$1c,$03,$12,$00,$00,$21,$00,$05,$03,$2b,$21,$00,$58,$00,$00
byte $21,$00,$05,$03,$35,$21,$00,$4c,$00,$00,$01,$61,$6e,$69,$6d,$61
byte $6c,$00,$09,$39,$20,$00,$58,$03,$3a,$03,$4b,$20,$00,$58,$00,$74
byte $00,$00,$04,$6d,$65,$74,$61,$62,$6f,$6c,$69,$7a,$69,$6e,$67,$00
byte $2b,$5e,$20,$00,$58,$03,$52,$03,$76,$04,$62,$72,$65,$61,$74,$68
byte $69,$6e,$67,$00,$30,$2e,$20,$00,$58,$03,$69,$00,$00,$04,$72,$65
byte $61,$73,$6f,$6e,$00,$2b,$52,$20,$00,$58,$03,$7d,$04,$0e,$21,$03
byte $7d,$00,$00,$20,$00,$58,$00,$1b,$00,$00,$20,$00,$58,$00,$1b,$00
byte $00,$21,$02,$14,$04,$26,$21,$02,$26,$04,$2b,$21,$00,$26,$04,$37
byte $01,$68,$75,$62,$00,$09,$40,$20,$02,$5a,$04,$30,$04,$48,$06,$6d
byte $65,$6d,$6f,$72,$79,$00,$09,$52,$20,$02,$5a,$04,$3e,$04,$62,$01
byte $6d,$69,$63,$72,$6f,$63,$6f,$6e,$74,$72,$6f,$6c,$6c,$65,$72,$00
byte $09,$79,$20,$00,$58,$04,$4f,$04,$71,$06,$50,$41,$53,$4d,$00,$0a
byte $0c,$20,$02,$38,$04,$69,$05,$07,$01,$69,$6e,$74,$65,$72,$70,$72
byte $65,$74,$65,$72,$00,$0a,$57,$20,$02,$5a,$04,$78,$05,$15,$06,$49
byte $2f,$4f,$00,$0b,$1a,$20,$02,$5a,$05,$0e,$05,$1c,$20,$00,$35,$00
byte $3c,$05,$2b,$04,$66,$61,$73,$74,$00,$00,$00,$22,$00,$58,$05,$23
byte $03,$03,$05,$45,$04,$65,$69,$67,$68,$74,$00,$2e,$12,$01,$63,$6f
byte $67,$73,$00,$0c,$53,$22,$02,$5a,$05,$34,$05,$3d,$05,$71,$02,$69
byte $6e,$74,$65,$72,$70,$72,$65,$74,$73,$00,$00,$00,$06,$53,$70,$69
byte $6e,$00,$0b,$21,$01,$62,$79,$74,$65,$63,$6f,$64,$65,$73,$00,$10
byte $53,$22,$05,$4e,$05,$5c,$05,$64,$00,$00,$21,$02,$07,$05,$7f,$21
byte $02,$26,$06,$04,$21,$00,$26,$06,$09,$20,$02,$38,$05,$23,$06,$10
byte $20,$02,$38,$05,$5c,$06,$17,$20,$02,$5a,$05,$3d,$06,$25,$06,$52
byte $41,$4d,$00,$0c,$58,$20,$02,$5a,$06,$1e,$06,$35,$01,$6c,$6f,$63
byte $6b,$73,$00,$0c,$67,$20,$02,$5a,$06,$2c,$06,$44,$01,$70,$69,$6e
byte $73,$00,$0c,$7a,$20,$02,$5a,$06,$3c,$06,$52,$06,$52,$4f,$4d,$00
byte $0d,$1d,$20,$02,$5a,$06,$4b,$06,$61,$04,$67,$6f,$6f,$64,$00,$2c
byte $0b,$22,$00,$58,$06,$59,$03,$03,$00,$00,$21,$02,$07,$06,$6f,$21
byte $02,$14,$06,$74,$21,$00,$26,$07,$05,$04,$70,$6f,$77,$65,$72,$66
byte $75,$6c,$00,$0d,$2e,$20,$00,$58,$06,$79,$07,$16,$01,$50,$38,$58
byte $33,$32,$41,$00,$0d,$3f,$20,$00,$58,$07,$0c,$07,$1d,$20,$00,$58
byte $05,$23,$07,$3a,$02,$67,$65,$6e,$65,$72,$61,$74,$65,$73,$00,$0d
byte $50,$04,$76,$69,$64,$65,$6f,$00,$0d,$60,$20,$07,$24,$07,$31,$07
byte $4a,$04,$61,$75,$64,$69,$6f,$00,$0e,$03,$20,$07,$24,$07,$41,$07
byte $5e,$04,$76,$65,$72,$73,$61,$74,$69,$6c,$65,$00,$0e,$16,$20,$00
byte $58,$07,$51,$07,$65,$20,$05,$4e,$05,$5c,$00,$00,$02,$72,$75,$6e
byte $00,$0e,$1d,$21,$07,$6c,$00,$00,$04,$73,$74,$75,$66,$66,$00,$0e
byte $2f,$20,$00,$58,$07,$78,$08,$22,$04,$65,$6c,$65,$63,$74,$72,$69
byte $63,$61,$6c,$00,$00,$00,$01,$63,$69,$72,$63,$75,$69,$74,$73,$00
byte $00,$00,$22,$00,$58,$08,$08,$08,$16,$00,$00,$02,$68,$61,$76,$65
byte $00,$0e,$36,$21,$08,$2b,$00,$00,$01,$72,$65,$67,$69,$73,$74,$65
byte $72,$73,$00,$0e,$3b,$20,$00,$4c,$08,$38,$08,$57,$01,$63,$6f,$75
byte $6e,$74,$65,$72,$00,$2b,$65,$21,$08,$4c,$00,$00,$02,$75,$73,$65
byte $00,$0e,$42,$21,$08,$5c,$00,$00,$06,$73,$69,$6c,$69,$63,$6f,$6e
byte $00,$0e,$52,$20,$00,$58,$08,$68,$09,$05,$01,$63,$69,$72,$63,$75
byte $69,$74,$00,$0f,$07,$20,$00,$58,$08,$7a,$09,$0c,$22,$00,$58,$08
byte $08,$08,$7a,$09,$23,$04,$69,$6e,$74,$65,$67,$72,$61,$74,$65,$64
byte $00,$31,$6d,$22,$00,$58,$09,$15,$08,$7a,$09,$32,$01,$49,$43,$00
byte $31,$74,$20,$00,$58,$09,$2c,$00,$00,$20,$00,$58,$00,$74,$00,$00
byte $20,$02,$5a,$06,$1e,$00,$00,$06,$73,$74,$6f,$72,$61,$67,$65,$00
byte $14,$56,$20,$00,$58,$09,$47,$09,$63,$02,$73,$74,$6f,$72,$65,$73
byte $00,$14,$5d,$20,$09,$59,$01,$76,$09,$72,$06,$64,$61,$74,$61,$00
byte $12,$13,$20,$09,$59,$09,$6a,$00,$00,$20,$00,$58,$03,$03,$00,$00
byte $06,$61,$73,$73,$65,$6d,$62,$6c,$79,$00,$14,$6e,$20,$00,$58,$0a
byte $00,$0a,$1f,$01,$6c,$61,$6e,$67,$75,$61,$67,$65,$00,$10,$3d,$20
byte $00,$58,$0a,$13,$0a,$33,$04,$61,$73,$73,$65,$6d,$62,$6c,$65,$64
byte $00,$14,$75,$20,$00,$58,$0a,$26,$0a,$3a,$20,$00,$58,$05,$23,$0a
byte $41,$22,$00,$58,$0a,$00,$0a,$13,$0a,$52,$06,$70,$61,$73,$6d,$00
byte $31,$5c,$21,$0a,$4a,$00,$00,$20,$00,$58,$00,$1b,$0a,$7a,$02,$65
byte $78,$65,$63,$75,$74,$65,$73,$00,$00,$00,$01,$69,$6e,$73,$74,$72
byte $75,$63,$74,$69,$6f,$6e,$73,$00,$14,$7c,$20,$0a,$5e,$0a,$6a,$0b
byte $0c,$01,$6f,$70,$63,$6f,$64,$65,$73,$00,$15,$17,$20,$0a,$5e,$0b
byte $01,$0b,$13,$20,$00,$58,$01,$4d,$00,$00,$20,$02,$74,$06,$3c,$00
byte $00,$20,$00,$58,$0a,$13,$0b,$33,$01,$6f,$62,$6a,$65,$63,$74,$73
byte $00,$00,$00,$20,$02,$5a,$0b,$28,$0b,$3a,$20,$02,$74,$05,$64,$0b
byte $4d,$04,$63,$6f,$6d,$70,$69,$6c,$65,$64,$00,$11,$02,$20,$00,$58
byte $0b,$41,$0b,$5d,$01,$73,$74,$61,$63,$6b,$00,$11,$09,$20,$02,$74
byte $0b,$54,$0b,$6f,$04,$63,$6f,$6d,$70,$61,$63,$74,$00,$11,$2f,$20
byte $00,$58,$0b,$64,$0c,$01,$01,$6d,$65,$74,$68,$6f,$64,$73,$00,$11
byte $40,$20,$02,$74,$0b,$76,$0c,$08,$20,$02,$5a,$0b,$76,$0c,$1c,$01
byte $76,$61,$72,$69,$61,$62,$6c,$65,$73,$00,$11,$4e,$20,$02,$5a,$0c
byte $0f,$0c,$23,$20,$02,$5a,$09,$6a,$0c,$32,$06,$73,$70,$69,$6e,$00
byte $12,$1a,$21,$0c,$2a,$0c,$43,$01,$63,$6f,$6d,$70,$75,$74,$65,$72
byte $00,$12,$55,$22,$00,$58,$0c,$37,$0a,$13,$00,$00,$01,$63,$6f,$67
byte $00,$15,$2b,$21,$0c,$4c,$00,$00,$20,$00,$58,$04,$3e,$00,$00,$01
byte $6c,$6f,$63,$6b,$00,$15,$4d,$21,$0c,$5f,$00,$00,$01,$63,$6f,$6e
byte $6e,$65,$63,$74,$6f,$72,$73,$00,$00,$00,$20,$00,$4c,$0c,$6c,$0d
byte $0a,$01,$70,$6c,$75,$67,$73,$00,$2c,$58,$20,$00,$4c,$0d,$01,$0d
byte $18,$01,$70,$69,$6e,$00,$35,$5c,$21,$0d,$11,$00,$00,$20,$00,$58
byte $04,$3e,$00,$00,$04,$73,$74,$72,$6f,$6e,$67,$00,$00,$00,$20,$00
byte $58,$0d,$24,$00,$00,$01,$70,$38,$78,$33,$32,$61,$00,$10,$02,$21
byte $0d,$35,$00,$00,$02,$67,$65,$6e,$65,$72,$61,$74,$65,$00,$10,$0e
byte $21,$0d,$44,$00,$00,$04,$76,$69,$73,$69,$62,$6c,$65,$00,$21,$51
byte $20,$00,$58,$0d,$55,$0d,$71,$01,$73,$69,$67,$6e,$61,$6c,$00,$00
byte $00,$22,$00,$58,$08,$08,$0d,$67,$00,$00,$06,$73,$6f,$75,$6e,$64
byte $00,$10,$13,$20,$00,$58,$0d,$7a,$00,$00,$04,$66,$6c,$65,$78,$69
byte $62,$6c,$65,$00,$10,$2c,$20,$00,$58,$0e,$0a,$00,$00,$21,$02,$38
byte $00,$00,$04,$73,$6f,$6d,$65,$74,$68,$69,$6e,$67,$00,$16,$5d,$20
byte $00,$58,$0e,$22,$00,$00,$21,$02,$5a,$00,$00,$20,$00,$4c,$04,$3e
byte $00,$00,$21,$02,$74,$00,$00,$01,$6d,$69,$6e,$65,$72,$61,$6c,$00
byte $16,$71,$20,$00,$58,$0e,$47,$0e,$64,$01,$65,$6c,$65,$6d,$65,$6e
byte $74,$00,$00,$00,$20,$00,$58,$0e,$59,$0e,$76,$06,$53,$69,$6c,$69
byte $63,$6f,$6e,$00,$2c,$06,$21,$0e,$6b,$00,$00,$04,$65,$6c,$65,$63
byte $74,$72,$69,$63,$00,$17,$42,$20,$00,$58,$0e,$7b,$00,$00,$07,$61
byte $00,$00,$00,$03,$79,$6f,$75,$00,$0f,$24,$06,$4c,$65,$72,$6e,$65
byte $72,$00,$0f,$30,$20,$00,$4c,$0f,$1a,$0f,$2b,$21,$0f,$1a,$00,$00
byte $20,$00,$58,$00,$1b,$0f,$37,$21,$0f,$13,$0f,$3c,$20,$00,$58,$01
byte $60,$0f,$43,$20,$00,$58,$02,$26,$0f,$4a,$20,$00,$58,$07,$0c,$0f
byte $51,$22,$00,$58,$0c,$37,$00,$1b,$0f,$5a,$20,$00,$35,$01,$3d,$0f
byte $79,$04,$61,$72,$74,$69,$66,$69,$63,$69,$61,$6c,$00,$00,$00,$01
byte $65,$6e,$74,$69,$74,$79,$00,$00,$00,$22,$00,$58,$0f,$61,$0f,$6f
byte $00,$00,$20,$00,$58,$02,$14,$10,$09,$21,$07,$0c,$00,$00,$21,$07
byte $24,$00,$00,$20,$00,$58,$07,$41,$10,$25,$04,$61,$75,$64,$69,$62
byte $6c,$65,$00,$2c,$76,$20,$00,$58,$10,$1a,$00,$00,$20,$00,$58,$07
byte $51,$00,$00,$06,$73,$79,$6e,$74,$61,$78,$00,$16,$00,$20,$02,$5a
byte $10,$33,$00,$00,$04,$69,$6e,$74,$65,$72,$70,$72,$65,$74,$65,$64
byte $00,$00,$00,$20,$00,$4c,$10,$44,$10,$5a,$20,$00,$4c,$0b,$64,$10
byte $69,$06,$63,$6f,$64,$65,$00,$16,$1b,$20,$00,$4c,$10,$61,$10,$79
byte $01,$63,$6f,$64,$65,$73,$00,$00,$00,$22,$00,$4c,$0b,$64,$10,$70
byte $00,$00,$20,$00,$58,$0a,$26,$00,$00,$20,$00,$58,$09,$47,$11,$10
byte $20,$00,$58,$04,$3e,$11,$1f,$01,$46,$49,$46,$4f,$00,$2b,$71,$20
byte $00,$58,$11,$17,$00,$00,$04,$73,$6d,$61,$6c,$6c,$00,$16,$2c,$20
byte $00,$58,$11,$26,$00,$00,$01,$6d,$65,$74,$68,$6f,$64,$00,$16,$3e
byte $21,$11,$36,$00,$00,$02,$73,$74,$6f,$72,$65,$00,$16,$4a,$20,$11
byte $45,$09,$6a,$11,$6a,$04,$73,$79,$6d,$62,$6f,$6c,$69,$63,$00,$00
byte $00,$01,$6e,$61,$6d,$65,$73,$00,$31,$11,$22,$00,$4c,$11,$55,$11
byte $61,$11,$7f,$01,$76,$61,$72,$69,$61,$62,$6c,$65,$00,$35,$2a,$21
byte $11,$73,$00,$00,$06,$69,$6e,$66,$6f,$72,$6d,$61,$74,$69,$6f,$6e
byte $00,$2c,$12,$20,$00,$58,$12,$04,$00,$00,$21,$05,$5c,$00,$00,$02
byte $65,$71,$75,$61,$6c,$73,$00,$12,$32,$02,$65,$71,$75,$61,$6c,$00
byte $12,$37,$21,$12,$29,$00,$00,$21,$12,$1f,$00,$00,$08,$77,$68,$6f
byte $00,$12,$4b,$08,$77,$68,$61,$74,$00,$12,$50,$21,$12,$43,$00,$00
byte $21,$12,$3c,$00,$00,$20,$02,$38,$00,$1b,$12,$5c,$20,$00,$58,$02
byte $47,$12,$6d,$01,$64,$65,$76,$69,$63,$65,$00,$00,$00,$22,$00,$58
byte $08,$08,$12,$63,$12,$76,$20,$02,$38,$01,$76,$12,$7d,$20,$02,$38
byte $01,$4d,$00,$00,$02,$64,$6f,$65,$73,$00,$13,$12,$02,$64,$6f,$00
byte $13,$17,$21,$13,$0c,$00,$00,$21,$13,$04,$00,$00,$06,$50,$61,$72
byte $61,$6c,$6c,$61,$78,$00,$13,$33,$01,$63,$6f,$6d,$70,$61,$6e,$79
byte $00,$13,$66,$20,$00,$58,$13,$28,$13,$43,$02,$6d,$61,$6b,$65,$73
byte $00,$13,$75,$20,$13,$3a,$02,$07,$13,$53,$02,$73,$65,$6c,$6c,$73
byte $00,$14,$1f,$20,$13,$4a,$02,$26,$00,$00,$01,$62,$75,$73,$69,$6e
byte $65,$73,$73,$00,$00,$00,$20,$00,$58,$13,$5a,$00,$00,$02,$6d,$61
byte $6b,$65,$00,$14,$24,$21,$13,$6d,$14,$03,$02,$62,$75,$69,$6c,$64
byte $00,$14,$33,$21,$13,$7a,$14,$12,$02,$62,$75,$69,$6c,$64,$73,$00
byte $14,$42,$21,$14,$08,$00,$00,$02,$73,$65,$6c,$6c,$00,$14,$51,$21
byte $14,$17,$00,$00,$21,$13,$3a,$14,$29,$21,$13,$7a,$14,$2e,$21,$14
byte $08,$00,$00,$21,$14,$08,$14,$38,$21,$13,$6d,$14,$3d,$21,$13,$3a
byte $00,$00,$21,$13,$7a,$14,$47,$21,$13,$6d,$14,$4c,$21,$13,$3a,$00
byte $00,$21,$13,$4a,$00,$00,$20,$00,$58,$04,$3e,$00,$00,$21,$11,$45
byte $00,$00,$20,$00,$4c,$0a,$6a,$14,$69,$21,$00,$1b,$00,$00,$20,$00
byte $58,$0a,$13,$00,$00,$20,$00,$58,$0b,$41,$00,$00,$20,$00,$4c,$10
byte $61,$15,$12,$01,$69,$6e,$73,$74,$72,$75,$63,$74,$69,$6f,$6e,$00
byte $33,$1f,$21,$15,$03,$00,$00,$20,$00,$4c,$0a,$6a,$00,$00,$01,$70
byte $72,$6f,$63,$65,$73,$73,$6f,$72,$00,$16,$56,$20,$00,$58,$15,$1e
byte $15,$3a,$01,$63,$6f,$72,$65,$00,$00,$00,$20,$00,$58,$15,$32,$15
byte $41,$20,$00,$35,$00,$3c,$15,$48,$21,$05,$3d,$00,$00,$21,$06,$2c
byte $15,$5f,$01,$73,$65,$6d,$61,$70,$68,$6f,$72,$65,$00,$00,$00,$20
byte $00,$58,$15,$52,$15,$70,$04,$61,$74,$6f,$6d,$69,$63,$00,$00,$00
byte $20,$00,$58,$15,$66,$00,$00,$01,$72,$75,$6c,$65,$73,$00,$00,$00
byte $20,$02,$5a,$15,$77,$16,$14,$04,$73,$74,$72,$75,$63,$74,$75,$72
byte $65,$00,$17,$59,$20,$02,$5a,$16,$07,$00,$00,$20,$00,$58,$0a,$6a
byte $00,$00,$04,$6c,$69,$74,$74,$6c,$65,$00,$2e,$0b,$20,$00,$58,$16
byte $22,$00,$00,$01,$72,$6f,$75,$74,$69,$6e,$65,$00,$17,$60,$20,$00
byte $58,$16,$33,$16,$45,$21,$0b,$76,$00,$00,$21,$09,$59,$00,$00,$01
byte $43,$50,$55,$00,$1a,$77,$20,$00,$58,$16,$4f,$00,$00,$20,$00,$58
byte $07,$78,$00,$00,$01,$73,$75,$62,$73,$74,$61,$6e,$63,$65,$00,$2c
byte $34,$20,$00,$58,$16,$64,$17,$04,$01,$63,$68,$65,$6d,$69,$63,$61
byte $6c,$00,$2c,$3b,$20,$00,$58,$16,$78,$17,$14,$04,$73,$6f,$6c,$69
byte $64,$00,$2c,$42,$20,$00,$58,$17,$0b,$17,$1b,$22,$00,$58,$16,$78
byte $16,$64,$17,$24,$22,$00,$58,$17,$0b,$16,$64,$17,$2d,$22,$00,$58
byte $17,$0b,$16,$78,$00,$00,$04,$73,$68,$6f,$63,$6b,$69,$6e,$67,$00
byte $2b,$6a,$20,$00,$58,$17,$36,$00,$00,$04,$6f,$72,$67,$61,$6e,$69
byte $7a,$61,$74,$69,$6f,$6e,$00,$2c,$5f,$20,$00,$58,$17,$49,$00,$00
byte $20,$00,$58,$00,$1b,$17,$67,$22,$00,$58,$11,$26,$00,$1b,$00,$00
byte $06,$53,$75,$6e,$64,$61,$79,$00,$18,$01,$01,$64,$61,$79,$00,$18
byte $20,$20,$00,$58,$17,$7a,$00,$00,$04,$74,$77,$65,$6e,$74,$79,$2d
byte $66,$6f,$75,$72,$00,$32,$5f,$01,$68,$6f,$75,$72,$73,$00,$00,$00
byte $22,$00,$58,$18,$08,$18,$17,$18,$31,$01,$64,$61,$79,$73,$00,$2d
byte $3d,$21,$18,$29,$00,$00,$06,$4d,$6f,$6e,$64,$61,$79,$00,$18,$40
byte $20,$00,$58,$17,$7a,$00,$00,$06,$54,$75,$65,$73,$64,$61,$79,$00
byte $18,$52,$20,$00,$58,$17,$7a,$00,$00,$06,$57,$65,$64,$6e,$65,$73
byte $64,$61,$79,$00,$18,$66,$20,$00,$58,$17,$7a,$00,$00,$06,$54,$68
byte $75,$72,$73,$64,$61,$79,$00,$18,$79,$20,$00,$58,$17,$7a,$00,$00
byte $06,$46,$72,$69,$64,$61,$79,$00,$19,$0a,$20,$00,$58,$17,$7a,$00
byte $00,$06,$53,$61,$74,$75,$72,$64,$61,$79,$00,$19,$1d,$20,$00,$58
byte $17,$7a,$00,$00,$06,$4a,$61,$6e,$75,$61,$72,$79,$00,$19,$38,$01
byte $6d,$6f,$6e,$74,$68,$00,$19,$49,$20,$00,$58,$19,$2f,$00,$00,$01
byte $6d,$6f,$6e,$74,$68,$73,$00,$2e,$4f,$21,$19,$3f,$00,$00,$06,$4d
byte $61,$72,$63,$68,$00,$19,$57,$20,$00,$58,$19,$2f,$00,$00,$06,$41
byte $70,$72,$69,$6c,$00,$19,$67,$20,$00,$58,$19,$2f,$00,$00,$06,$4d
byte $61,$79,$00,$19,$75,$20,$00,$58,$19,$2f,$00,$00,$06,$4a,$75,$6e
byte $65,$00,$1a,$04,$20,$00,$58,$19,$2f,$00,$00,$06,$4a,$75,$6c,$79
byte $00,$1a,$13,$20,$00,$58,$19,$2f,$00,$00,$06,$41,$75,$67,$75,$73
byte $74,$00,$1a,$24,$20,$00,$58,$19,$2f,$00,$00,$06,$53,$65,$70,$74
byte $65,$6d,$62,$65,$72,$00,$1a,$38,$20,$00,$58,$19,$2f,$00,$00,$06
byte $4f,$63,$74,$6f,$62,$65,$72,$00,$1a,$4a,$20,$00,$58,$19,$2f,$00
byte $00,$06,$4e,$6f,$76,$65,$6d,$62,$65,$72,$00,$1a,$5d,$20,$00,$58
byte $19,$2f,$00,$00,$06,$44,$65,$63,$65,$6d,$62,$65,$72,$00,$1a,$70
byte $20,$00,$58,$19,$2f,$00,$00,$20,$00,$58,$15,$1e,$00,$00,$06,$46
byte $65,$62,$72,$75,$61,$72,$79,$00,$1b,$0a,$20,$00,$58,$19,$2f,$00
byte $00,$06,$57,$69,$6e,$74,$65,$72,$00,$1b,$25,$01,$73,$65,$61,$73
byte $6f,$6e,$00,$1b,$56,$20,$00,$58,$1b,$1b,$1b,$34,$04,$63,$6f,$6c
byte $64,$00,$1c,$0d,$20,$00,$58,$1b,$2c,$1b,$3b,$22,$00,$58,$1b,$2c
byte $1b,$1b,$00,$00,$01,$74,$69,$6d,$65,$00,$00,$00,$01,$70,$65,$72
byte $69,$6f,$64,$00,$00,$00,$22,$00,$58,$1b,$44,$1b,$4c,$1b,$75,$04
byte $6f,$6e,$65,$2d,$66,$6f,$75,$72,$74,$68,$00,$33,$24,$01,$79,$65
byte $61,$72,$00,$2e,$23,$22,$00,$58,$1b,$5f,$1b,$6d,$00,$00,$01,$74
byte $65,$6d,$70,$65,$72,$61,$74,$75,$72,$65,$00,$00,$00,$20,$00,$58
byte $1b,$7e,$00,$00,$06,$53,$75,$6d,$6d,$65,$72,$00,$1c,$1e,$20,$00
byte $58,$1b,$1b,$1c,$2c,$04,$68,$6f,$74,$00,$1c,$3c,$20,$00,$58,$1c
byte $25,$1c,$33,$22,$00,$58,$1c,$25,$1b,$1b,$00,$00,$20,$00,$58,$1b
byte $7e,$00,$00,$06,$53,$70,$72,$69,$6e,$67,$00,$1c,$4d,$20,$00,$58
byte $1b,$1b,$1c,$5c,$04,$6e,$69,$63,$65,$00,$1c,$63,$20,$00,$58,$1c
byte $54,$00,$00,$20,$00,$58,$06,$59,$1c,$76,$04,$70,$6c,$65,$61,$73
byte $69,$6e,$67,$00,$2c,$66,$20,$00,$58,$1c,$6a,$00,$00,$06,$41,$75
byte $74,$75,$6d,$6e,$00,$1d,$07,$20,$00,$58,$1b,$1b,$1d,$0e,$20,$00
byte $58,$1c,$54,$00,$00,$01,$63,$61,$74,$00,$1d,$1c,$20,$00,$58,$00
byte $63,$1d,$23,$20,$00,$58,$03,$3a,$1d,$3a,$02,$73,$61,$79,$73,$00
byte $00,$00,$04,$6d,$65,$6f,$77,$00,$1d,$5f,$20,$1d,$2a,$1d,$32,$1d
byte $41,$20,$00,$35,$00,$3c,$1d,$48,$22,$00,$58,$11,$26,$00,$63,$1d
byte $58,$01,$70,$65,$74,$00,$32,$26,$20,$00,$58,$1d,$51,$00,$00,$20
byte $00,$58,$0d,$7a,$00,$00,$07,$61,$6e,$00,$00,$00,$01,$64,$6f,$67
byte $00,$1d,$73,$20,$00,$58,$03,$3a,$1d,$7a,$20,$00,$58,$00,$63,$1e
byte $09,$04,$77,$6f,$6f,$66,$00,$1e,$31,$20,$1d,$2a,$1e,$01,$1e,$10
byte $20,$00,$35,$00,$3c,$1e,$17,$20,$00,$58,$1d,$51,$1e,$28,$01,$74
byte $72,$69,$63,$6b,$73,$00,$00,$00,$22,$00,$35,$01,$3d,$1e,$1e,$00
byte $00,$20,$00,$58,$0d,$7a,$00,$00,$01,$70,$6c,$61,$6e,$74,$00,$1e
byte $41,$20,$00,$58,$00,$74,$1e,$51,$04,$67,$72,$65,$65,$6e,$00,$1e
byte $61,$20,$00,$58,$1e,$48,$00,$00,$01,$63,$6f,$6c,$6f,$72,$00,$1e
byte $71,$20,$00,$58,$1e,$58,$00,$00,$04,$6c,$69,$67,$68,$74,$00,$21
byte $09,$20,$00,$58,$1e,$68,$1e,$78,$22,$00,$58,$0d,$55,$1e,$68,$00
byte $00,$01,$74,$72,$65,$65,$00,$1f,$09,$20,$00,$58,$1e,$38,$1f,$1a
byte $01,$6c,$65,$61,$76,$65,$73,$00,$00,$00,$20,$02,$5a,$1f,$10,$1f
byte $2a,$01,$72,$6f,$6f,$74,$73,$00,$00,$00,$20,$02,$5a,$1f,$21,$00
byte $00,$07,$74,$68,$65,$00,$00,$00,$01,$73,$6b,$79,$00,$1f,$47,$04
byte $62,$6c,$75,$65,$00,$1f,$5f,$20,$00,$58,$1f,$3f,$1f,$58,$04,$63
byte $6c,$6f,$75,$64,$73,$00,$1f,$6f,$20,$02,$5a,$1f,$4e,$00,$00,$20
byte $00,$58,$1e,$58,$00,$00,$04,$77,$68,$69,$74,$65,$00,$20,$47,$20
byte $00,$4c,$1f,$66,$1f,$7d,$04,$77,$65,$74,$00,$20,$7d,$20,$00,$4c
byte $1f,$76,$20,$0d,$01,$63,$6c,$6f,$75,$64,$00,$21,$04,$21,$20,$04
byte $20,$26,$02,$63,$6f,$6e,$74,$61,$69,$6e,$00,$00,$00,$04,$77,$61
byte $74,$65,$72,$00,$25,$33,$20,$20,$12,$20,$1d,$20,$40,$02,$70,$72
byte $6f,$64,$75,$63,$65,$00,$00,$00,$06,$72,$61,$69,$6e,$00,$30,$03
byte $20,$20,$2d,$20,$38,$00,$00,$20,$00,$58,$1e,$58,$20,$6b,$02,$63
byte $6f,$6e,$74,$61,$69,$6e,$73,$00,$00,$00,$04,$61,$6c,$6c,$00,$00
byte $00,$01,$63,$6f,$6c,$6f,$72,$73,$00,$00,$00,$22,$20,$4e,$20,$5a
byte $20,$61,$00,$00,$04,$6d,$6f,$69,$73,$74,$00,$2d,$04,$20,$00,$58
byte $20,$74,$00,$00,$21,$1f,$4e,$00,$00,$20,$00,$58,$0d,$55,$21,$1d
byte $06,$72,$61,$64,$69,$61,$74,$69,$6f,$6e,$00,$00,$00,$20,$00,$58
byte $21,$10,$21,$24,$22,$00,$58,$0d,$55,$21,$10,$21,$40,$04,$65,$6c
byte $65,$63,$74,$72,$6f,$6d,$61,$67,$6e,$65,$74,$69,$63,$00,$00,$00
byte $22,$00,$58,$21,$2d,$21,$10,$00,$00,$04,$73,$65,$65,$6e,$00,$2b
byte $2b,$20,$00,$58,$21,$49,$00,$00,$01,$63,$6f,$77,$00,$21,$5f,$20
byte $00,$58,$00,$63,$21,$6d,$04,$6d,$6f,$6f,$00,$22,$41,$20,$1d,$2a
byte $21,$66,$21,$74,$20,$00,$35,$00,$3c,$22,$0c,$02,$65,$61,$74,$73
byte $00,$22,$4f,$04,$67,$72,$61,$73,$73,$00,$22,$54,$20,$21,$7b,$22
byte $03,$22,$1a,$04,$62,$69,$67,$00,$27,$27,$22,$00,$58,$22,$13,$00
byte $63,$22,$2b,$01,$66,$61,$72,$6d,$00,$32,$3f,$22,$00,$58,$22,$23
byte $03,$3a,$22,$3c,$01,$63,$6f,$77,$73,$00,$33,$03,$21,$22,$34,$00
byte $00,$20,$00,$58,$0d,$7a,$00,$00,$02,$65,$61,$74,$00,$22,$6b,$21
byte $22,$48,$00,$00,$20,$00,$58,$1e,$48,$22,$5b,$20,$00,$58,$1e,$38
byte $22,$62,$22,$00,$58,$1e,$48,$1e,$38,$00,$00,$21,$21,$7b,$00,$00
byte $06,$4d,$65,$72,$63,$75,$72,$79,$00,$23,$05,$01,$70,$6c,$61,$6e
byte $65,$74,$00,$23,$25,$20,$00,$58,$22,$7b,$23,$0c,$20,$00,$58,$1c
byte $25,$23,$13,$22,$00,$58,$1c,$25,$22,$7b,$00,$00,$01,$77,$6f,$72
byte $6c,$64,$00,$23,$7c,$20,$00,$58,$23,$1c,$23,$36,$01,$73,$70,$68
byte $65,$72,$65,$00,$24,$0c,$20,$00,$58,$23,$2c,$23,$3d,$22,$00,$58
byte $22,$13,$23,$2c,$23,$5b,$04,$63,$65,$6c,$65,$73,$74,$69,$61,$6c
byte $00,$00,$00,$01,$62,$6f,$64,$79,$00,$00,$00,$22,$00,$58,$23,$46
byte $23,$53,$23,$75,$02,$6f,$72,$62,$69,$74,$73,$00,$00,$00,$01,$73
byte $75,$6e,$00,$35,$39,$20,$23,$64,$23,$6e,$00,$00,$20,$00,$58,$22
byte $7b,$00,$00,$04,$72,$6f,$75,$6e,$64,$00,$24,$32,$20,$00,$58,$24
byte $03,$24,$1d,$01,$6f,$62,$6a,$65,$63,$74,$00,$29,$4e,$22,$00,$58
byte $24,$03,$24,$13,$00,$00,$04,$63,$69,$72,$63,$75,$6c,$61,$72,$00
byte $2b,$24,$20,$00,$58,$24,$26,$00,$00,$06,$4d,$61,$72,$73,$00,$24
byte $41,$20,$00,$58,$22,$7b,$24,$4f,$04,$72,$65,$64,$00,$24,$66,$20
byte $00,$58,$24,$48,$24,$56,$20,$00,$58,$1b,$2c,$24,$5d,$22,$00,$58
byte $24,$48,$22,$7b,$00,$00,$20,$00,$58,$1e,$58,$00,$00,$06,$45,$61
byte $72,$74,$68,$00,$24,$76,$20,$00,$58,$22,$7b,$24,$7d,$20,$02,$5a
byte $20,$1d,$25,$0e,$01,$6f,$63,$65,$61,$6e,$73,$00,$26,$04,$20,$02
byte $5a,$25,$04,$25,$1d,$06,$6c,$61,$6e,$64,$00,$26,$21,$20,$02,$5a
byte $25,$15,$25,$24,$20,$00,$58,$23,$1c,$00,$00,$04,$73,$6f,$66,$74
byte $00,$00,$00,$20,$00,$58,$25,$2b,$25,$3a,$20,$00,$58,$1f,$76,$25
byte $4b,$01,$6c,$69,$71,$75,$69,$64,$00,$2e,$04,$20,$00,$58,$25,$41
byte $25,$59,$06,$48,$32,$4f,$00,$30,$35,$20,$00,$58,$25,$52,$25,$6c
byte $06,$68,$79,$64,$72,$6f,$67,$65,$6e,$00,$30,$3c,$20,$20,$4e,$25
byte $60,$25,$7d,$06,$6f,$78,$79,$67,$65,$6e,$00,$30,$43,$20,$20,$4e
byte $25,$73,$00,$00,$20,$08,$2b,$20,$1d,$26,$14,$01,$6f,$63,$65,$61
byte $6e,$00,$26,$36,$21,$26,$0b,$00,$00,$04,$68,$61,$72,$64,$00,$26
byte $4b,$20,$00,$58,$26,$19,$26,$2f,$04,$64,$72,$79,$00,$00,$00,$20
byte $00,$58,$26,$28,$00,$00,$20,$00,$58,$1f,$76,$26,$3d,$21,$25,$04
byte $00,$00,$04,$72,$69,$67,$69,$64,$00,$26,$60,$20,$00,$58,$26,$42
byte $00,$00,$04,$69,$6e,$66,$6c,$65,$78,$69,$62,$6c,$65,$00,$2b,$32
byte $20,$00,$58,$26,$52,$00,$00,$06,$56,$65,$6e,$75,$73,$00,$26,$70
byte $20,$00,$58,$22,$7b,$26,$77,$20,$00,$58,$1c,$25,$00,$00,$06,$4a
byte $75,$70,$69,$74,$65,$72,$00,$27,$09,$20,$00,$58,$22,$7b,$27,$10
byte $20,$00,$58,$1b,$2c,$27,$17,$20,$00,$58,$22,$13,$00,$00,$04,$6c
byte $61,$72,$67,$65,$00,$27,$2e,$20,$00,$58,$27,$1e,$00,$00,$20,$00
byte $58,$22,$13,$00,$00,$06,$53,$61,$74,$75,$72,$6e,$00,$27,$3f,$20
byte $00,$58,$22,$7b,$27,$46,$20,$00,$58,$1b,$2c,$27,$63,$04,$62,$65
byte $61,$75,$74,$69,$66,$75,$6c,$00,$00,$00,$01,$72,$69,$6e,$67,$73
byte $00,$2f,$61,$22,$02,$5a,$27,$4d,$27,$5a,$00,$00,$06,$4e,$65,$70
byte $74,$75,$6e,$65,$00,$27,$77,$20,$00,$58,$22,$7b,$27,$7e,$20,$00
byte $58,$1b,$2c,$00,$00,$06,$55,$72,$61,$6e,$75,$73,$00,$28,$0f,$20
byte $00,$58,$22,$7b,$28,$16,$20,$00,$58,$1b,$2c,$00,$00,$06,$50,$6c
byte $75,$74,$6f,$00,$28,$2d,$02,$77,$61,$73,$00,$00,$00,$20,$28,$26
byte $22,$7b,$28,$34,$20,$00,$58,$1b,$2c,$28,$44,$04,$64,$77,$61,$72
byte $66,$00,$00,$00,$22,$00,$58,$28,$3b,$22,$7b,$00,$00,$01,$69,$6e
byte $74,$65,$72,$72,$75,$70,$74,$00,$28,$61,$04,$62,$61,$64,$00,$29
byte $47,$20,$00,$58,$28,$5a,$28,$77,$04,$69,$6e,$65,$66,$66,$69,$63
byte $69,$65,$6e,$74,$00,$00,$00,$20,$00,$58,$28,$68,$29,$09,$02,$64
byte $69,$73,$72,$75,$70,$74,$00,$00,$00,$20,$00,$35,$28,$7e,$29,$1e
byte $04,$64,$69,$73,$72,$75,$70,$74,$69,$76,$65,$00,$00,$00,$20,$00
byte $58,$29,$10,$29,$34,$04,$63,$6f,$6d,$70,$6c,$69,$63,$61,$74,$65
byte $64,$00,$00,$00,$20,$00,$58,$29,$25,$00,$00,$04,$68,$6f,$72,$72
byte $69,$62,$6c,$65,$00,$2d,$0b,$20,$00,$58,$29,$3b,$00,$00,$20,$02
byte $5a,$0b,$76,$00,$00,$06,$45,$6e,$67,$6c,$69,$73,$68,$00,$29,$60
byte $20,$00,$58,$0a,$13,$29,$67,$22,$00,$58,$00,$0b,$0a,$13,$00,$00
byte $01,$6e,$6f,$75,$6e,$00,$00,$00,$02,$73,$61,$79,$00,$00,$00,$01
byte $53,$75,$6e,$00,$2a,$0e,$01,$73,$74,$61,$72,$00,$2a,$30,$20,$00
byte $58,$2a,$06,$2a,$15,$20,$00,$58,$1c,$25,$2a,$27,$04,$6e,$65,$61
byte $72,$65,$73,$74,$00,$30,$72,$22,$00,$58,$2a,$1c,$2a,$06,$00,$00
byte $20,$00,$58,$1c,$25,$2a,$41,$04,$62,$72,$69,$67,$68,$74,$00,$00
byte $00,$20,$00,$58,$2a,$37,$2a,$51,$02,$65,$6d,$69,$74,$73,$00,$00
byte $00,$20,$2a,$48,$1e,$68,$2a,$60,$04,$76,$65,$72,$79,$00,$00,$00
byte $22,$00,$58,$2a,$58,$1c,$25,$2a,$69,$22,$00,$58,$23,$46,$23,$53
byte $00,$00,$01,$73,$79,$6d,$62,$6f,$6c,$73,$00,$2b,$05,$01,$74,$61
byte $67,$73,$00,$2b,$16,$20,$00,$4c,$2a,$7d,$00,$00,$01,$6c,$61,$62
byte $65,$6c,$73,$00,$2b,$1d,$20,$00,$4c,$2b,$0c,$00,$00,$20,$00,$4c
byte $2a,$7d,$00,$00,$20,$00,$58,$24,$03,$00,$00,$20,$00,$58,$0d,$55
byte $00,$00,$20,$00,$58,$26,$19,$00,$00,$02,$6c,$69,$6b,$65,$00,$00
byte $00,$02,$6d,$61,$64,$65,$00,$00,$00,$01,$61,$77,$61,$72,$65,$00
byte $00,$00,$20,$00,$58,$01,$0c,$2b,$59,$21,$01,$0c,$00,$00,$20,$00
byte $58,$00,$74,$00,$00,$21,$02,$61,$00,$00,$20,$00,$58,$08,$08,$00
byte $00,$20,$00,$58,$09,$47,$2b,$78,$20,$00,$58,$04,$3e,$2b,$7f,$20
byte $00,$58,$0b,$54,$00,$00,$21,$08,$68,$00,$00,$20,$00,$58,$1c,$54
byte $00,$00,$20,$00,$58,$09,$6a,$2c,$26,$06,$6b,$6e,$6f,$77,$6c,$65
byte $64,$67,$65,$00,$2c,$2d,$20,$00,$58,$2c,$19,$00,$00,$20,$00,$58
byte $12,$04,$00,$00,$20,$00,$58,$07,$78,$00,$00,$20,$00,$58,$16,$64
byte $00,$00,$20,$00,$58,$26,$42,$2c,$51,$04,$66,$69,$72,$6d,$00,$30
byte $4a,$20,$00,$58,$2c,$49,$00,$00,$20,$00,$4c,$0c,$6c,$00,$00,$20
byte $00,$58,$16,$07,$00,$00,$20,$00,$58,$1c,$54,$00,$00,$04,$68,$65
byte $61,$72,$64,$00,$2c,$7d,$20,$00,$58,$2c,$6d,$00,$00,$20,$00,$58
byte $10,$1a,$00,$00,$20,$00,$58,$1f,$76,$00,$00,$20,$00,$58,$28,$5a
byte $00,$00,$04,$73,$65,$76,$65,$6e,$00,$2d,$25,$01,$6e,$75,$6d,$62
byte $65,$72,$00,$00,$00,$20,$00,$58,$2d,$1b,$00,$00,$01,$77,$65,$65
byte $6b,$00,$2d,$34,$22,$00,$58,$2d,$12,$18,$29,$00,$00,$21,$17,$7a
byte $00,$00,$04,$6f,$6e,$65,$00,$2d,$49,$20,$00,$58,$2d,$1b,$2d,$62
byte $04,$73,$69,$6e,$67,$6c,$65,$00,$00,$00,$01,$69,$74,$65,$6d,$00
byte $2d,$74,$22,$00,$58,$2d,$50,$2d,$5a,$00,$00,$01,$74,$68,$69,$6e
byte $67,$00,$00,$00,$20,$00,$58,$2d,$6b,$00,$00,$04,$66,$6c,$75,$69
byte $64,$00,$00,$00,$20,$00,$58,$2d,$7b,$00,$00,$20,$00,$58,$11,$26
byte $00,$00,$20,$00,$58,$2d,$1b,$00,$00,$04,$74,$77,$65,$6c,$76,$65
byte $00,$2e,$48,$22,$02,$5a,$2e,$19,$19,$3f,$2e,$3f,$04,$66,$6f,$75
byte $72,$00,$2e,$54,$01,$73,$65,$61,$73,$6f,$6e,$73,$00,$00,$00,$22
byte $02,$5a,$2e,$2c,$2e,$34,$00,$00,$20,$00,$58,$2d,$1b,$00,$00,$21
byte $19,$2f,$00,$00,$20,$00,$58,$2d,$1b,$00,$00,$04,$74,$77,$6f,$00
byte $2e,$62,$20,$00,$58,$2d,$1b,$00,$00,$04,$74,$68,$72,$65,$65,$00
byte $2e,$72,$20,$00,$58,$2d,$1b,$00,$00,$04,$66,$69,$76,$65,$00,$2f
byte $01,$20,$00,$58,$2d,$1b,$00,$00,$04,$73,$69,$78,$00,$2f,$0f,$20
byte $00,$58,$2d,$1b,$00,$00,$04,$6e,$69,$6e,$65,$00,$2f,$1e,$20,$00
byte $58,$2d,$1b,$00,$00,$04,$74,$65,$6e,$00,$2f,$2c,$20,$00,$58,$2d
byte $1b,$00,$00,$04,$65,$6c,$65,$76,$65,$6e,$00,$2f,$3d,$20,$00,$58
byte $2d,$1b,$00,$00,$02,$6c,$65,$61,$72,$6e,$73,$00,$35,$34,$21,$2f
byte $44,$00,$00,$01,$73,$74,$72,$75,$63,$74,$75,$72,$65,$73,$00,$00
byte $00,$22,$00,$4c,$24,$26,$2f,$53,$00,$00,$06,$43,$00,$2f,$6f,$22
byte $00,$58,$0c,$37,$0a,$13,$00,$00,$04,$66,$61,$6c,$6c,$69,$6e,$67
byte $00,$30,$18,$22,$00,$58,$2f,$78,$20,$1d,$00,$00,$04,$64,$72,$6f
byte $70,$70,$69,$6e,$67,$00,$30,$51,$20,$00,$58,$30,$0c,$00,$00,$04
byte $72,$65,$73,$70,$69,$72,$61,$74,$69,$6f,$6e,$00,$31,$00,$20,$00
byte $58,$30,$1f,$00,$00,$20,$00,$58,$20,$1d,$00,$00,$20,$00,$58,$0e
byte $59,$00,$00,$20,$00,$58,$0e,$59,$00,$00,$20,$00,$58,$26,$42,$00
byte $00,$20,$00,$58,$2f,$78,$00,$00,$01,$72,$6f,$63,$6b,$00,$30,$60
byte $20,$00,$58,$0e,$47,$00,$00,$04,$63,$6c,$6f,$73,$65,$73,$74,$00
byte $30,$79,$20,$00,$58,$30,$67,$00,$00,$20,$00,$58,$2a,$1c,$00,$00
byte $20,$00,$58,$03,$69,$00,$00,$01,$74,$69,$74,$6c,$65,$73,$00,$36
byte $04,$20,$00,$4c,$31,$07,$00,$00,$01,$68,$6f,$75,$72,$00,$31,$34
byte $04,$73,$69,$78,$74,$79,$00,$31,$3d,$01,$6d,$69,$6e,$75,$74,$65
byte $73,$00,$31,$4e,$22,$00,$58,$31,$20,$31,$29,$00,$00,$20,$00,$58
byte $2d,$1b,$00,$00,$01,$6d,$69,$6e,$75,$74,$65,$00,$31,$7d,$21,$31
byte $44,$00,$00,$22,$00,$58,$00,$74,$0f,$6f,$00,$00,$21,$04,$69,$00
byte $00,$04,$63,$6f,$6d,$62,$69,$6e,$65,$64,$00,$35,$61,$20,$00,$58
byte $31,$61,$00,$00,$22,$00,$58,$09,$15,$08,$7a,$00,$00,$21,$31,$29
byte $32,$0d,$01,$73,$65,$63,$6f,$6e,$64,$73,$00,$00,$00,$22,$02,$5a
byte $31,$20,$32,$02,$00,$00,$04,$64,$6f,$6d,$65,$73,$74,$69,$63,$61
byte $74,$65,$64,$00,$33,$11,$22,$00,$58,$32,$16,$03,$3a,$00,$00,$04
byte $61,$67,$72,$69,$63,$75,$6c,$74,$75,$72,$61,$6c,$00,$00,$00,$22
byte $00,$58,$32,$2f,$13,$5a,$32,$51,$01,$63,$72,$6f,$70,$73,$00,$00
byte $00,$20,$02,$5a,$32,$48,$32,$58,$20,$02,$5a,$22,$34,$00,$00,$20
byte $00,$58,$2d,$1b,$00,$00,$01,$61,$64,$6a,$65,$63,$74,$69,$76,$65
byte $00,$00,$00,$01,$6e,$61,$6d,$65,$00,$00,$00,$01,$76,$65,$72,$62
byte $00,$00,$00,$21,$21,$58,$00,$00,$04,$74,$61,$6d,$65,$64,$00,$33
byte $18,$20,$00,$58,$33,$08,$00,$00,$20,$00,$58,$32,$16,$00,$00,$21
byte $0a,$6a,$00,$00,$20,$00,$58,$2d,$1b,$00,$00,$01,$62,$79,$74,$65
byte $00,$33,$3b,$01,$62,$69,$74,$73,$00,$00,$00,$22,$00,$58,$05,$34
byte $33,$33,$33,$4d,$01,$62,$79,$74,$65,$73,$00,$34,$5c,$21,$33,$44
byte $00,$00,$01,$6e,$79,$62,$62,$6c,$65,$00,$33,$5c,$22,$00,$58,$2e
byte $2c,$33,$33,$00,$00,$01,$77,$6f,$72,$64,$00,$33,$78,$04,$73,$69
byte $78,$74,$65,$65,$6e,$00,$34,$18,$22,$00,$58,$33,$6d,$33,$33,$34
byte $0a,$01,$77,$6f,$72,$64,$73,$00,$34,$57,$21,$34,$01,$34,$0f,$22
byte $00,$58,$2e,$5b,$33,$44,$00,$00,$20,$00,$58,$2d,$1b,$00,$00,$01
byte $6c,$6f,$6e,$67,$00,$34,$35,$04,$74,$68,$69,$72,$74,$79,$2d,$74
byte $77,$6f,$00,$34,$50,$22,$00,$58,$34,$27,$33,$33,$34,$3e,$22,$00
byte $58,$2e,$5b,$34,$01,$34,$47,$22,$00,$58,$2e,$2c,$33,$44,$00,$00
byte $20,$00,$58,$2d,$1b,$00,$00,$21,$33,$65,$00,$00,$21,$33,$2b,$00
byte $00,$01,$62,$69,$74,$00,$34,$7b,$04,$62,$69,$6e,$61,$72,$79,$00
byte $00,$00,$01,$64,$69,$67,$69,$74,$00,$35,$12,$22,$00,$58,$34,$68
byte $34,$72,$00,$00,$02,$72,$65,$70,$72,$65,$73,$65,$6e,$74,$73,$00
byte $00,$00,$20,$35,$04,$2d,$1b,$35,$23,$01,$73,$79,$6d,$62,$6f,$6c
byte $00,$00,$00,$20,$00,$58,$35,$19,$00,$00,$21,$0c,$0f,$00,$00,$21
byte $00,$0b,$00,$00,$21,$01,$3d,$00,$00,$20,$00,$58,$2a,$06,$00,$00
byte $01,$6d,$6f,$6f,$6e,$00,$35,$48,$20,$23,$64,$22,$7b,$00,$00,$04
byte $69,$6e,$74,$65,$72,$70,$72,$65,$74,$00,$00,$00,$21,$06,$3c,$00
byte $00,$20,$00,$58,$09,$15,$00,$00,$04,$73,$6c,$65,$65,$70,$69,$6e
byte $67,$00,$35,$7b,$20,$00,$58,$35,$68,$00,$00,$22,$00,$58,$01,$1c
byte $03,$12,$00,$00,$20,$00,$4c,$11,$61,$00,$00
byte 0[3077]
VAR
long Memory[MEMORY_MASK + 1]
PUB start(argc, argv)
c.start
main(argc, argv)
spinix.exit(0)
' Generate a random number
PUB rand
return (?seed) & $7fffffff
' Check if a key has been pressed
PUB kbhit
return ser.kbhit
' Return the system tick count
PUB GetTicks
return cnt
' Convert ASCII character to upper case
PUB toupper(val)
if (val => "a" and val =< "z")
val -= "a" - "A"
return val
' Find the next character that does not match val
PUB SkipChar(str, val)
repeat while (byte[str])
if (byte[str] <> val)
quit
str++
return str
' Find the next character that matches val
PUB FindChar(str, val)
repeat while (byte[str])
if (byte[str] == val)
quit
str++
return str
' Convert the space-delimited string to a list of tokens
PUB tokenize(str, tokens) | ptr, num, len, val
num := 0
len := strsize(str)
val := byte[str][len - 1]
if (len == 0)
return 0
if (val < "A" or(val > "Z" and val < "a") or val > "z")
byte[str][len + 1] := 0
byte[str][len] := byte[str][len - 1]
byte[str][len - 1] := " "
repeat while (byte[str])
str := SkipChar(str, " ")
if (byte[str] == 0)
quit
long[tokens][num++] := str
ptr := FindChar(str, " ")
if (byte[ptr])
byte[ptr++] := 0
str := ptr
return num
' Find the word "str" in the vocab table
PUB FindWord(str) | ptr
ptr := @vocab
repeat while (ptr < @vocab + size)
if ((byte[ptr] & TYPE_MASK) == TYPE_RELATED)
ptr += 7
elseif ((byte[ptr] & TYPE_MASK) == TYPE_RELATE2)
ptr += 9
elseif ((byte[ptr] & TYPE_MASK) == TYPE_EQUATE)
ptr += 5
else
if ((byte[ptr] & DELETE_MASK) == 0)
if (c.strcmp(str, ptr + 1) == 0)
return ptr
ptr += strsize(ptr) + 3
return 0
' Reset the vocab table
PUB ResetVocab | buf[25]
c.printf0(string("< Ary you sure you want to forget everything?\n"))
c.printf0(string("> "))
c.gets(@buf)
if (toupper(byte[@buf][0]) == "Y")
size := 0
changeflag := 1
c.printf0(string("< Memory erased\n"))
else
c.printf0(string("< Reset aborted\n"))
' Reset to a basic vocab table
PUB ResetBasicVocab | buf[25]
c.printf0(string("< Ary you sure you want to reset to a basic word list?\n"))
c.printf0(string("> "))
c.gets(@buf)
if (toupper(byte[@buf][0]) == "Y")
size := basicsize
c.memcpy(@vocab, @basicvocab, size)
changeflag := 1
c.printf0(string("< Memory reset to basic words\n"))
else
c.printf0(string("< Reset aborted\n"))
' Dump out a Spin formatted version of the vocab table
PUB DumpHexWords | i, ptr
i := 0
ptr := @vocab
c.printf1(string(" version long %d\n"), version)
c.printf1(string(" size long %d\n"), size)
c.printf0(string(" vocab byte\n"))
c.printf0(string(" byte "))
repeat while (ptr < @vocab + size)
c.printf1(string("$%2.2x"), byte[ptr++])
if (ptr == @vocab + size)
c.printf0(string("\n"))
elseif ((i++) // 16 == 15)
c.printf0(string("\n byte "))
else
c.printf0(string(","))
c.printf1(string(" byte 0[%d]\n"), BUF_SIZE - size)
' Dump an ASCII formatted version of the vocab table
PUB DumpAsciiWords(name, num) | i, ptr1, index, index2, index3, ptr
i := 0
ptr := @vocab
if (num > 1)
ptr := FindWord(name)
if (not ptr)
c.printf1(string("$ %s not found\n"), name)
return
repeat while (ptr < @vocab + size)
if ((byte[ptr] & TYPE_MASK) == TYPE_RELATED)
ptr += 7
elseif ((byte[ptr] & TYPE_MASK) == TYPE_RELATE2)
ptr += 9
elseif ((byte[ptr] & TYPE_MASK) == TYPE_EQUATE)
ptr += 5
else
if ((byte[ptr] & DELETE_MASK) == 0)
c.printf2(string("$ %s - %s"), ptr + 1, types[byte[ptr][0] - 1])
ptr1 := ptr + strsize(ptr) + 1
repeat while (ptr1 < @vocab + size and(byte[ptr1][0] or byte[ptr1][1]))
index :=(byte[ptr1][0] << 7) | byte[ptr1][1]
ptr1 := @vocab + index
if ((byte[ptr1][0] & TYPE_MASK) == TYPE_RELATED)
if ((byte[ptr1][0] & DELETE_MASK) == 0)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
index2 :=(byte[ptr1][3] << 7) | byte[ptr1][4]
c.printf2(string(" (%s %s)"), @vocab + index + 1, @vocab + index2 + 1)
ptr1 += 5
elseif ((byte[ptr1][0] & TYPE_MASK) == TYPE_RELATE2)
if ((byte[ptr1][0] & DELETE_MASK) == 0)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
index2 :=(byte[ptr1][3] << 7) | byte[ptr1][4]
index3 :=(byte[ptr1][5] << 7) | byte[ptr1][6]
c.printf3(string(" (%s %s %s)"), @vocab + index + 1, @vocab + index2 + 1, @vocab + index3 + 1)
ptr1 += 7
elseif ((byte[ptr1][0] & TYPE_MASK) == TYPE_EQUATE)
if ((byte[ptr1][0] & DELETE_MASK) == 0)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
c.printf1(string(" (=%s)"), @vocab + index + 1)
ptr1 += 3
else
c.printf1(string("$ Invalid type = %2.2x\n"), byte[ptr1][0])
c.printf0(string("\n"))
if (num > 1)
quit
ptr += strsize(ptr) + 3
' Add a word to the vocab table
PUB AddWord(attrib, str) | ptr, ptr1
ptr := @vocab + size
ptr1 := ptr
if (size + strsize(str) + 4 > BUF_SIZE)
c.printf0(string("$ Out of memory\n"))
return
if (debugmode)
c.printf2(string("AddWord %s - %s\n"), str, types[attrib - 1])
byte[ptr++] := attrib
c.strcpy(ptr, str)
ptr += strsize(ptr) + 1
byte[ptr++] := 0
byte[ptr] := 0
size += strsize(str) + 4
changeflag := 1
' Determine the attribute of an unknown word, and add it to the vocab table
PUB UnknownWord(tokens, num, i) | str, buf[25], ptr, caseflag
str := long[tokens][i]
caseflag := 0
if (i == 0)
if (byte[str][0] => "A" and byte[str][0] =< "Z")
caseflag := 1
byte[str][0] += "a" - "A"
if (FindWord(str))
return 0
byte[str][0] -= "a" - "A"
AddWord(TYPE_NAME, str)
return 0
else
if (num > 2)
if (c.strcmp(long[tokens][1], string("equal")) == 0 or c.strcmp(long[tokens][1], string("equals")) == 0)
ptr := FindWord(long[tokens][2])
if (ptr)
AddWord(byte[ptr], long[tokens][0])
return 0
else
AddWord(TYPE_ADJECT, long[tokens][0])
return 0
else
ptr := FindWord(long[tokens][i - 1])
if (ptr == 0)
SomethingWrong(long[tokens][i - 1])
else
if (byte[ptr][0] == TYPE_ARTICLE and(i == 1 or i == num - 1))
AddWord(TYPE_NOUN, str)
return 0
elseif (i < 3 and(byte[ptr][0] == TYPE_NOUN or byte[ptr][0] == TYPE_NAME))
AddWord(TYPE_VERB, str)
return 0
elseif ((i > 1 and byte[ptr][0] == TYPE_VERB) or i > 2)
if (byte[str][0] => "A" and byte[str][0] =< "Z")
AddWord(TYPE_NAME, str)
return 0
elseif (i < num - 1 or byte[ptr][0] == TYPE_VERB)
AddWord(TYPE_ADJECT, str)
return 0
if (i == num - 1 and num => 4)
ptr := FindWord(long[tokens][i - 2])
if (ptr and byte[ptr][0] == TYPE_ARTICLE)
AddWord(TYPE_NOUN, str)
return 0
else
AddWord(TYPE_ADJECT, str)
return 0
c.printf1(string("< I don't know %s\n"), str)
repeat while (1)
c.printf0(string("< Is it a noun, verb, pronoun, adjective, Name, Article, query or ignore?\n"))
c.printf0(string("> "))
c.gets(@buf)
if (caseflag and byte[@buf][0] <> "N" and c.strcmp(str, string("I")))
byte[str][0] += "a" - "A"
if (byte[@buf][0] == "n")
AddWord(TYPE_NOUN, str)
quit
elseif (byte[@buf][0] == "v")
AddWord(TYPE_VERB, str)
quit
elseif (byte[@buf][0] == "a")
AddWord(TYPE_ADJECT, str)
quit
elseif (byte[@buf][0] == "p")
AddWord(TYPE_PRONOUN, str)
quit
elseif (byte[@buf][0] == "N")
AddWord(TYPE_NAME, str)
quit
elseif (byte[@buf][0] == "A")
AddWord(TYPE_ARTICLE, str)
quit
elseif (byte[@buf][0] == "q")
AddWord(TYPE_QUERY, str)
quit
elseif (byte[@buf][0] == "i")
return 1
c.printf0(string("I don't understand\n"))
return 0
' Delete a word and all references to it from the vocab table
PUB DeleteWord(tokens, num) | ptr, buf[25], index, index2
if (num < 2)
c.printf0(string("< I don't know what to forget\n"))
return
ptr := FindWord(long[tokens][1])
if (ptr == 0)
c.printf1(string("< I don't know %s\n"), long[tokens][1])
return
repeat while (1)
c.printf1(string("< Do you want me to forget %s?\n"), long[tokens][1])
c.printf0(string("> "))
c.gets(@buf)
if (byte[@buf][0] == "y")
index := ptr - @vocab
' Delete the word
byte[ptr] |= DELETE_MASK
' Delete the chain
repeat while (ptr := GetNextItem(ptr))
byte[ptr] |= DELETE_MASK
' Delete any reference to this word
ptr := @vocab
repeat while (ptr < @vocab + size)
if ((byte[ptr] & TYPE_MASK) == TYPE_EQUATE)
if ((byte[ptr] & DELETE_MASK) == 0)
index2 :=(byte[ptr][1] << 7) | byte[ptr][2]
if (index == index2)
byte[ptr] |= DELETE_MASK
ptr += 5
elseif ((byte[ptr] & TYPE_MASK) == TYPE_RELATED)
if ((byte[ptr] & DELETE_MASK) == 0)
index2 :=(byte[ptr][1] << 7) | byte[ptr][2]
if (index == index2)
byte[ptr] |= DELETE_MASK
index2 :=(byte[ptr][3] << 7) | byte[ptr][4]
if (index == index2)
byte[ptr] |= DELETE_MASK
ptr += 7
elseif ((byte[ptr] & TYPE_MASK) == TYPE_RELATE2)
if ((byte[ptr] & DELETE_MASK) == 0)
index2 :=(byte[ptr][1] << 7) | byte[ptr][2]
if (index == index2)
byte[ptr] |= DELETE_MASK
index2 :=(byte[ptr][3] << 7) | byte[ptr][4]
if (index == index2)
byte[ptr] |= DELETE_MASK
index2 :=(byte[ptr][5] << 7) | byte[ptr][6]
if (index == index2)
byte[ptr] |= DELETE_MASK
ptr += 9
else
ptr += strsize(ptr) + 3
changeflag := 1
c.printf1(string("< %s forgotten\n"), long[tokens][1])
return
elseif (byte[@buf][0] == "n")
c.printf1(string("< %s is not forgotten\n"), long[tokens][1])
return
else
c.printf0(string("< I don't understand\n"))
' Could find a word that was expected. Print a message.
PUB SomethingWrong(str)
c.printf0(string("Something's wrong\n"))
c.printf1(string("I couldn't find %s\n"), str)
' Equate the first word to the second word
PUB AddEquate(ptr1, ptr2) | index, ptr3
ptr3 := ptr1 + strsize(ptr1) + 1
if (size + 5 > BUF_SIZE)
c.printf0(string("< Out of memory\n"))
return
repeat while (ptr3 < @vocab + size and(byte[ptr3][0] or byte[ptr3][1]))
index :=(byte[ptr3][0] << 7) | byte[ptr3][1]
ptr3 := @vocab + index
if ((byte[ptr3][0] & TYPE_MASK) == TYPE_EQUATE)
if ((byte[ptr3][0] & DELETE_MASK) == 0)
index :=(byte[ptr3][1] << 7) | byte[ptr3][2]
if (ptr2 == @vocab + index)
return
ptr3 += 3
elseif ((byte[ptr3][0] & TYPE_MASK) == TYPE_RELATED)
ptr3 += 5
elseif ((byte[ptr3][0] & TYPE_MASK) == TYPE_RELATE2)
ptr3 += 7
else
c.printf1(string("Unknown type = %2.2x\n"), byte[ptr3][0])
byte[ptr3][0] := size >> 7
byte[ptr3][1] := size & 127
ptr3 := @vocab + size
byte[ptr3++] := TYPE_EQUATE
index := ptr2 - @vocab
byte[ptr3][0] := index >> 7
byte[ptr3][1] := index & 127
byte[ptr3][2] := 0
byte[ptr3][3] := 0
size += 5
changeflag := 1
' Get the next item in a chain
PUB GetNextItem(ptr) | index
if (ptr == 0)
return 0
repeat while (ptr < @vocab + size)
if ((byte[ptr][0] & TYPE_MASK) == TYPE_EQUATE)
ptr += 3
elseif ((byte[ptr][0] & TYPE_MASK) == TYPE_RELATED)
ptr += 5
elseif ((byte[ptr][0] & TYPE_MASK) == TYPE_RELATE2)
ptr += 7
else
ptr += strsize(ptr) + 1
index :=(byte[ptr][0] << 7) | byte[ptr][1]
if (index == 0)
quit
ptr := @vocab + index
if ((byte[ptr] & DELETE_MASK) == 0)
return ptr
return 0
' Get the next equate item in a chain
PUB GetNextEquate(ptr)
repeat while (ptr := GetNextItem(ptr))
if (byte[ptr] == TYPE_EQUATE)
return ptr
return 0
' Match two word entries and their equates in the vocab table
PUB Match(ptr1, ptr2) | index, ptr3, name1, name2
name1 := ptr1 + 1
repeat while (1)
ptr3 := ptr2
name2 := ptr2 + 1
repeat while (1)
if (c.strcmp(name1, name2) == 0)
return 1
ptr3 := GetNextEquate(ptr3)
if (not ptr3)
quit
index :=(byte[ptr3][1] << 7) | byte[ptr3][2]
name2 := @vocab + index + 1
ptr1 := GetNextEquate(ptr1)
if (not ptr1)
quit
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
name1 := @vocab + index + 1
return 0
' Remove articles from a token list
PUB RemoveArticles(tokens, num) | i, j, ptr
i := 0
repeat while (i < num)
ptr := FindWord(long[tokens][i])
if (byte[ptr] == 0)
c.printf1(string("RemoveArticles: Can't find %s\n"), long[tokens][i])
i++
next
if (byte[ptr] == TYPE_ARTICLE)
num--
j := i
repeat while (j < num)
long[tokens][j] := long[tokens][j + 1]
j++
next
i++
return num
' Locate exact matches of a word and a verb in a related field
PUB FindWords(word1, word2) | ptr1, ptr2, index
ptr1 := FindWord(word1)
repeat while (ptr1)
if (byte[ptr1][0] == TYPE_RELATED)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
ptr2 := @vocab + index
if (c.strcmp(ptr2 + 1, word2) == 0)
return ptr1
ptr1 := GetNextItem(ptr1)
return 0
' Return true if val is a vowel
PUB isvowel(val)
val := toupper(val)
if (val == "A" or val == "E" or val == "I" or val == "O" or val == "U")
return 1
return 0
PUB AddToMemory(name, ptr1) | ptr0
ptr0 := FindWord(name)
if (ptr0 == 0 and byte[name][0] => "A" and byte[name][0] =< "Z")
byte[name][0] += "a" - "A"
ptr0 := FindWord(name)
byte[name][0] -= "a" - "A"
if (ptr0 == 0)
return
Memory[MemoryIndex] := ptr0
Memory[MemoryIndex + 1] := ptr1
MemoryIndex :=(MemoryIndex + 2) & MEMORY_MASK
PUB PrintMemory | ptr0, ptr1, index
index := MemoryIndex
repeat while (1)
ptr0 := Memory[index]
ptr1 := Memory[index + 1]
if (ptr0 and ptr1)
if ((byte[ptr0] & DELETE_MASK) == 0 and(byte[ptr1] & DELETE_MASK) == 0)
PrintStatement(ptr0 + 1, ptr1, 0)
index :=(index + 2) & MEMORY_MASK
if (index == MemoryIndex)
quit
c.printf0(string("$\n"))
PUB CheckMemory(ptr0, ptr1) | ptr0a, ptr1a, index
index := MemoryIndex
repeat while (1)
ptr0a := Memory[index]
ptr1a := Memory[index + 1]
if (ptr0 == ptr0a and ptr1 == ptr1a)
return 1
index :=(index + 2) & MEMORY_MASK
if (index == MemoryIndex)
quit
return 0
' Determine whether the word is plural, singular or something else
PUB GetPlural(name) | len, ptr1
len := strsize(name)
ptr1 := FindWord(name)
'printf("GetPlural %s\n", name);
if (c.strcmp(name, string("I")) == 0)
return - 1
if (len < 2)
return 0
if (c.strcmp(name, string("you")) == 0 or c.strcmp(name, string("You")) == 0)
return 1
if (ptr1 and byte[ptr1] <> TYPE_NOUN and byte[ptr1] <> TYPE_ADJECT)
return 0
if (byte[name][len - 1] == "s" and byte[name][len - 2] <> "s")
return 1
return 0
PUB GetVerb(plural, ptr1) | verbptr, isptr
isptr := FindWord(string("is"))
if (isptr and Match(isptr, ptr1))
if (plural == 1)
verbptr := string("are")
elseif (plural == - 1)
verbptr := string("am")
else
verbptr := string("is")
else
verbptr := ptr1 + 1
'printf("GetVerb %d %s %s\n", plural, ptr1+1, verbptr);
return verbptr
' Print a statement formed from the name and the field pointed to by ptr1
' Substitue I for you, and You for I in the name
PUB PrintStatement(name, ptr1, remember) | ptr, nullstr, Astr, index, index2, index3, namestr[25], astr_0, plural, verbptr
byte[@nullstr] := 0
Astr := @byte[@nullstr]
astr_0 := @byte[@nullstr]
if (remember)
if (c.strcmp(name, string("you")) == 0)
name := string("I")
elseif (c.strcmp(name, string("I")) == 0)
name := string("you")
c.strcpy(@namestr, name)
plural := GetPlural(@namestr)
ptr := FindWord(@namestr)
if (ptr)
if (byte[ptr][0] == TYPE_NOUN and plural == 0 and(byte[ptr1][0] == TYPE_RELATED or byte[ptr1][0] == TYPE_RELATE2))
if (isvowel(byte[@namestr][0]))
Astr := string("An ")
else
Astr := string("A ")
if (not byte[Astr][0] and byte[@namestr][0] => "a" and byte[@namestr][0] =< "z")
byte[@namestr][0] -= "a" - "A"
if (remember)
c.printf0(string("< "))
else
c.printf0(string("$ "))
if (byte[ptr1][0] == TYPE_RELATED)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
index2 :=(byte[ptr1][3] << 7) | byte[ptr1][4]
if (vocab[index2] == TYPE_NOUN and GetPlural(@vocab + index2 + 1) == 0)
if (isvowel(vocab[index2 + 1]))
astr_0 := string("an ")
else
astr_0 := string("a ")
verbptr := GetVerb(plural, @vocab + index)
c.printf5(string("%s%s %s %s%s\n"), Astr, @namestr, verbptr, astr_0, @vocab + index2 + 1)
if speak
c.fprintf5(speak, string("%s%s %s %s%s\n"), Astr, @namestr, verbptr, astr_0, @vocab + index2 + 1)
elseif (byte[ptr1][0] == TYPE_RELATE2)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
index2 :=(byte[ptr1][3] << 7) | byte[ptr1][4]
index3 :=(byte[ptr1][5] << 7) | byte[ptr1][6]
if (vocab[index3] == TYPE_NOUN and GetPlural(@vocab + index3 + 1) == 0)
if (isvowel(vocab[index2 + 1]))
astr_0 := string("an ")
else
astr_0 := string("a ")
verbptr := GetVerb(plural, @vocab + index)
c.printf6(string("%s%s %s %s%s %s\n"), Astr, @namestr, verbptr, astr_0, @vocab + index2 + 1, @vocab + index3 + 1)
if speak
c.fprintf6(speak, string("%s%s %s %s%s %s\n"), Astr, @namestr, verbptr, astr_0, @vocab + index2 + 1, @vocab + index3 + 1)
elseif (byte[ptr1][0] == TYPE_EQUATE)
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
c.printf2(string("%s is %s\n"), @namestr, @vocab + index + 1)
if speak
c.fprintf2(speak, string("%s is %s\n"), @namestr, @vocab + index + 1)
else
c.printf2(string("%s is a %s\n"), @namestr, types[byte[ptr1][0] - 1])
if speak
c.fprintf2(speak, string("%s is a %s\n"), @namestr, types[byte[ptr1][0] - 1])
if (remember)
AddToMemory(@namestr, ptr1)
PUB PrintQuestion(ptr1) | nullstr, Astr, isptr, plural, verbptr
byte[@nullstr] := 0
Astr := @byte[@nullstr]
isptr := FindWord(string("is"))
plural := GetPlural(ptr1 + 1)
verbptr := GetVerb(plural, isptr)
if (byte[ptr1][0] == TYPE_NOUN and plural <> 1)
if (isvowel(byte[ptr1][1]))
Astr := string("an ")
else
Astr := string("a ")
c.printf3(string("< What %s %s%s?\n"), verbptr, Astr, ptr1 + 1)
if speak
c.fprintf3(speak, string("What %s %s%s\n"), verbptr, Astr, ptr1 + 1)
' Process a list of tokens received from the user
PUB Process(tokens, num, question) | i, index, index2, index3, ptr[4], ptr1, ptr0, ptrx, count, counta, ptry, ptrya, match_0, equalflag, tempflag
match_0 := 0
equalflag := 0
tempflag := 0
' Equate the two words if it's an equal statement
if (num == 3)
if (not question and(c.strcmp(long[tokens][1], string("equal")) == 0 or c.strcmp(long[tokens][1], string("equals")) == 0))
if (debugmode)
c.printf0(string("equals mode\n"))
equalflag := 1
ptr0 := FindWord(long[tokens][0])
ptr1 := FindWord(long[tokens][2])
if (not ptr0)
SomethingWrong(long[tokens][0])
return
if (not ptr1)
SomethingWrong(long[tokens][2])
return
AddEquate(ptr0, ptr1)
AddEquate(ptr1, ptr0)
return
' Check if the first word is do/does/did.
' If so, remove the first word and make it a question.
if (ptr0 := FindWord(string("do")))
if (debugmode)
c.printf0(string("does query\n"))
ptr1 := FindWord(long[tokens][0])
if (not ptr1)
SomethingWrong(long[tokens][0])
return
if (Match(ptr0, ptr1))
question := 1
num--
i := 0
repeat while (i < num)
long[tokens][i] := long[tokens][i + 1]
i++
' Remove the articles
num := RemoveArticles(tokens, num)
' There must be three items in the list or it is too short or too long
if (num < 3)
c.printf0(string("I don't understand\n"))
c.printf0(string("Use more words\n"))
return
if (num > 4)
c.printf0(string("I don't understand\n"))
c.printf0(string("Use less words\n"))
return
' Locate the tokens in the vocab table
i := 0
repeat while (i < num)
ptr[i] := FindWord(long[tokens][i])
if (ptr[i] == 0)
SomethingWrong(long[tokens][i])
return
i++
' Change the word type if commanded to do so
if (num == 3 and c.strcmp(long[tokens][1], string("is")) == 0)
if (c.strcmp(long[tokens][2], string("noun")) == 0)
byte[ptr[0]][0] := TYPE_NOUN
return
elseif (c.strcmp(long[tokens][2], string("name")) == 0)
byte[ptr[0]][0] := TYPE_NAME
return
elseif (c.strcmp(long[tokens][2], string("adjective")) == 0)
byte[ptr[0]][0] := TYPE_ADJECT
return
elseif (c.strcmp(long[tokens][2], string("verb")) == 0)
byte[ptr[0]][0] := TYPE_VERB
return
' If the first word is a query, the second word must be is/am/are
if (byte[ptr[0]][0] == TYPE_QUERY)
if (debugmode)
c.printf0(string("query mode\n"))
question := 1
ptr1 := FindWord(string("is"))
tempflag := 0
'if (num != 3 || !ptr1 || !Match(ptr1, ptr[1]))
if (num == 3)
if (ptr1)
if (Match(ptr1, ptr[1]))
tempflag := 1
if (not tempflag)
c.printf0(string("I don't understand\n"))
return
' Scan related entries and equate's related entries
ptr1 := ptr[2]
ptr0 := ptr1
ptrx := ptr1
ptry := ptr1
count := 0
' variables for items not in short term memory
ptrya := 0
counta := 0
if (debugmode)
PrintStatement(long[tokens][2], ptr1, 0)
repeat while (1)
repeat while (1)
ptr1 := GetNextItem(ptr1)
if (not ptr1)
quit
if (byte[ptr1][0] <> TYPE_RELATED and byte[ptr1][0] <> TYPE_RELATE2)
next
'index = (ptr1[1] << 7) | ptr1[2];
'index2 = (ptr1[3] << 7) | ptr1[4];
if (debugmode)
PrintStatement(long[tokens][2], ptr1, 0)
if (CheckMemory(ptr[2], ptr1) == 0)
counta++
if ((rand // counta) == 0)
ptrya := ptr1
if (ptrya == 0)
count++
if ((rand // count) == 0)
ptry := ptr1
if (ptrya == 0)
ptrya := ptry
ptr0 := GetNextEquate(ptr0)
if (not ptr0)
quit
index :=(byte[ptr0][1] << 7) | byte[ptr0][2]
ptrx := @vocab + index
ptr1 := ptrx
if (ptrya)
if (byte[ptrya][0] == TYPE_RELATED or byte[ptrya][0] == TYPE_RELATE2 or byte[ptrya][1] == TYPE_EQUATE)
PrintStatement(long[tokens][2], ptrya, 1)
else
c.printf0(string("< I don't know\n"))
return
' If not an equal statement or a question check if first word is a verb
' Is so, swap the first and second tokens
if (not equalflag and not question and byte[ptr[0]][0] == TYPE_VERB)
if (debugmode)
c.printf0(string("Lead verb query\n"))
question := 1
ptr1 := ptr[0]
ptr[0] := ptr[1]
ptr[1] := ptr1
ptr1 := long[tokens][0]
long[tokens][0] := long[tokens][1]
long[tokens][1] := ptr1
' Look for a match to the three words. If it is a question and
' a match is found print "Yes"
ptr1 := ptr[0]
ptr0 := ptr1
ptrx := ptr1
repeat while (1)
repeat while (1)
ptr1 := GetNextItem(ptr1)
if (not ptr1)
quit
if (byte[ptr1][0] <> TYPE_RELATED and byte[ptr1][0] <> TYPE_RELATE2)
next
index :=(byte[ptr1][1] << 7) | byte[ptr1][2]
index2 :=(byte[ptr1][3] << 7) | byte[ptr1][4]
tempflag := Match(ptr[1], @vocab + index) and Match(ptr[2], @vocab + index2)
if (num == 4)
index3 :=(byte[ptr1][5] << 7) | byte[ptr1][6]
tempflag := tempflag and Match(ptr[3], @vocab + index3)
if (debugmode)
c.printf7(string("%s (%s,%s) (%s,%s) (%s,%s)\n"), ptrx + 1, ptr[1] + 1, @vocab + index + 1, ptr[2] + 1, @vocab + index2 + 1, ptr[3], @vocab + index3 + 1)
else
if (debugmode)
c.printf5(string("%s (%s,%s) (%s,%s)\n"), ptrx + 1, ptr[1] + 1, @vocab + index + 1, ptr[2] + 1, @vocab + index2 + 1)
if (tempflag)
if (not question)
c.printf0(string("< I know that\n"))
else
c.printf0(string("< Yes\n"))
return
ptr0 := GetNextEquate(ptr0)
if (not ptr0)
quit
index :=(byte[ptr0][1] << 7) | byte[ptr0][2]
ptrx := @vocab + index
ptr1 := ptrx
' Print "No" if it was a question and no match found
if (question)
c.printf0(string("< No\n"))
return
' Add relationship if there was no match and it's not a question
if (not match_0)
if (size + 1 +(num << 1) > BUF_SIZE)
c.printf0(string("< Out of memory\n"))
return
ptr1 := ptr[0]
repeat while (ptr0 := GetNextItem(ptr1))
ptr1 := ptr0
if (byte[ptr1][0] == TYPE_RELATED)
ptr1 += 5
elseif (byte[ptr1][0] == TYPE_RELATE2)
ptr1 += 7
elseif (byte[ptr1][0] == TYPE_EQUATE)
ptr1 += 3
else
ptr1 += strsize(ptr1) + 1
byte[ptr1][0] := size >> 7
byte[ptr1][1] := size & 127
ptr1 := @vocab + size
if (num == 3)
byte[ptr1][0] := TYPE_RELATED
else
byte[ptr1][0] := TYPE_RELATE2
index := ptr[1] - @vocab
byte[ptr1][1] := index >> 7
byte[ptr1][2] := index & 127
index := ptr[2] - @vocab
byte[ptr1][3] := index >> 7
byte[ptr1][4] := index & 127
if (num == 3)
byte[ptr1][5] := 0
byte[ptr1][6] := 0
size += 7
else
index := ptr[3] - @vocab
byte[ptr1][5] := index >> 7
byte[ptr1][6] := index & 127
byte[ptr1][7] := 0
byte[ptr1][8] := 0
size += 9
changeflag := 1
' Check if predicate is undefined
index := 0
ptr1 := ptr[2]
if (byte[ptr1][0] < 32)
ptr0 := ptr1 + strsize(ptr1) + 1
index :=(byte[ptr0][0] << 7) | byte[ptr0][1]
if (index == 0)
PrintQuestion(ptr1)
else
c.printf0(string("< I will remember that\n"))
' Wait from 3 to 10 seconds for input. Print a random fact from
' the vocab table if no input received.
PUB WaitForInput | waittime, starttime, ptr1, ptr2, ptr1a, ptr2a, index, count, FirstTime
waittime :=((rand // 8) + 3) * clkfreq
starttime := GetTicks
c.printf0(string("> "))
repeat while (not kbhit)
' Scan all the entries in the vocab table
if (GetTicks - starttime > waittime)
count := 0
ptr1 := @vocab
ptr1a := ptr2a := 0
repeat while (ptr1 < @vocab + size)
if ((byte[ptr1][0] & TYPE_MASK) == TYPE_RELATED)
ptr1 += 7
elseif ((byte[ptr1][0] & TYPE_MASK) == TYPE_RELATE2)
ptr1 += 9
elseif ((byte[ptr1][0] & TYPE_MASK) == TYPE_EQUATE)
ptr1 += 5
elseif (byte[ptr1][0] & DELETE_MASK)
ptr1 += strsize(ptr1) + 3
else
ptr2 := ptr1
FirstTime := 1
repeat while ((ptr2 := GetNextItem(ptr2)) or FirstTime)
FirstTime := 0
if (ptr2 == 0 and byte[ptr1][0] <> TYPE_NAME and byte[ptr1][0] <> TYPE_NOUN and byte[ptr1][0] <> TYPE_ADJECT)
quit
if (ptr2 == 0 or byte[ptr2][0] == TYPE_RELATED)
count++
if ((rand // count) == 0)
if (count == 1 or CheckMemory(ptr1, ptr2) == 0)
ptr1a := ptr1
ptr2a := ptr2
ptr1 += strsize(ptr1) + 3
' Print the entry that was randomly selected
if (ptr1a and ptr2a)
if (byte[ptr2a][0] == TYPE_RELATED)
c.putchar(8)
c.putchar(8)
PrintStatement(ptr1a + 1, ptr2a, 1)
c.printf0(string("> "))
elseif (ptr1a)
c.putchar(8)
c.putchar(8)
PrintQuestion(ptr1a)
c.printf0(string("> "))
waittime :=((rand // 10) + 5) * clkfreq
starttime := GetTicks
' Save the vocab table
PUB SaveVocab | addr, i, val, val1
c.printf0(string("$ Save disabled\n"))
{
addr := @size
i :=(size + 7) >> 2
repeat while (i > 0)
val := long[addr]
if (val <> i2c.ReadLong(28, $a0, addr))
i2c.WriteLong(28, $a0, addr, val)
repeat while (i2c.WriteWait(28, $a0, addr))
addr += 4
i--
}
PUB CheckCommand(tokens, num, buffer) | ptr1, retval, caseshift
retval := 1
caseshift :=(byte[long[tokens][0]][0] => "A" and byte[long[tokens][0]][0] =< "Z")
if (num > 2)
return 0
if (caseshift)
byte[long[tokens][0]][0] += "a" - "A"
if (c.strcmp(long[tokens][0], string("help")) == 0)
c.printf0(string("$ Type a sentence, or enter one of these commands\n"))
c.printf0(string("$ vocab [word] - Print the words I know\n"))
c.printf0(string("$ dump - Print the words as hex codes\n"))
c.printf0(string("$ forget - Remove a word from memroy\n"))
c.printf0(string("$ save - Save the words to EEPROM\n"))
c.printf0(string("$ reset - Reset the word table\n"))
c.printf0(string("$ basic - Reset the word table to a basic list\n"))
c.printf0(string("$ history - Print the short term memory\n"))
c.printf0(string("$ goodbye - Exit the program\n"))
elseif (c.strcmp(long[tokens][0], string("goodbye")) == 0)
if (changeflag := 0)
repeat while (1)
c.printf0(string("< Should I save?\n"))
c.printf0(string("> "))
c.gets(buffer)
ptr1 := SkipChar(buffer, " ")
if (toupper(byte[ptr1][0]) == "Y")
SaveVocab
quit
elseif (toupper(byte[ptr1][0]) == "N")
quit
c.printf0(string("< I don't undertand\n"))
c.printf0(string("< Goodbye\n"))
waitcnt(cnt+clkfreq/10)
'abort(0)
spinix.exit(0)
elseif (c.strcmp(long[tokens][0], string("vocab")) == 0)
DumpAsciiWords(long[tokens][1], num)
elseif (c.strcmp(long[tokens][0], string("dump")) == 0)
DumpHexWords
elseif (c.strcmp(long[tokens][0], string("forget")) == 0)
DeleteWord(tokens, num)
elseif (c.strcmp(long[tokens][0], string("save")) == 0)
SaveVocab
elseif (c.strcmp(long[tokens][0], string("reset")) == 0)
ResetVocab
elseif (c.strcmp(long[tokens][0], string("basic")) == 0)
ResetBasicVocab
elseif (c.strcmp(long[tokens][0], string("history")) == 0)
PrintMemory
elseif (c.strcmp(long[tokens][0], string("debug")) == 0)
debugmode := not debugmode
else
retval := 0
' Restore the case if needed
if (caseshift)
byte[long[tokens][0]][0] -= "a" - "A"
return retval
' This routine set the linefeed enable flag based on the config word
' The config word is the first long after the last argument
PUB config_linefeed(argc, argv) | ptr
ptr := long[argv][argc-1]
ptr += strsize(ptr) + 1
ptr := ((ptr + 3) >> 2) << 2
c.set_linefeed(long[ptr] & 1)
PUB main(argc, argv) | i, num, ptr1, ignore, question, caseshift, buffer[25], tokens[50]
'speak := c.getstdout
'speak := c.openserial(16, 16, 0, 9600, 64, 64)
config_linefeed(argc, argv)
c.printf0(string("Lerner 0.08 -- Spinix version\n"))
c.printf0(string("Save command disabled in this version\n\n"))
'i2c.Initialize(28)
i := 0
repeat while (i =< MEMORY_MASK)
Memory[i] := 0
i++
'printf("< Hello\n");
ptr1 := FindWords(string("you"), string("are"))
if (ptr1)
PrintStatement(string("you"), ptr1, 1)
' Loop on each user input
repeat while (1)
WaitForInput
c.gets(@buffer)
num := tokenize(@buffer, @tokens)
if (num == 0)
next
if (CheckCommand(@tokens, num, @buffer))
next
' Check for a question mark at the end
if (c.strcmp(tokens[num - 1], string("?")) == 0)
question := 1
num--
else
question := 0
' Check if all the words are in the vocab table
ignore := 0
i := 0
repeat while (i < num)
if (FindWord(tokens[i]) == 0)
if (ignore := UnknownWord(@tokens, num, i))
quit
i++
if (ignore)
next
' Process the user input
Process(@tokens, num, question)
return 0
{
+-----------------------------------------------------------------------------+
| TERMS OF USE: MIT License |
+-----------------------------------------------------------------------------+
|Permission is hereby granted, free of charge, to any person obtaining a copy |
|of this software and associated documentation files (the "Software"), to deal|
|in the Software without restriction, including without limitation the rights |
|to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|copies of the Software, and to permit persons to whom the Software is |
|furnished to do so, subject to the following conditions: |
| |
|The above copyright notice and this permission notice shall be included in |
|all copies or substantial portions of the Software. |
| |
|THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,|
|OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE|
|SOFTWARE. |
+-----------------------------------------------------------------------------+
}