*triple post*
I guess it's now time to post code, since I have put it off for a while.
#1:
Code: ;Cemetech contest 1 entry for Hooloovoo
;11 bytes, z80 assembly
;assembled with spasm, but it's short enought that it doesn't matter at all
;
;To use: simply press the letter on the calculator. There is no way to exit, but the problem statement didn't tell me I had to have one.
;(actually there is a way to exit: turn the calculator off. I do not guarantee portability)
;
;sorry about the name of the file, I couldn't resist, what with the wizard reference ;*post contest note:* the file was called wizardc8
#include ti83plus.inc
.org 9d93h
.db 0bbh,6dh
loop:
bcall(_GetKey)
cpl
add a,0f5h
bcall(_PutC)
jr loop
.end
This is the first way I thought of doing it, which was different from how other people did, and got a score 6 bytes lower.
#2:
Code: ;Cemetech contest 15 entry for Hooloovoo
;30 bytes, actually I hope this time
#include ti83plus.inc
#define mult_const 15
#define add_const 8
.org 9d93h
.db 0bbh,6dh
bcall(_ansname)
bcall(_chkfindsym)
ex de,hl
ld e,(hl)
inc hl
letter_loop:
inc hl
ld a,(hl)
add a,add_const-LcapA+26
ld d,a
ld b,mult_const-1
mult_loop:
add a,d
pos_loop:
sub 26
jr nc, pos_loop
djnz mult_loop
done_mult
add a,LcapA+26
ld (hl),a
dec e
jr nz, letter_loop
ret
.end
#3
Code: ;Cemetech contest 15 entry for Hooloovoo
;Challenge 3
;47 bytes, including key. 36 bytes without, not including header
#include ti83plus.inc
#define KEY "CALCULATORS"
#define KEY_LEN 11
.org 9d93h
.db 0bbh,6dh
bcall(_ansname)
bcall(_chkfindsym)
ld a,(de)
ld c,a
inc c
inc de
reset_key:
ld b,KEY_LEN
ld hl,key_l-1
letter_loop:
noreset:
dec c
ret z
inc de
ld a,(de)
cp tSpace
jr z,letter_loop
inc hl
sub (hl)
jr nc,noadd
add a,26
noadd:
add a,LcapA
ld (de),a
djnz noreset
jr reset_key
key_l:
.db KEY
.end
I'm not sure how other people solved it. I searched for the correct pattern of spaces in the text of Hamlet, which had been dropped as a hint by jonbush. This gave me the cleartext, and going backwards was simple from there
#4
Code: ;Cemetech contest 15 entry for Hooloovoo
;Challenge 4
;59 bytes, not including header
#include ti83plus.inc
.org 9d93h
.db 0bbh,6dh
;hl': location of thing
;de': 0
;d: running total
;e: counter to 96
;b: counter down to 0 from 63
;c:rotating mask
;b:counter to 63
bcall(_AnsName)
ld hl,0160h
ld (OP1+1),hl
bcall(_chkfindsym)
ex de,hl
inc hl
ld b,63
rowinit:
ld de,27*100h+29
ld c,12
rowloop:
push bc
inc hl
ld bc,8*100h+27
byteloop:
rlc (hl)
sbc a,a
and d
add a,e
modloop:
jp m, donemod
sub c
jr modloop
donemod:
ld e,a
inc d
djnz byteloop
pop bc
dec c
jr nz, rowloop
print:
add a,26;+'A'
jr nz, letter
ld a,20h-40h
letter:
add a,'A'-1
put:
bcall(_putc)
djnz rowinit
ret
#5
Code: ;Cemetech contest 15 entry for Hooloovoo
;Challenge 5
;48 bytes, not including header
#include ti83plus.inc
.org 9d93h
.db 0bbh,6dh
bcall(_ansname)
bcall(_chkfindsym)
ex de,hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld bc,053ch
loop:
call mod
push de
ld d,1
bcall(_IPoint)
pop de
dec de
ld a,d
or e
ret z
inc hl
jr loop
mod:
ld a,(hl)
sub 32h
jr c,case0
jr z,case1
dec a
jr z,case2
case3:
dec c
ret
case2:
inc b
ret
case0:
dec b
ret
case1
inc c
ret
I would really like to see Xeda112358's entries, as I have no idea what I could have improved on in my entries, and hers were smaller than mine for the ones she submitted.