|
Carbon dioxide posted:Since I spent a lot of time getting the cycles down to 122, I'll leave the low size optimization to the threads. Seeking back 6 and copying over the last six entries is a good trick and that got me down to 122 also. I only had a 32 line solution so thanks for the help on that one too silentsnack! I'm really looking forward to the next level as I liked it a lot, and spent a lot of time on it. I'm still chasing down one cycle I know is possible, so maybe you all can help?
|
# ? Apr 10, 2022 03:48 |
|
|
# ? May 5, 2024 21:25 |
|
GuavaMoment posted:I'm really looking forward to the next level as I liked it a lot, and spent a lot of time on it. I'm still chasing down one cycle I know is possible, so maybe you all can help? Feel free to all help each other out, just don't post about levels yet before I covered them in my LP. Speaking of, I'm not entirely sure how my schedule will work out next week with Easter and such. The update might be delayed a bit.
|
# ? Apr 10, 2022 07:02 |
|
Part 22 - StreetSmarts GIS Database === Trash World Inbox === silentsnack posted:
=== StreetSmarts GIS Database === That was surprisingly easy. People are requesting the single, humming it to themselves, buying the album... Just because they've heard it before. Is that really all it takes? Two votes for "more complex", but 3 for this one. Mass media is a sham. It's seeming that way. Hmm. Girl you need to get a cluuuue... I just can't not get over yoooou! Oops. I guess it is pretty catchy. I didn't know AIs could get an earworm. Next up, hacking a GIS database. Theory: The inconsistency of ratings depends on context. We made a hit by picking a generic pop song and artificially boosting its exposure. But there are other domains where this isn't possible. For example, you couldn't change people's behavior by giving a Last Stop store a five-star rating in a restaurant guide. That would be ridiculous. All votes but one for "You never know". You never know... This is why we need to experiment. OST: Network Exploration The assignment: - Each host contains a list of restaurants and their ratings, from one to five stars (file 200). Locate the entry that corresponds to the Last Stop on Eddy Street and change its rating from one to five stars. - The name of the target restaurant and its location within the GIS grid is available in file 300. The first coordinate is the number of times to move east, while the second coordinate is the number of times to move north (positive) or south (negative). - For more information see "Network Exploration: Geographic Information Systems" in the second issue of the zine. Let's see what the zine has to teach us. We're dealing with a StreetSmarts system here. I'm just wondering what that would look like for any city that isn't grid based. Also, since GIS is short for Geographic Information System, it's pronounced GIS, not GIS. As you can see there's one or two restaurants in each block. There's also a compass needle to conveniently show us which way is which. East (the first value in file 300) is to the top right, while north is to the top left. Let's start building. I think it'd be convenient to have one EXA stay home to just transmit the coordinates: code:
The 'walking' EXA should first go the right "east" position (can I call it longitude?): code:
The north-south (latitude) code has to deal with negative values, so it's more complicated: code:
Finally, grab the file, and find the right restaurant. Since any restaurant has at least 1 star, I can copy the first star and write that to the file four times. This initial solution runs at 48/40/6. The top percentiles are 26, 25 and 6 respectively. Activity is already optimized at 6. That makes sense, because 6 is how many steps it takes to get to the far corners of the grid, so that'll correspond to the highest-activity test case. Time to improve the other metrics. First of all, we can speed up the search within the file. Since there's never more than 2 restaurants in a file, the following solution works: code:
For the next improvement, I considered that specifically going for the correct grid space is a bit slow with all the tests if the EXA is there yet. Since the restaurant we're looking for exists in only one place, I just can have EXA REPLs check everywhere. It's a bit fiddly to have the EXAs only go where they need to be and not visit nodes several times. code:
The south- and north-bound EXAs each link in their directions twice, leaving eastbound and GRABFILE EXAs behind. This is all written out instead of using @REP so I have manual control over when to use REPL and when a JUMP suffices, to prevent creating extra EXAs. The eastbound EXAs link in their directions three times, leaving GRABFILE instances behind so the entire grid is covered. Finally, in the GRABFILE code, after SEEKing for the second restaurant entry, it has to test if that's the correct one. If there's only one entry, the TEST makes this EXA die, and if it's the wrong one, the DIVI by zero will do so. 27/41/20. Notice that I always do the REPL to the moving EXAs first, and that I start with SOUTH and NORTH before EAST. Moving to the back of the grid takes the longest so it's important to optimize it as much as possible. I also tried making the eastbound EXA spawn columns of south/north-bound ones but that was slightly slower. There's one more cycle to be saved here, though. code:
I tried more tweaking with the movement order but I couldn't get it better than this. Finally, for size, the most straightforward trick is to just use loops instead of unrolls. Remove all speed optimizations in favour of simpler code: code:
For the next improvement, we need to reuse lines. This 29-line solution does so: code:
Finally, I can combine the southbound and northbound loops by putting the LINK ids in a register: code:
Oh. Apparently, that Last Stop location is getting mobbed. Processing. People are choosing to believe the guide even when it's obviously wrong... Why would they think Last Stop has actual good food? And why did the guide change their behavior, but not the highway sign? Here is the first vote. Before I finish for today, do you remember when I posted that story from the first zine, way back in episode 7? It was a couple of pages long. The second zine contains the last half of the story, here it is. Click the images for higher resolution. Next time, we'll have another hacker battle. Time for the next opponent. Are you ready? Carbon dioxide fucked around with this message at 14:36 on Apr 18, 2022 |
# ? Apr 18, 2022 14:32 |
|
The Signs were Vague What, are you my coach now? This looks like you're programming a search engine for a database, or a spread sheet, not just for a roughly digitized map of a neighborhood.
|
# ? Apr 18, 2022 15:57 |
|
berryjon posted:The Signs were Vague
|
# ? Apr 18, 2022 16:14 |
|
Carbon dioxide posted:This clocks in at 47/27/20. I'll leave the further improvement to the top percentile size of 25 lines to the threads. 25 lines? How about 18. code:
As for speed, 24/46/31: code:
|
# ? Apr 18, 2022 16:52 |
|
GuavaMoment posted:I'm still chasing down one cycle I know is possible, so maybe you all can help? "depends on which cycle you mean" and/or "maybe you can figure the rest of this mess out" because 23 is feasible with a bit of effort and paying attention to order of operations, so i'm blaming you for this one: code:
and a 22 cycle solution is possible, but I haven't found a way to make it fit inside the solution size limit code:
|
# ? Apr 18, 2022 17:14 |
|
silentsnack posted:"depends on which cycle you mean" and/or "maybe you can figure the rest of this mess out" because 23 is feasible with a bit of effort and paying attention to order of operations, so i'm blaming you for this one: I'm not picky, it could have been any cycle. If one exa is filling the map it's the same speed to read and wipe the file, or travel first and have another exa transmit over M. But I see now if you have two exas receiving M data, one can fill the three eastern columns and one can then fill the first north column, and this is one cycle faster. There is an order of operation issue to make the three column exa get the M data first, but this just squeaks it out. 23/75/30 code:
|
# ? Apr 18, 2022 17:45 |
|
quote:COPY 11 T I've been playing through the game myself and I never once thought to do this. I'd been storing my index values on X and using repeated TESTs for all of my loops. Much appreciated! Is this trick mentioned in the Zine anywhere?
|
# ? Apr 20, 2022 11:48 |
|
Beartaco posted:I've been playing through the game myself and I never once thought to do this. I'd been storing my index values on X and using repeated TESTs for all of my loops. Much appreciated! I think all the examples use X and they don't outright give you the minimalist loop structure since it's a puzzle game, but the first zine drops a few hints that "TEST operations overwrite whatever value is in the T register ...but it also has the same features as the X register, so you can also read/modify it however you want, and TJMP/FJMP only check whether or not T=0"
|
# ? Apr 20, 2022 20:59 |
|
Yes. The zine gives you enough to at least solve all the puzzles, but doesn't go out of its way to help you find high scores.
|
# ? Apr 20, 2022 21:17 |
|
Yeah I'm well near the end of the game at this point, knowing that I can store values in X while at the same time keeping indexes in T is massive. That's not just saving a few lines of code, that's doubling my storage capacity in all sorts of situations without the need to mess around with files which is always a huge pain. I knew that I could keep T as a general register, obviously, but using it specifically for decrementing down to 0 or 1 never once occurred to me. Beartaco fucked around with this message at 06:34 on Apr 21, 2022 |
# ? Apr 21, 2022 06:32 |
|
Part 23 - Valhalla Hacker Battle === Trash World Inbox === GuavaMoment posted:25 lines? How about 18. GuavaMoment also shared this 24 cycle solution: GuavaMoment posted:
Next, both silentsnack and GuavaMoment posted 23-cycle solutions. They are similar in the sense that they each use two EXAs, one to handle the back rows and one to handle the front rows. That's apparently very slightly faster than using a single EXA. For the sake of brevity I'll only post silentsnack's solution here but I want to mention that GuavaMoment's solution has an EXA priority quirk, where depending on what EXA's code you paste in first, it runs at either 23 or 26 cycles. silentsnack posted:
Finally, silentsnack has a 22-cycle solution which sadly doesn't fit into the size limit. silentsnack posted:
As you can see labour is now divided among 3 EXAs. I didn't really try but I can imagine getting this under the 75 size limit is impossible. It's easy to make the code (a bit) smaller, but not without having it be slower as well. === Valhalla === Oh. Apparently, that Last Stop location is getting mobbed. Processing. People are choosing to believe the guide even when it's obviously wrong... Why would they think Last Stop has actual good food? And why did the guide change their behavior, but not the highway sign? Everyone seems to be agreeing that the signs were vague. Yeah, that's always the problem with astrology, isn't it? The signs were vague. Hmm... I guess it's easier to care about food than an abstract problem. Nothing more to say about that, Ember? Well, ok. Next up, a hacker battle against =plastered. Time for the next opponent. Are you ready? These unanimous votes make it easy for me to keep count. What, you're my coach now? Would that be a bad thing? That extreme baseball book you found me was full of interesting information. Go on, champ, get out there and win. I think I just threw up into my mouth a little bit. OST: Getting Started It's much the same as before. I first have to beat =plastered before I can play against other people. The assignment reads: To win this battle you must control a majority of the hosts for as long as possible. To take control of a host, write any value to its #CTRL register. Reading from a #CTRL register will tell if you (1) or your opponent (-1) controls the host. - Gain one point every cycle you control more hosts than your opponent. - Lose one point every time one of your EXAs executes a KILL instruction. For more information see "Hacker Battle Domination" in the second issue of the zine. There's a 10 EXA limit, a 100 size limit, and each battle runs for 100 cycles. Take note of the layout of the grid. It's basically linear, but both me and the opponent connect into the one-but-last position on our sides. If I just let it run without doing anything, =plastered sends a single EXA in that first goes to the right (the end of the line), activates that node, and then goes down the path, activating each node in turn. Once it reaches my end it turns back and repeats its pattern. As usual, hacker battles are kinda trivial to win. I can actually just replicate =plastered's code one to one, like so: code:
Since =plastered doesn't bother REPLicating anything, I can just take the single-point loss of executing a well-timed KILL and win every battle with about 90 points. code:
Since the enemy EXA is gone after XB has done its thing, I don't even need the loop anymore. XA could set every #CTRL register once and die, and the rest of the cycles I just rack up points for free. If you don't want to use a KILL, another solution is to just REPL an EXA into every host and have them set #CTRL in a small loop. Because the enemy can only set a single host at once and I overwrite it the next cycle, it'll never hold a majority of the hosts. code:
Do you like it? Winning? And that brings us to our first vote already. To be fair, any chump could've beaten you, =plastered. Anyway, there's someone at the door. Sounds like my neighbor, Isadora. To anyone keeping track, the game's opening cut scene took place on Saturday, October 4th, 1997. It's now Tuesday, November 4th, so exactly one month has passed in-game. The previous cut scene with Isadora was on October 8th. Hey... Sorry I haven't been in touch. Things are a little crazy at work right now. They promoted me to a new position, and... well there's just a lot going on. I didn't notice this before but Isadora is actually wearing somewhat more formal clothes than in her previous cut scene. A nice touch. Isadora offers me a plastic bag with something inside of it. It's moderately heavy. Maybe a couple books or something? You like puzzle games, don't you? I remember you being a fan. I used to play games with my sister sometimes, but she moved to Japan a few years ago. She sent me this game, but I guess I can't play it because of the region lock. Looks fun, though. I thought maybe you could get it working. You always were good at that kind of thing. Isadora sighs. I have to go. So much work to do... really hope this job doesn't eat me up. Okay, bye for now. Speaking of puzzles, the last page of the second zine has some nonograms, also known as Picross or paint-by-numbers puzzles. Here's the instructions and the first puzzle. Since there's not much for the thread to do with these hacker battles, why not do one of these? If you want to share your result please use spoiler tags so other people get a chance to solve it for themselves too. We'll check out Isadora's video game later. First things first - I can barely hold a controller right now since the Phage seems to be acting up in my left hand. First it was your arm... now it's your hand. And that brings us to our second vote.
|
# ? Apr 23, 2022 14:44 |
|
Sure It's getting bad. I'll have a look at that fill-in-the-blanks later though.
|
# ? Apr 23, 2022 15:13 |
|
Sure What? I'm fine
|
# ? Apr 23, 2022 15:46 |
|
berryjon posted:Sure
|
# ? Apr 23, 2022 17:38 |
|
berryjon posted:Sure nonogram:
|
# ? Apr 23, 2022 18:19 |
|
Cryptic!
|
# ? Apr 24, 2022 03:22 |
|
Part 24 - Mitsuzen HDI-10 - Left hand === Trash World Inbox === Thanks cardinale and biosterous for the nonogram submissions. biosterous posted:I'm not entirely sure what it depicts. It kinda looks like a disk in a cartridge, but it doesn't have the same shape as the Redshift disks. It might be for something we have yet to see. === Mitsuzen HDI-10 - Left hand === Do you like it? Winning? All votes went to "Sure". Sure. Of course. That's how human brains are designed, aren't they? To like winning. So that you will always try to win. It's a very simple design. Any time I start to discredit myself for being too simple, I think about human brains and feel a little better. Oof. I mean, I don't know about clones, but the main problem with most conspiracy theories is that they assume a level of government competence we've never seen in real life, so I'll have to give hydro credit for that, at least. Anyway, I need to take a break for a moment and first do something about my Phage infection. First it was your arm... now it's your hand. Three votes for "It's getting bad". Yeah, it's getting bad. I can see that. Fortunately, it looks like you can easily access the nodes connected to your median nerve. You'll just need to make a small incision in your ventral forearm. Better watch out for that artery, though. This is one of those choices where all options lead to the same dialogue. Ugh. Sounds like you're getting used to this. That's good. It's nothing to be squeamish about. OST: EXA Power All right, here's what I need to do. - There are three nerve signals that need to be relayed: muscle control (M), which runs from your central nervous system (CNS) to your hand (HND) and heat (H) and pressure (P), which run the other direction. - For each signal, read a value from the input nerve and relay it to the output nerve. Repeat ad infinitum. - It is not necessary to leave no trace. Your EXAs should be written to operate indefinitely. - For more information see "Debugging the Phage" in the first issue of the zine. Hmm. Looks like the main challenge is one of 'bandwidth'. Using the M register is usually fast, but you can only have one global signal per cycle. Having EXAs running back and forth is slower, but you can have multiple, with the limit being that you can only have one EXA traverse any specific LINK at one time. I think I'll start with the M solution and try to start optimizing for low activity since that seems easy, if not very fast. Now, sending messages from all three nerves in parallel is hard. Getting that synced up so the right EXA gets the right message. So, what if we make it simpler and just... don't? For the low activity we need to start with one EXA and REPL from there to have the minimum amount of LINKs. code:
Next, the LEFT EXA starts sending and the RIGHT one starts receiving, exactly 14 signals. code:
After "completing" the M nerve, it's time to LINK to the next nerves. Importantly, the RIGHT EXA needs to switch to sending and the LEFT one to receiving. When 14 signals have been sent in that round, they need to move on once more, but then RIGHT needs to keep sending. So I need a contextual swap of some sort. Here is the complete working program. This is where the X register comes in use. Once either the SENDLP or RECEIVELP loops are done, the EXA LINK to the next host in its direction (as stored in X), and then uses the value of X to determine whether it should be sending or receiving. So, in summary: - In the first iteration, LEFT starts out sending and RIGHT starts out receiving. - In the second iteration, the above test is first run, which sets RIGHT to sending and LEFT to receiving. - In the third iteration, the test is run again, keeping RIGHT to sending and LEFT to receiving. - After that, if the test didn't cut off the program after getting all expected signals, the EXA would try to link to a non-existent host and die. This leads to a strange solution where the nerve signals are handled nerve by nerve. Results: 181/29/9. The top percentile scores stand at 37, 24, and 9 respectively. I can make a small size improvement by moving some LINK instructions to inside the SEND and RECEIVE marks. code:
Let's look at cycle count instead. My first idea involved files. I'm still using the "we only need 14 signals" hack, but this time, three EXAs read 14 signals each into a file, take that to the recipient nerve and write from the files to there. I unrolled as many loops as I could, although the fact that the different EXAs need to move in different ways makes it hard to keep track of their state. code:
After the EXAs are done they fall through into some other code that tries to do things, but it doesn't matter, by then the tests have finished. Runs at 47/72/24, which is still 10 whole cycles away from the top percentile. Most of it wasted on walking back and forth. I think I can't get any better without involving the M register. At this point I realized that while syncing the M register is hard with three pairs of EXAs, it's surprisingly easy with two. Since an M communication step always takes two cycles (for the first EXA to publish it and then for the second to read it), using two pairs you can send one message each cycle, as long as you make sure to alternate every cycle. So, what if we change two of the nerves to make use of M, while keeping the 'file transfer protocol' EXA for the third one? Because walking takes so much time, it's probably best to use the file EXA for the M nerve, since that one's closest. I'll show you the end result because my intermediates were very confusing, dirty code. XA is the file EXA. It's now much simpler after I removed all the logic. LINK to M-CNS, read 14 values, LINK to M-HND and write them. XB handles the two other nerves. The rightbound (top half) part simply goes to the nerves and starts reading from them. Notice that the furthest EXA is exactly one cycle off from the other one (through the LINK 3 just after the REPL, so the H nerve starts sending first, causing the P one to wait a cycle, and then send, and since there's no loops or anything, just 14 repetitions of the COPY to M, they will keep alternating. For the left side, the two EXAs also are one cycle out of sync, but there it's required to use an actual two-cycle loop. If they read from M every single cycle, which EXA reads what becomes completely unpredictable. This solution started off as a one-EXA one too, but I noticed that after I'd cleaned up the code, the file transfer was the bottleneck by just a few cycles. Making it into a dedicated EXA solved this by removing the need for it to REPL several times. I still had to make sure to send it ahead of XB. Anyway, this runs at a nice score of 37/70/19. By the way, from this solution it isn't too hard to make something that actually keeps running forever, although it'll be slightly slower. code:
I have the top percentile score in cycles and activity, but didn't quite get it in size. As always it'll be interesting to see what you come up with. Do you ever feel like it's a losing battle? This constant effort to maintain your physical body. The first vote. Next time, we'll finally get to take a look at this video game Isadora got us from Japan, a game for the Sawayama WonderDisc console. Let's see what Ember has to say. WonderDisc games are restricted by region locks. Why? And that's the second vote.
|
# ? Apr 30, 2022 17:02 |
|
stay in the moment / business reasons
|
# ? Apr 30, 2022 18:09 |
|
Entropy always wins eventually, and I guess "business reasons" supposed to be a euphemism for money?Carbon dioxide posted:I feel like this might be the right approach to get to the smallest size. There's actually some duplicate code in there. But I can't quite figure out how to get rid of it. code:
Carbon dioxide posted:Runs at 47/72/24, which is still 10 whole cycles away from the top percentile. Most of it wasted on walking back and forth. I think I can't get any better without involving the M register. Here we can do some shenanigans that rely on something from the zine: "nerve voltages oscillate around -70mV but can spike up to 50 or down to -120" but here if we look at the testdata M shows all the characteristics but I think this is the first time we've seen sensory nerves like H and P that always stay near -70. Why is that useful? It means they're all 2-digit numbers and always have the same sign, but EXAs can handle 4-digit variables, at which point you can probably guess where this is going... code:
|
# ? Apr 30, 2022 18:33 |
|
Carbon dioxide posted:
Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21 I have a 24 line solution that has two exas cycling between the nodes on the left and right, transmitting (or receiving) one value before moving to the next node. 155/24/115 silentsnack continues to otherwise kick my rear end.
|
# ? Apr 30, 2022 22:54 |
|
GuavaMoment posted:silentsnack continues to otherwise kick my rear end. TBF quite a few times you've posted solutions better optimized than mine, in one stat or another, and it might not have been obvious but in going back through the game I've used some tricks derived from your posts, which I probably never would have thought up on my own. edit: ...or in some cases we've independently come up with the same technique, like this one GuavaMoment posted:Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21 silentsnack fucked around with this message at 01:52 on May 1, 2022 |
# ? May 1, 2022 01:47 |
|
silentsnack posted:TBF quite a few times you've posted solutions better optimized than mine, in one stat or another, and it might not have been obvious but in going back through the game I've used some tricks derived from your posts, which I probably never would have thought up on my own. I completely understand. When I did the Spacechem LP, often times rather average middle of the pack solutions had a really clever idea inside it, just not perfectly optimized. It was always fun to find those and show them off. This level was one I knew there were way better solutions, I just couldn't get there. I'm feeling pretty good about my solutions for the next level, even before I go off one more time to see if I can improve (first I have to figure out what the hell I did since I never annotate anything).
|
# ? May 1, 2022 02:30 |
|
Everyone eventually loses / Big corporations always want control...
|
# ? May 1, 2022 05:02 |
|
Everyone eventually loses / Big corporations always want control
|
# ? May 1, 2022 17:59 |
|
Part 25 - Sawayama WonderDisc === Trash World Inbox === silentsnack posted:
As for speed: silentsnack posted:Here we can do some shenanigans that rely on something from the zine: "nerve voltages oscillate around -70mV but can spike up to 50 or down to -120" but here if we look at the testdata M shows all the characteristics but I think this is the first time we've seen sensory nerves like H and P that always stay near -70. Why is that useful? It means they're all 2-digit numbers and always have the same sign, but EXAs can handle 4-digit variables, at which point you can probably guess where this is going... About my 37 cycle solution: GuavaMoment posted:Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21 There was also an interesting discussion in the thread about learning from each other's solutions. Yes, I've been doing that during this LP as well, many of your ideas went into later puzzle solutions. I don't remember all your ideas nor do I know how to apply some of them in specific situations, but it has helped me come up with better solutions overall. === Sawayama WonderDisc - Drive Controller === Last time, I fixed my hand. Do you ever feel like it's a losing battle? This constant effort to maintain your physical body. One vote for "stay in the moment", and if I interpreted the votes correctly, three for "everyone eventually loses". Everyone eventually loses. I wonder if I'm the same way. Only time will tell. Ah, yes, definitely the music industry. I had nothing to do with this. So, to play that game Isadora got me, I'll need to disable the region lock on the Sawayama. WonderDisc games are restricted by region locks. Why? Two votes for "business reasons" and also two for "big corporations". Time to get out the two-sided die again. Business reasons, I guess. Artificial scarcity? You wouldn't want gamers importing titles too easily. The less effort it takes, the less special it is. Hmm. OST: Getting Started Let's see what I have to do. - Modify your WonderDisc, which normally only plays SSEA region games, to play games from any region. - The SSEA region code is available in file 300. - It is not necessary to leave no trace. Your EXAs should be written to operate indefinitely. - For more information see "Hardware Hacks: Sawayama WonderDisc" in the second issue of the zine. Okay, so make a copy of whatever it needs from the disc but overwrite its region code. But first I need to unlock the system using that key in the zine. Let's start with that then, so I can see what I'm dealing with. code:
The key gets filled in on that display in the DISC host, and... I'm in. A whole lot of track files. Remember, the little lock icon after the file id means you can't move or change them (which makes sense for read-only game discs). The files contain four-digit numbers, with the region code interspersed. I have to find the right track, make a copy in the buffer host with the updated region code, and repeat. I am going to need the M register no matter what, because copying a file with a single EXA would require dropping it and picking up the copy repeatedly. So let's just get the data to the BUFFER host directly. Replacing the region code is a bit tricky because it requires fiddling with the limited set of EXA registers. I'll first get the file copy code itself working. After unlocking the disc: code:
As soon as a file is dropped in the BUFFER, this unusual black EXA comes out of the Reality Processor, grabs the file, and takes it in. The processor notices the file has the wrong region and it'll throw an error. But... that makes me wonder, can I mess with that black EXA and just take over entirely? Turns out you can kill it, but this fails the assignment. Doing so nets us the DISC_READ_ERROR steam achievement, with description "It was just doing its job...". Now I'm feeling bad. Anyway, the final thing I need to do is overwrite the region code. Now, I considered doing that while copying the file. But that's hard. You can't check directly against M because that will "use up" M. Using X as an intermediate won't work either, because I need a place to store the new region code. And I can't use T because I need to test if a value needs replacing. Let's instead go through the file a second time to change the code. Ignore that useless HOST command, I just wanted to know what that host was called. To save a cycle, XB reads the region code into M and XA stores that into X once the disc is unlocked. Once the writer is done, it will REPL a new reader/writer, while it holds on to the file and overwrites the region code with the new one in X. Note that TEST F > -9999 can be used to test if something is text. This test will be true for any valid number (except -9999 but that doesn't occur in these files), but comparisons between text and numbers always return false. Let's run it. Hm. Looks like when a small file follows a big file, the small file is sometimes processed before the big one, and the Sawayama doesn't like getting tracks out of order. An easy fix would be to only handle one file at one but I don't want to slow the code down that much. You know, I'm basically using F as an intermediate register now, can't I inline the region update anyway? code:
At 6487/48/94 the solution is rather slow. The top percentiles are 3293, 44 and 3. What's interesting is how far the tenth percentiles are from those numbers: 5584 for cycles and 63 for activity. This shows less people got an actual top score, so optimizing is getting much more difficult. Anyway, I'm not that far from the low size top score. To get to 45 I can replace the duplicate TEST MRD code with a jump, and then move the OVERWRITE elsewhere so the EXA dies by reaching the end of the code. If I do that, I can replace the DROP/JUMP with a REPL. code:
Wait a second, now that the OVERWRITE is a jump and then a jump back, can't I inline that too and just skip if no overwrite is necessary? code:
I don't think I can lower the size much more, so let's focus on the cycle count. Unrolls! There's no point unrolling the reader by itself because the writer needs to do all the checks and is slower anyway. The files seem to be between 6 and 36 entries in size, always a multiple of 6. I can use that but unrolls in combination with jumps (for the overwrite) are always complex. This solution uses the advanced REP syntax. The @{0,1} means "fill in zero for the first repetition, then 1 for the next, and keep incrementing by one." So I have a MARK SKIPOVERWRITE0, MARK SKIPOVERWRITE1 and so on in the unrolled result. This way, with the jumps it doesn't lose its place in the unroll, so no matter what, it checks for MRD every 6 repetitions. 4799/77/64. For my next improvement I have a completely different idea. Can I parallellize the file copying? That requires the M register which is quite occupied... except we also have LOCAL mode. You might think that won't fit in the DISC host but it does. One EXA in global mode can grab a file. Then a second EXA in local mode can grab a second file, and then a third one can use the one empty spot in the DISC to make a new file. I had some code that seemed like it would work but it got stuck when the Sawayama requested the same track twice in a row and the slowest EXA couldn't find it because the fastest was holding it. I went through several complete rewrites before ending up with something that actually works. It still isn't close to the top percentile but honestly, after being at it for several hours I consider this Good Enough. I'll start with XB, which has two purposes. The top half: code:
code:
code:
code:
code:
code:
So, to summarize: - XB checks if two files can be handled at once (different IDs). If so, XA puts them both to work. Once one of them is done, it has to wait for the other so that everything stays in sync. - If the Sawayama wants the same track twice, only the GLOBAL reader runs, slowing down the process but making sure it stays in sync. The result is 3830/98/81 and I'm just glad I got a sub-4000 cycle count. There's no space left for unrolls since the max allowed size is 100. Finally, the 3-activity solution is tricky, but doable. The issue is that since you can't move EXAs around, the M register has to do a lot of duties at the same time. So I have to be smart about it. I wrote a solution but didn't bother it optimizing for anything but activity so forgive me for my ugly code. code:
It starts with unlocking the disc like normal, and REPLing a single writer and reader. The reader is still quite simple: grab the file id which is received through M, then send all data through M, but specifically check for EOF and read the next file when it's done. The tricky part is in the WRITER. It runs in LOCAL mode. There's an M-CONTROLLER EXA that receives all GLOBAL M messages. If it's a number under 300 (a file ID), it sends it on global M again because it was actually intended for the reader but the controller happened to intercept it. If it's anything else, the WRITER needs it, so the MCONTROLLER forwards it in LOCAL mode. Finally, if nobody is sending, the controller sends a 0 to the WRITER to let it know the file is done. So, how do you tell the EXA reading from #TRAK that it should send a new value? That's the neat part, you don't. If you try it with M, all EXAs will intercept messages from each other and you'll end up in unpredictable inescapable loops. Instead, that EXA just has a very long countdown (190 two-cycle iterations) so it waits long enough for even the biggest file to be done. The countdown and all M messages having to go through the controller make this solution slow. That was a lot of work just to play one game. Think it will be worth it? And that brings us to our first vote. Once again, we unlocked a special minigame. This time it isn't Solitaire. It is called HACK*MATCH. Think the console version will live up to the arcade classic? Here's the second vote. We'll check out the minigame next time. Carbon dioxide fucked around with this message at 17:43 on Apr 23, 2023 |
# ? May 7, 2022 20:35 |
|
It's an arcade game? I can't really chip in here for this one. My solution is hilariously slow and large, but if it works...
|
# ? May 7, 2022 20:54 |
|
Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files.code:
Your low line was better than mine, I never tried going back through a file as I'm writing it to check for the region code.
|
# ? May 7, 2022 21:32 |
|
Hacking is obviously its own reward if we're already bothering to play a goofy hacking puzzle game / arcade game? There are a couple of minor tweaks to get the solution smaller the first being to compress the auth sequence so long as the rest of the code to unpack it isn't longer than 12 more lines and/or you can have some parts perform multiple functions. code:
GuavaMoment posted:Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files. Also the longest files are 36 entries, so you only really need at most two EOF checks. And since the file sizes are somewhat predictable, IF we use one way or another to measure how big a file is, we can add a variable delay to make short files wait a bit to make sure they don't get dropped before a previous big file... which at some point requires experimentally finding values that work code:
My absolute fastest solution clocks in at 2265/123/1562 and is mostly the same as the 2304 version except for adding this to the end of XA, make XB/READER do @REP 36 x COPY F M and also instead of XB/WRITER and XC doing the patch substitution in the "buffer" node and simply dropping the output file directly where it's needed, they use our home machine for its extra storage space code:
What this version does differently is that it makes the writer patch files as fast as possible and EOF-crash to drop them someplace they won't cause traffic jams and also won't get picked up at the wrong time by the output bot (which is also involved in one of the achievements). The new XA now enters a loop of spamming clones that start in buffer, run back to home to try to grab whatever the next file is supposed to be, and if they're successful they report the success so no matter which order files get finished, XA only picks up the correct one because we know which filename is supposed to come next. silentsnack fucked around with this message at 23:56 on May 11, 2022 |
# ? May 7, 2022 23:22 |
|
Part 26 - HACK*MATCH Today's update is a bit of a break from the normal puzzles. But before we go there, let's see what ideas you had for the region lock puzzle. === Trash World Inbox === GuavaMoment posted:Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files. silentsnack improved upon this idea: silentsnack posted:Also the longest files are 36 entries, so you only really need at most two EOF checks. And since the file sizes are somewhat predictable, IF we use one way or another to measure how big a file is, we can add a variable delay to make short files wait a bit to make sure they don't get dropped before a previous big file... which at some point requires experimentally finding values that work Finally, silentsnack suggested the following size improvement: silentsnack posted:
=== HACK*MATCH === That was a lot of work just to play one game. Think it will be worth it? Only got a single vote for this one. The hacking is its own reward. Sure. Especially when you get something tangible out of it. Time to play! Yes. But before I do, have I showed you my apartment recently? OST: Apartment The WonderDisc is running, my Redshift is set all set up, I like it. [=plastered] yep [=plastered] thats how it goes My, um, assignment is to score 10000 points in this game. Think the console version will live up to the arcade classic? Two votes for asking for details. It's an arcade game? It is in Japan. You haven't seen the cool cabinets they have? I knew ingesting that corpus of gaming magazines would come in handy. Alright, let's see what this game is all about. This only pops up for a second before the game boots. ... full extent of the jam? I'm sure it'll be fine. Since this is an arcade game, I'm presenting it to you in video format. https://www.youtube.com/watch?v=nZ_wbxaE-Cc After you've watched the video, here's some background information. The music for HACK*MATCH is OST: Let'sハッキング, which translates to "Let's hack" which, honestly would've been a good title for this thread. According to an old post I found online, the instructions page translates to: On the left: to download the file, assemble 4 or more files of the same type by connecting them On the right half: if you line up two of the pressure explosive, you can download all the files of the same type at the same time. There are also three Steam achievements tied to HACK*MATCH: - ゲーマー , for getting 10000 points - 熟練ゲーマー , for getting 50000 points - 究極のゲーマー , for getting 100000 points. Anyway, let's see what Ember has to say about us getting a decent score. Hmm. This game isn't about hacking at all, is it? They took a lot of dramatic license. That's the first vote for today. I was so caught up in that little game I almost didn't notice the knock on the door. Got bad news. The pharm was raided. The cops hauled off the equipment, the sheep and the pigs, the whole thing. It's a real shame. It was a lot of work to genetically modify those animals. They'll probably get culled, too. Sad... So is that it, then? If there's no more medication, I can't slow the spread of the phage... I'll be finished soon. This might not be the end of the story, though. The people I work with, they're looking to get their hands on the real deal now. There's a shipment going out soon, and let's just say a lot of people with better resources than you or me want these meds. There's going to be fireworks. Nivas pauses for a moment to study my face. So. Here's the offer. If you help us grab that shipment, we'll let you buy some of it. Market price. I know it's a lot higher than before, but it's your only choice if you still want it. Your part should be easy too. That is if I understand what you do correctly. Just cut some power. Snip snip. We'll take care of the rest. I'll send you the details. You can decide then. Seeya. drat. Well, I guess I have no choice but to help them. This is something like a heist, isn't it. And with that, we've reached the second vote.
|
# ? May 14, 2022 15:48 |
|
I don't know how you'd make a game about real hacking It is a heist
|
# ? May 14, 2022 16:37 |
|
Nth Doctor posted:I don't know how you'd make a game about real hacking Yes, this exactly. HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's.
|
# ? May 14, 2022 21:50 |
|
Nth Doctor posted:I don't know how you'd make a game about real hacking This is not an emptyquote, it's my vote!
|
# ? May 15, 2022 02:13 |
|
Quackles posted:HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's. Yes, I'm aware of that. I guess I forgot to show it off.
|
# ? May 15, 2022 07:13 |
|
Nth Doctor posted:I don't know how you'd make a game about real hacking Same vote as well!
|
# ? May 16, 2022 22:29 |
|
The only way I found to get 100000 hackmatch points in a reasonable timeframe was to download a lua file (I think) that played for you and ran it overnight. Essentially hacking the hacking game to win a different hacking game. I found it appropriate.
|
# ? May 17, 2022 04:27 |
|
Part 27 - Alliance Power and Light === Trash World Inbox === Quackles posted:HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's. GuavaMoment posted:The only way I found to get 100000 hackmatch points in a reasonable timeframe was to download a lua file (I think) that played for you and ran it overnight. Essentially hacking the hacking game to win a different hacking game. I found it appropriate. === Alliance Power and Light - Streetsmarts GIS Database === Hmm. This game isn't about hacking at all, is it? They took a lot of dramatic license. Well, all the votes were the same this time, that makes for easy counting. I don't know how you'd make a game about real hacking. Hacking is inherently about manipulating systems in ways the designers didn't intend... Whereas a game is usually a set of possibilities within accepted bounds. It seems difficult to reconcile. Well, this got very meta, didn't it? Let's stop for a moment and think about how Zachtronics handles this. Basically, they created a programming language and they made a set of puzzles around it. It is a purposefully constrained language, which makes otherwise easy problems surprisingly difficult. As a professional software developer, it forces me to look at seemingly familiar things in a completely different light. I'm sure Zach had no idea of some of the solutions we came up with either. Of course, for a game like this, you need to make some concessions, such as the test cases often not being completely realistic, or us being able to game them... but I have a feeling Zach is completely fine with the latter. I think a sandbox made out of some basic rules, together with some cleverly designed puzzles that allow multiple solutions within the constraints of the sandbox rules, makes for very good and interesting puzzle game design. This game does it well. And Breath of the Wild's shrines were designed with a similar approach. It just works. As a counter example, I'm thinking Scribblenauts, which barely constrains the puzzle solutions. This allows most levels to be solved in a way that feels too cheap. At that point it might be better to drop the puzzle elements entirely and turn it into a building game such as Minecraft. ...Anyway, that's enough of me rambling about game design. [Ghast] you never know what a guy who thinks he can make a buck will do. We need to help Nivas out so we can get a new shipment of the Phage medicine. This is something like a heist, isn't it. Another clear vote. It is a heist. I didn't imagine such a major operation. Not including you, there are three separate teams. Whoever put this together has some serious resources. I guess that's why it costs so much. Don't worry, I'm working on the money part. You just do your thing. Sure. OST: Leave No Trace The assignment: - Locate the two hosts with the specified hostnames (file 300), which correspond to the target power grid substations. When you've found them, cut the power by writing a value of 0 to #POWR. - For more information see "Network Exploration: Geographic Information Systems" in the second issue of the zine. This is the same GIS system we dealt with before, for the restaurant review assignment (Part 22). LINK 800 for north (top left), 801 for east, 802 for south and 803 for west. However, this time I'll have to use the HOST command to find out the name of each host. It's not possible to test against a host name directly, you first need to load the value into some register with e.g. HOST X. Another complication is that we need to find two hosts. That'll mean some more register juggling. That said, since the grid looks exactly the same, perhaps I can reuse some code from before. It was strongly optimized for that particular case and might not work as well here, but it's a start. code:
People sent in some faster solutions but I prefer to start with this one because, since I wrote it myself, I understand exactly how it works. Next I'll need to include some new code to switch off the right substations. But... why stop there? Can't I just switch off everything? That should be enough of a distraction to pull off the heist, right? I just replaced that NOOP at the bottom with a COPY 0 #POWR. It seems to be working, but there's a bit of an unforeseen side effect: cutting the power to a substation also takes the EXA host offline, making it untraversable and killing any EXAs that are chilling there. It doesn't turn out to be a problem for us, since this optimized code from the previous assignment was written such that EXAs prioritize getting everywhere before they start messing around. But "turn off everything" doesn't work - it fails the "Leave no trace" criterion. However, it does net us the Steam achievement "BLACKOUT", description "Trigger an excessive service outage." For testing if an EXA is in the right host, a sensible solution is to have a value from the file in T, then do HOST X and then TEST X T. As long as we don't need to test the same value twice that should work. I can think of two ways to handle the second value. The first is by sending another full set of EXAs round, carrying the other value. That sounds complicated though, especially with hosts potentially turning off. The other way is an EXA staying home and sending the second value on M constantly. Let's try that. XB grabs the file, sends the first value to M once, where XA can read it before it starts replicating. It then starts sending the second value. In POWERSWITCH, XA reads the HOST to X, compares it against the T value, and if it doesn't match, it compares against M. If it still doesn't match it can just die by divide by zero. This code does turn off the right substations. But the problem is XB hangs forever, which means test cases never finish. Apparently I can't just disconnect my home computer when it's done. Let's think about this one for a bit. How can we solve it? - Because I put the X=T test first, only one of the EXAs doesn't test against M. With 20 grid tiles to check, that means XB will be asked for M 19 times. I could just build a countdown. The problem is that I can't store the countdown value in T because I have to test against it, and I can't put it in X because that's where I'm sending the value from (or I'd have to SEEK in the file which is slow). I guess I could use a second EXA for the countdown that just kills this one. - Alternatively, I could have the EXA that reaches its tile last send a message back, and have XB listen to that with MRD or something. But what if I do neither? I have plenty of space left to just unroll the XB loop 19 times: code:
Not a terrible first score of 50/58/22, but the top percentiles are 20, 22 and 20, so I certainly can do better. Let's start with activity since that one is actually already solved. Because my solution didn't require any KILL commands it's already quite good. But if you look at the gif, you'll see this code was originally optimized to reach the farthest grid squares first. In the SOUTHbound and NORTHbound chunks of codes it first travels to the end before jumping back to check the squares right next to the starting one. All I have to do is remove that old optimization. code:
But wait... undoing an optimization made the cycle count lower? Ha. That just goes to show that EXA optimizations are highly context specific. Premature optimization can lead you into a trap where the optimization doesn't fit the context anymore and it's too late to notice. Anyway, let's look at the cycles some more. I feel the main slowdown comes from the fact that XB can only send a message on M every other cycle. There's a simple way to solve that: add another EXA. code:
What about the other method of sending two EXAs everywhere, each one holding a value from the file? After some fiddling I came up with this code. code:
Having a dedicated EXA to read the file is still slightly faster than having XA do that. The two NOOPs are unfortunate, but without that there are cases when the second EXA can't make it past a switched-off host in time. I actually don't need those NOOPs for the EXAs that go second, so the next step is to selectively remove them. The fastest way I found was duplicating almost all the code into XB. 25/67/40. One thing that might speed up things more if to have both EXAs traverse the grid in different orders, so they block each other less. I tried some small things but nothing seemed to work so far, so if it's possible it's more subtle than what I did. It's also quite possible that the optimizations from the threads for the restaurant review assignment work here as well, but I'll leave that for you all to figure out. Finally, for cycle count, the first thing to do is apply my low-cycle solution from the previous assignment, starting from the 38 solution above. code:
I can save a couple lines by loading something useful in T with the DIVI and then use a countdown loop. code:
Combining the EXAs won't help. Combining COPY F M and COPY M X means you still need two COPY to X commands total (one before and one after the REPL, because files aren't copied when you replicate an EXA). And you need an additional WIPE so the file doesn't end up in the grid. The next obvious improvement would be to implement GuavaMoment's low cycle solution for Part 22. It won't quite work as-is, though. It depended on EXAs trying to grab files and them dying if the file was already taken. Without that, they fill up some hosts entirely and get stuck in a REPL command. I tried 'fixing' that by putting some KILL commands at the end but that just causes them to kill valid EXAs holding the other substation value. Putting it in the solution where XB just sends the second value over M many times doesn't work either, because the amount of times M is requested becomes variable. So, I will stop here and wait to see how you got a better cycle count than 25 and a smaller size than 28. Looks like the heist went flawlessly. Congratulations, now a criminal cartel will sell the medication you helped steal back to you for not much less than the market price. Oh well. At least they'll let you buy it from them. Now that this is over with, I have a question. Is theft morally acceptable in situations like this? The first vote. Next time, another hacker battle, this time against deadlock. Onto the third of the tournament battles... Is each match against a better programmer than the last? Is it?
|
# ? May 21, 2022 21:16 |
|
It's complicated Better is Subjective And why does a pharmaceutical company not have emergency backup power for the inevitable refrigeration units and the like?
|
# ? May 21, 2022 21:39 |
|
|
# ? May 5, 2024 21:25 |
|
Carbon dioxide posted:So, I will stop here and wait to see how you got a better cycle count than 25 and a smaller size than 28. 18 cycles! code:
My lowest size is 25, and I know 21 is possible. code:
|
# ? May 21, 2022 21:50 |