~noelle/exapunks-solutions

8a04a4330fbf9728d3c51635ee5e765ea1998e4a — Noelle Leigh 5 months ago 66e1e8d
44: Solve for the first 4 hosts

now need to handle the final 2
1 files changed, 56 insertions(+), 19 deletions(-)

M 44-us-department-of-defense-usaf-secure-facility/XA.exa
M 44-us-department-of-defense-usaf-secure-facility/XA.exa => 44-us-department-of-defense-usaf-secure-facility/XA.exa +56 -19
@@ 1,43 1,80 @@
NOTE OPEN LOCKS
LINK 800

@REP 2
COPY 0 X
COPY 999 T
MARK PICKLOCK
MARK DECODE@{1,1}
COPY T #LOCK
ADDI X #LOCK X
SUBI T 111 T
TJMP PICKLOCK
TJMP DECODE@{1,1}
COPY X #LOCK
NOTE UNLOCKED
LINK 800
@END

NOTE GET "OGRE"
LINK -1
LINK -1
LINK -1

; GET 'PROJECT OGRE'
GRAB 300
COPY F X
DROP

; FIND THE FILE
LINK 800
LINK 800

NOTE FIND PROJECT OGRE
@REP 4
LINK 80@{1,1}
MAKE
COPY 801 T
COPY T F
DROP
MARK FINDFILE
LINK T
GRAB 200
TEST F = X
FJMP SKIP@{1,1}
COPY 80@{1,1} T
JUMP FOUND

MARK SKIP@{1,1}
TEST X = F
TJMP FOUNDFILE
DROP
LINK -1
@END
GRAB 400
COPY F T
ADDI T 1 T
SEEK -1
COPY T F
DROP
JUMP FINDFILE

MARK FOUND
MARK FOUNDFILE
DROP
LINK -1
MAKE
COPY T F
COPY X F
LINK -1
DROP
LINK T

COPY 43 T

MARK COPYLOOP
GRAB 400
COPY F X
DROP
LINK X
GRAB 200
SEEK 1
SUBI 44 T X
SEEK X
COPY F X
DROP
LINK -1
GRAB 401
SEEK 9999
COPY X F
SUBI T 1 T
DROP
TJMP COPYLOOP

MARK DONECOPY
GRAB 400
WIPE
GRAB 401
LINK -1
LINK -1