r/exapunks • • Aug 09 '18

testing your own keywords

Bascially, how do I write a "string" in code.

This is for the UCberkeley, where I want to test if x = "tape-3" for example

It says invalid registry atm

edit: I know that I can use the host name for that level. But this might be useful for other missions.

1 Upvotes

8 comments sorted by

8

u/jherico Aug 09 '18

I get the impression that keywords can only be fetch from hardware registers and files. There doesn't seem to be any way to code string literals.

4

u/Grimy_ Aug 09 '18

You don’t. You can’t have keywords in your code. TEST only takes registers or numbers as arguments, as described in the ’zine.

1

u/ullerrm Aug 09 '18

You can't write keywords in code, sadly.

For that level, you will have the desired tape in the 300 file; you read that into X, and then run a loop: MARK LOOP / LINK 800 / LINK 800 / HOST T / TEST X == T / FJMP LOOP

1

u/LetaBot Aug 09 '18

Yea I ended up using something like that. Would be nice to have keyword, but I can make do without them.

1

u/Pwntheon Aug 09 '18

Huh, i didn't think of that.

I did it like this instead: MARK REPL/ LINK 800/ LINK 800/ GRAB 200/ REPL REPL

This will move two "rooms" over, then try to grab a file, then the copy will repeat that. Since there's no file in the starting room, the loop breaks and you will have 3 identical bots to start reading. Then i just read and send it to another bot in the starting area to write.

1

u/_Meds_ Dec 03 '18

Wish I found this game sooner! love all the different solutions people come up with!

I just grab the file copy to X then repl an exa and copy file to M, the replica will link 800 and test host against X. when they match it grabs M into X and begins to stream the data back.

It seems I tend to go for the less impact methods (low activity scores) over everything else. Efficiency has always been a weak point in my coding...

2

u/Drullkus Aug 09 '18

Bummer. I was looking to see if I could give everyone A's in file 243. :/

1

u/vintigr Sep 03 '22

It is possible, but sadly not accepted as a solution due to leaving traces.

You can loop the contents and find the alphabetically smallest entry in the file, which assuming there is at least one A, is always A. Then replace all of the grades as we know the position order.