EXAPUNKS

EXAPUNKS

Not enough ratings
FAKE ID (with my solution)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
2.082 KB
4 Apr, 2023 @ 7:19am
1 Change Note ( view )

Subscribe to download
FAKE ID (with my solution)

Description
Some cities decided to use a basic ID system to register people with an unique number. Citizens doesn't know how this system works and they think it's random, so they try to register illegal people with fake ID numbers.

This system works by dividing the number of the person by 16 and taking it's module. That number correspond to the index of a list of letters. If the letter match, cool. Otherwise, save the ID number and the ID fake letter on a different file. That file will be given to authorities, so make no mistakes.

The files you're given are: *200*, all IDs and *210*, the letter list.

Example:
3035X

3035 % 16 = 11
On the list, index 11 is X, so it's real.

Another example:
8498Z

8498 % 16 = 2
On the list, index 2 is A, so it's fake.

Simple.


My solution:

XA:
LINK 800
GRAB 200

MARK LOOP
TEST EOF
TJMP END
MODI F 16 M

TEST F = M
TJMP LOOP

SEEK -2
COPY -1 M
COPY F M
COPY F M
JUMP LOOP

MARK END
KILL


XB:
LINK 800
MAKE
DROP
GRAB 210

MARK LOOP
SEEK -999
COPY M X
TEST X = -1
TJMP FAKE
SEEK X
COPY F M
JUMP LOOP

MARK FAKE
DROP
GRAB 400
SEEK 999
COPY M F
COPY M F
DROP
GRAB 210
JUMP LOOP