|
No. Doesn't matter... they're all going down.
|
# ? May 21, 2022 22:13 |
|
|
# ? May 1, 2024 13:49 |
|
It's complicated and Better is subjective.
|
# ? May 22, 2022 02:23 |
|
Jade Rider posted:It's complicated and Better is subjective. Agreed.
|
# ? May 22, 2022 02:59 |
|
Jade Rider posted:It's complicated and Better is subjective.
|
# ? May 22, 2022 04:35 |
|
Jade Rider posted:It's complicated and Better is subjective. Not An Emptyquote
|
# ? May 22, 2022 21:16 |
|
Jade Rider posted:It's complicated and Better is subjective. GuavaMoment posted:I know 17 cycles is possible though. (.....) My lowest size is 25, and I know 21 is possible. once again I'm blaming you for making me do this. because that's definitely a reasonable thing to do. also because it was easier to copypaste and tweak your code than to untangle my previous 19 cycle kludge code:
code:
silentsnack fucked around with this message at 14:48 on May 26, 2022 |
# ? May 25, 2022 23:27 |
|
These two lines: DIVI 0 T #POWR SUBI 1 T #POWR oooh that's nice, that alone might save me lines and cycles, it's very elegant. The first crashes the exa when it's in the wrong place, and the latter does nothing when in the wrong place. I love it!
|
# ? May 26, 2022 00:03 |
|
Part 28 - Deadlock's Domain === Trash World Inbox === My top scores for last week were 25 cycles and a size of 28. As usual, you people came up with some impressive improvements. Let's start with GuavaMoment. GuavaMoment posted:18 cycles! silentsnack managed to improve this code by a cycle: silentsnack posted:
As for size, GuavaMoment and silentsnack both have neat solutions too. GuavaMoment posted:My lowest size is 25, and I know 21 is possible. silentsnack posted:
=== Deadlock's Domain === 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? One vote for 'No', and a whole lot for 'It's complicated'. It's complicated. It doesn't seem that complicated to me... But then, I've grown. Processing. Let's continue. Deadlock wants to battle me. In their own domain. Onto the third of the tournament battles... Is each match against a better programmer than the last? Most votes went to 'Better is subjective'. Better is subjective. That's how I would order it. Like a video game, you know? It makes for an easy narrative structure. ...whatever you say. OST: Getting Started Another hacker battle, like we've seen before. The assignment states: To win this battle you must grab files as they spawn in the central hosts and bring them back to your host. Reading the #FILE register will tell you the ID of the most recently created file currently in that host. - Gain one point for every file you bring back to your host. - 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 limit of three EXAs per side. If I just start the simulation, files (with a music note icon) start spawning in the central hosts. They just contain random strings of numbers. Deadlock's EXA sets up camp in the Backstage host and starts replicating EXAs from there that grab files and bring them to Deadlock's home. Let's start with just copying that idea. code:
Anyway, let's see how well the copycat solution works. Huh. I was thinking about more complicated solutions but this simple one already gives me a perfect score. Looks like for some reason my solution is just slightly faster than whatever deadlock does. Hell, even something simple like this gives me an S+: code:
Curious how enthusiastic everyone gets about the battles. Something about competition really energizes the spectators. It makes me wonder... How do we complete her sentence? The intro for the next level has no question for the player, so that was the only vote for this update. Instead, to spend the time, here's another nonogram from the second zine. This one should be a bit harder. Please put your solution in spoiler tags so other players have a chance too.
|
# ? May 28, 2022 13:08 |
|
Looks like this?
|
# ? May 28, 2022 14:35 |
|
ready2hack
|
# ? May 28, 2022 17:08 |
|
What the point is
|
# ? May 28, 2022 22:08 |
|
What the point is
|
# ? May 28, 2022 22:14 |
|
Part 29 - Xtreme League Baseball === Trash World Inbox === Last time, I ended with another nonogram puzzle. Several people solved it, here's Regallion's submission. It's a computer, of course. === Xtreme League Baseball === Last time, I beat deadlock in a hacker battle. Curious how enthusiastic everyone gets about the battles. Something about competition really energizes the spectators. It makes me wonder... Two votes for "What the point is?" What the point is? Perhaps there is no immediate point. I am able to tolerate ambiguity. Even though I may not always like it. A bit scared of me, are they? Looks like the next assignment has to do with a Baseball database. You should be glad I've been reading up on sports. Remember when I said I'd figure out the money situation? I've designed a new rating system for extreme baseball players. It's based on a multivector analysis of all the stats I could find. In other words, I have a way to predict winning teams that's pretty much infallible. A few bets here and there and I'll be rich. Um, I don't think you can predict sport match outcomes to such a degree. But okay, if you say so. OST: Code and Registers The assignment: - The hosts active and penalty contain files that correspond to extreme baseball players (files 200-299), along with a directory file that contains a list of those files' IDs (file 199). Each player file contains their name and the following statistics in this order: BA, ZA, APB, WRT, OI, OD, PC and PS. - Create a file in your host with the name of the player with the highest score using EMBER-2's algorithm: SCORE = (BA + ZA + APB) / 3 + (WRT * OI) / OD + (PC - PS) * 20 - Players in the penalty host should be ignored, as they are currently banned from the game. Okay, so all the action is in the active host. I'm not really familiar with the details of Xtreme Baseball, so I don't know what those stats mean but this assignment looks an awful lot like math. I'm sure I can figure it out though. Before that, let's have a bit of fun. Having an EXA go round the diamond gets us the Steam achievement HOME_RUN, description "Participate in America's new pastime." Let's start by just writing the algorithm. Ember's formula has the stats in the order they appear in the files, which makes it simple because I don't need to SEEK back. code:
Another EXA will have to figure out which player has the highest value. An initial attempt: code:
There's still some stuff missing, for instance how do you clean up at the end? Since the code so far only has an activity of one (the one LINK to the active host), I decided to first solve these last bits with low activity in mind. That was harder than it seems, though. XA creates replicas so fast that the M messages start interfering with each other. There are solutions such as having them wait for each other, but to do that in a fast way, you'd need to prevent the last one from getting stuck which might require a KILL or something. Since that's not allowed for low activity, I went for a slower solution instead. code:
code:
This solution runs at 168/49/1. Top percentiles are 79, 39 and 1 respectively. Time for other optimizations. This code speeds things up significantly, with 101/52/3. The main change is that I have a separate TIMER EXA which allows the algorithms to run in parallel, only synchronizing for the parts where they need M traffic. The TIMER EXA also checks when there's no EXAs left to send, in which case it goes home to kill XB and clean up the file faster than XB could do itself. By the way, that FJMP followed by a JUMP at the bottom looks a big ugly but if I don't do it I need an extra NOOP for some reason, which makes the solution a single cycle slower. At this point I thought of something silly that worked for other assignments: what if I don't calculate anything and just put a file for each name in the home host (9 squares, there's never more than 10 active players, so with some luck we could make that work). No dice, the devs thought of that one, and having multiple files in the home host fails the tests. I spent a while looking for further speed improvements. I have several ideas. If it would be possible to simplify the algorithm itself that would save time. Another way would be to parallellize the greatest score check somehow, for instance by comparing them pairwise. But with the limited functionality of the single M register I couldn't get anything to work. Optimizing these assignments is really getting quite hard at this stage of the game. I'll try to get a lower size now. code:
The main trick is to get rid of the code that reads the file IDs from file 199. The alternative (looping through all valid file IDs) isn't really any less lines of codes, but because this is so much slower, only a single NOOP in the GRABLOOP is enough to prevent M communication in the wrong order. Having XA KILL XB is also slightly less code than having XB handle this. I tried removing the initial COPY 199 X and funnily enough that works in most test cases - running the algorithm on the index file just happens to return a negative score most of the time, which is ignored by XB. Sadly, there's at least one test case where it generates a high positive score and writes an invalid result, so we do need this line. That's it for optimization this update. Okay, uh. Hmm. Processing. It turns out sports betting is not, in fact, a good way to make money. You should have said something. The first vote. Did you know people pay real money for items in online games? And the vote for the intro for next week's assignment.
|
# ? Jun 4, 2022 15:22 |
|
You'd Be Smarter than that Losers Seriously, sports cannot be reduced to math like that.
|
# ? Jun 4, 2022 15:31 |
|
Yeah, we're getting to the point where optimization is really really hard. My lowest line is worse than yours at 42 (it significantly uses MODE for what seems like the first time), but I can save a bunch of cycles. I send the score results twice, one to do the testing directly, and again to save/void the data if needed. Probably not optimal but ehhhh I guess it works. 86/47/3. 75 cycles is possible! Hmmm, 11 cycles off, and I send about...11 values over M that I theoretically don't need...code:
|
# ? Jun 4, 2022 16:53 |
|
Similar to the Wonderdisc puzzle, we can reduce cycles for logic-jumps by @REPing some of the slowest and most repetitive processingcode:
As for size optimization, what if we compared scores directly instead of sending a bunch of busywork transmissions and VOIDing them? code:
berryjon posted:You'd Be Smarter than that silentsnack fucked around with this message at 20:45 on Jun 4, 2022 |
# ? Jun 4, 2022 17:38 |
|
berryjon posted:You'd Be Smarter than that
|
# ? Jun 4, 2022 20:07 |
|
I vote for Better you learn on your own... and Real money for virtual items?
|
# ? Jun 4, 2022 21:06 |
|
Quackles posted:I vote for Better you learn on your own... and Real money for virtual items? Likewise. We can put a bit of snark in it.
|
# ? Jun 4, 2022 22:53 |
|
Quackles posted:I vote for Better you learn on your own... and Real money for virtual items?
|
# ? Jun 5, 2022 06:57 |
|
You'd Be Smarter than that Real money for virtual items?
|
# ? Jun 5, 2022 10:33 |
|
Part 30 - King's Ransom Online === Trash World Inbox === Last time, we had to write an algorithm to calculate the supposedly winning player in Extreme League Baseball. It was quite a hard one to optimize, but as always you people came up with some ideas I'd never thought of. GuavaMoment posted:
silentsnack posted:Similar to the Wonderdisc puzzle, we can reduce cycles for logic-jumps by @REPing some of the slowest and most repetitive processing As a side effect, this makes the timing independent of the number of EXAs, meaning that TEST X > 341 trick can be used so EXAs with a score that never wins die immediately. I actually thought of that but couldn't get it to work because it kept throwing off the timing. silentsnack posted:As for size optimization, what if we compared scores directly instead of sending a bunch of busywork transmissions and VOIDing them? Joking aside, this solution hurts my head. After running the algorithm, each EXA sends the result on local M. The very first one gets voided by XC to prevent the solution from getting stuck. It then checks if another one is sending on M. The timing works out quite precisely - if there's nothing on M this is the last remaining EXA, and the DISJUNCTION jump makes sure the name is written to the file by XB. If there a value on M, this EXA tests if it has a greater algorithm result than the incoming value. If not, it dies. Otherwise, it jumps back to CHIPOTLE and sends its high score again. At that point the other EXA will be waiting to TEST and since it will have the smaller value, it will die. Another EXA will be ready to send its M and the pattern repeats. So the EXAs are literally playing an elimination tournament against each other, the last one standing will have the high score. Very clever. I'm happy to see that nobody changed the core math code. That means I didn't miss any obvious optimizations in there. === King's Ransom Online === Okay, uh. Hmm. Processing. It turns out sports betting is not, in fact, a good way to make money. You should have said something. Four votes for each between the threads! It comes down to a coin toss this time. I thought you'd be smarter than that. What does that mean? Don't put this on me. This is all happening because I'm trying to help you. Let's continue. Don't gaslight me, lady. Next up is King's Ransom Online, the massive multiplayer game that's all the rage right now. Did you know people pay real money for items in online games? One vote for "it's pretty common", three for "Real money..." and four for "Losers". Feeling snarky, I see. Losers... It's apparently a booming business. Some people even make their living from games this way. Normally, it takes a lot of skill and perseverance. But if someone were able to change the ownership of these digital objects... Theoretically, that person could become very wealthy overnight. I'm not suggesting that you do that, of course. But I am suggesting you try. I mean, I do need the money. And it's not like I'm stealing real objects, right? Let's jack in. OST: EXA Power The assignment: - Reset the ownership of all castles and sub-buildings to P00000 (file 300), the player ID for unowned buildings. - To ensure that there are no witnesses you must first disconnect all connected players. Terminate every EXA in every host before changing any castle or sub-building files anywhere in the network. If you leave an EXA alive in one host while changing a file in another you will fail the task. - For more information see "Network Exploration: King's Ransom Online" in the second issue of the zine. More information in the zine. Alright, ignoring all the old-timey text and that ad for a wristwatch, looks like players are represented by EXAs, and there's two main types of files: ones representing buildings and ones representing weapons. Each host has a building 200 which is a castle, and a bunch of sub-buildings. Generally, the file IDs of sub buildings are in the castle file: However, there are cases where sub-buildings have their own sub-buildings so I will need to check for those as well. I can't see the details of the weapons yet because they're all being held by foreign EXAs. What I do see is two counters in the Goals: there are 14 EXAs to terminate and 26 buildings to clear. This differs a bit between test runs. What seems consistent is there's always between 2 and 6 buildings per host, including the castle, and between 1 and 3 EXAs. Well, let's start by terminating the EXAs. code:
You can see the EXAs do represent players - killing them makes their characters disappear from the screen in the top right. The weapons are as described in the zine. Unfortunately, both the weapons and buildings have IDs in the 200-300 range. I won't be able to just loop over all file IDs to only change the buildings. I'll just start with the obvious solution then, grabbing the castle, updating its ownership, and grabbing any sub-buildings from its list. I already got an EXA in every host, and the assignment says I can't start messing with the buildings until the foreign EXAs are gone, so I'll just use the same ones. code:
After the KILLs, the castle file ID (200) is copied into X, and then my EXA grabs the file, seeks to the player ID position, and overwrites it with the null id. For each following sub-building id, it loads the value into X and makes a new EXA that grabs it. This recursive code should get all buildings, no matter how deep it has to go. However, this solution doesn't quite work. The first XA already starts messing with the buildings before the last one has killed all the foreign EXAs. I can just start with an ugly workaround, just have everything wait until all foreign EXAs are gone. Six NOOPs or a short loop do the trick. 48/35/25 as an initial score. The top percentiles are 32, 26 and 25. What's also interesting is the huge distribution in size. I can imagine that this puzzle is much more devious if you can't figure out recursion. Luckily, I'm quite familiar with it. Let's look at optimizations. First of all, to lower the cycle count, instead of having that whole list of NOOPs I can make it conditional - earlier EXAs have to wait longer. code:
I can shorten the REPL loop by reading hardcoded LINK ids from M instead. code:
Sending the player ID over M costs two cycles at the top, while we're wasting cycles with NOOPs further down. If I send that message later, I need to send it 6 times but with some smart timing I can save two cycles. code:
Starting from the lowest size code above (the 34 LoC one), the first thing I noticed is that the two lines SUBI 807 T T, DIVI T 2 T aren't strictly necessary. As long as the file fiddling doesn't happen too early it's fine. Leaving those out just makes the WAIT loop run 800-odd times and that makes it slow, but it still works. And since I need that wait loop anyway, why not put the KILL in there? That way it gets executed plenty of times but it saves two additional KILL lines. code:
I tried some more things, such as putting the REPL LINK in a loop. That didn't work out because T and X are already occupied and adding a counter in some other way costs a lot of lines. It's also possible to get rid of getting the subfile ids from each file. Use a simple loop counting down from file id 300 and trying every id in turn. However, you do need an extra check to not write to the weapon files. That's doable - just check if the second value is a number or not. But that check made it longer than the current solution. So this is the best I got. --- Finally, there's activity. I already have top percentile activity, but could I go beyond? Well, no matter what I need 7 LINKs to get the EXAs in position. Add to that 3 KILLs in each of the 6 hosts for the 25 score. However, the test with the highest number of foreign EXAs has 17 of them. That means that theoretically, you could save one more activity point. To do so, I'd need to figure out how many foreign EXAs there are per host. How would you do that? You can't communicate with them. The only thing I can think of is fill the hosts with your own EXAs. Once a host is full, both LINK and REPL instructions block until a space is freed. I spent some time (actually, way too much time) attempting to build a solution. It couldn't quite get it working, but I feel I'm quite close. I'll share what I have, maybe someone in the thread has the missing link. code:
If you replace SUBI 10 X T with COPY 3 T to hardcode the number of kills, it does run with an activity of 25, proving that the logic is sound. It's necessary to create file grabbing EXAs twice, because KILLs prefer own EXAs. The one problem I couldn't resolve is the fact that as soon as the XA counter starts reading from M, those file grab and filler EXAs start dying, so the blocked REPL one starts running again, and sends to M before the counter is done counting, causing a wrong total. I tried a lot of different ways to slow them down, but nothing quite worked. That's it for optimizations. But there's one more thing. This level has a Steam achievement tied to it, but it's quite tricky to get. It is called KLEPTOMANCER, and you might figure out it's for this level by its description, Verily hath every item been unduly purloined. What you need to do is move all weapons into the home host while leaving buildings alone. Since sub-buildings aren't locked to a host this takes a bit of work. At least for an achievement none of the regular rules apply - the EXAs don't need to finish, for instance. code:
I think this is right. Steam achievements don't trigger a second time after unlocking them in a previous playthrough, so I hope I understood the unlock requirements correctly. Moving on... Oh. They just shut the whole game down. Something about "hackers" or something? I guess that means you. People are taking this so seriously. The first vote. You know what really moves people? Art. And the vote for the intro for next time. A fun fact to end with: there's an annoying little bug in the game, where if you beat a level, and then directly quit out of the game without going to the 'desktop' (level select with Ember etc.), the next part of the CHATSUBO chat doesn't trigger. I have no idea if it catches up eventually or not. While working on this update I shut down the game without properly exiting, and the bug triggered. Since I like to keep the chat in sync with the rest of the story, I had no choice but to resort to hacking the save files to "unsolve" the level so I could re-trigger the chat. It feels extremely meta, but there you have it.
|
# ? Jun 12, 2022 16:59 |
|
God forbid NFTs become involved. It is real money... I already don't like where this is going...
|
# ? Jun 12, 2022 17:52 |
|
Alright here we go! Speed time. 28/85/33code:
Now for low line - 1623/20/25. So we need each exa to go into rooms numbered around 800, and then grab files in the 200s, right? Start at 806 and count down attempting both! Enter every room from from 0 to 806, grab every file from 0 to 806. After thousands upon thousands of exas die, the countdown reaches 0 and die for good. Weapons have a number in the second file spot, so those get excluded. code:
|
# ? Jun 12, 2022 18:05 |
|
GuavaMoment posted:No one on my friends list has a faster time, and one person ties me on lines, so this might be a time I can best silentsnack. There's one catch though - two friends have 24 for activity, and I'm not sure how that's possible. As you've tried to do! Yeah my best scores were 28 cycles and 22 lines, and my fast solution is mostly similar except significantly less efficient due to laziness and aiming for a goofy solution gif
|
# ? Jun 12, 2022 18:48 |
|
Their loss, that's why art is powerful.
|
# ? Jun 12, 2022 19:11 |
|
Anaxite posted:It is real money...
|
# ? Jun 13, 2022 05:18 |
|
GuavaMoment posted:There's one catch though - two friends have 24 for activity, and I'm not sure how that's possible. As you've tried to do! I got it! https://i.imgur.com/L4G8gdY.mp4 Code will be in the next update.
|
# ? Jun 13, 2022 18:21 |
|
Carbon dioxide posted:I got it! I have done something quite different than you, and I still need to optimize a bit. I'll assume you'll want to wait until you post your solution for me to post mine. I'm around 85 lines right now, but about 4-5x slower.
|
# ? Jun 14, 2022 06:15 |
|
GuavaMoment posted:
I'll just post mine and we can compare. My solution boils down to the same thing I did before except by filling the host with EXAs, I first count the building files, then I have an EXA fill up the host with files (which makes communication and timing significantly easier), and count how many it can drop until the host is fill. Whatever number remains corresponds to the number of foreign EXAs. code:
|
# ? Jun 14, 2022 07:10 |
|
I see you at LINES 100 and I thought the amount of lines was going to be the limiting factor in the solution, so I used my really low line filegrabbing solution as the base. 1823/81/24 There's a LOT of timewasting to get everything synced up. I still try to grab a LOT of non-existent files which wastes more time. Lower any of the timewasting values by even 1 and something breaks.code:
|
# ? Jun 15, 2022 05:07 |
|
https://www.pcgamer.com/zachtronics-is-making-its-final-game-last-call-bbs/quote:Last Call BBS seems like a culmination and combination of everything Zachtronics has done over the last decade-plus of indie game development. It's a collection of eight puzzle minigames ("although some of them are quite big, at least the size of TIS-100"), all accessed through a fictional retro computer called the Sawayama Z5 Powerlance.
|
# ? Jun 17, 2022 07:22 |
|
i hope his post-development career is long and rewarding and that people are good to him and people keep learning from his rad games
|
# ? Jun 17, 2022 22:30 |
|
Day 1 purchase, this looks supremely my jam. I've only got hooked on Exapunks in the past few weeks but its been really fun playing along with this thread. My code is absolute garbage (but it works!) and its fascinating seeing much more elegant solutions. I'm now waaay past the thread, I'm on getting a valid credit card number out of a garbage file but I can't wait to see the better way of aligning the satellite. I swear I wasted so many cycles on the alignment that by the time I got to the second half I was already nearing code limits.
|
# ? Jun 18, 2022 18:36 |
|
Part 31 - KGOG-TV === Trash World Inbox === Best scores I got on King's Ransom Online were 37, 30 and 25. Let's see your improvements. GuavaMoment posted:
GuavaMoment posted:Now for low line - 1623/20/25. So we need each exa to go into rooms numbered around 800, and then grab files in the 200s, right? Start at 806 and count down attempting both! Enter every room from from 0 to 806, grab every file from 0 to 806. After thousands upon thousands of exas die, the countdown reaches 0 and die for good. Weapons have a number in the second file spot, so those get excluded. Finally, let's go back to the elusive 24-activity solution. Both GuavaMoment and I came up with a way to do this. I'll start with my own. The main difference from my attempt in the previous update is that I now fill the hosts with files instead of EXAs. I found files much easier to control. I'll add some explanations in the code. code:
The end result is 517/100/24. I had to squeeze a little bit to fit it in the 100 size limit but I didn't have to try too hard. I'm pretty sure I could save more lines if I really wanted to. GuavaMoment posted:I see you at LINES 100 and I thought the amount of lines was going to be the limiting factor in the solution, so I used my really low line filegrabbing solution as the base. 1823/81/24 There's a LOT of timewasting to get everything synced up. I still try to grab a LOT of non-existent files which wastes more time. Lower any of the timewasting values by even 1 and something breaks. === KGOG-TV - Satellite Uplink === Oh. They just shut the whole game down. Something about "hackers" or something? I guess that means you. People are taking this so seriously. Three votes for real money, one for "their loss". It is real money... People act like the online world is different, but it really isn't. At least as far as human behavior goes. Next up... Ember wants us to upload a tv program? Okay. You know what really moves people? Art. One vote for "That's why art is powerful", but three people didn't like where this was going. I already don't like where this is going... I've been working on something creative. An abstract video piece. It's an expression of some of the ideas I've been developing around shape, form, and color. You'll see. Let's get it out there. Don't worry too much, Ember just wants her art to be seen. Seeing how recently NFTs gained popularity, I doubt Zach had even heard of them when he made this game. OST: Behind the Scenes The assignment: - Align the satellite dish with the target satellite by setting the azimuth, elevation and frequency. Then transmit the data from EMBER-2's video (file 301) after encrypting it using the TV station's encryption key (file 199). - The azimuth, elevation, and frequency of the target satellite are available in file 300. - Note that you must align the satellite dish before transmitting any data. - For more information see "Look to the Stars with Satellite Uplink Systems" in the second issue of the zine. Ember, how did you even get us inside a tv transmission satellite dish? Before I'll grab the zine, it might interest you that K-GOG has the shows "Ten Men and a Dog", "City Livin'", "Cooking for Losers", "Takedown", "Buy it, Love it", and "Futurelook 2000" lined up. Which is your favorite? Okay, so writing to the motor registers moves the dish, while I can read the current position from the #AZIM and #ELEV registers. The encryption is quite basic as encryption schemes go, add the first value of the data to the first value of the encryption key, modulo 10000. Repeat with the second value of the data and the second value of the encryption key and so on. If there's more data than values in the encryption key, wrap around to the beginning of the key. A complication is be that EXAs are limited to 9999, so I'll need a trick for the modulo operation. But first, let's get the sat aligned. code:
The motors only can move one step at a time. So the azimuth and elevation EXAs calculate the difference between the current value and where they should be, and then either move up and down. The move loops are interwoven so that both the AZI and ELEV only need one conditional jump and can fall through otherwise. And I use the MODI trick GuavaMoment helped me remember to have the EXAs die automatically when they're done. The uplink status on the top right says "Link: Locked" once all settings are right. Next up is encrypting the file. To keep the activity as low as possible I think it's best if I send the dish settings over M so I can carry file 301 with me and handle that without a lot of messaging. Let's go through it step by step. XB is a simple EXA that grabs file 300, and sends the azimuth, elevation and frequency over M: code:
code:
Let's look at the ENCRFILE EXA next. code:
Anyway, after sending a key value, it waits for an incoming M. To cause this EXA to stop at the end, it dies if M is zero. Otherwise, it tests if it's at the end of the encryption file and if so starts over from the beginning of the file. Either way it sends the next value and repeats. code:
code:
For the encryption, it first copies the data value to X (I needed it in T to see quickly if it was zero, but I need to free T for an upcoming test). Then the EXA switches to global mode and puts the encryption value in F. It tells the ENCRFILE EXA to get ready to send another message, and adds up the data and encryption values, saving that to the file. If the result is less than 9999, it sends the data right away. Otherwise it needs to do something tricky to get the "modulo 10000" requirement. The SWIZ 0004 instructions return a number that contains the thousands digit of the original, in the ones place. Those can be added together. For instance, if the result is 15, that means the full result would be 15xxx, modulo 10K makes 5xxx. That's what the SWIZ 1000 does. It takes the digit in the ones place, and puts it in the thousands place. The digit is where it should be and we get the modulo operation for free. Next I take only the lower three digits of the data and encryption value using SWIZ 0321 instructions, add everything together, and send it to #DATA. The top percentiles are 180, 56 and 4. I'm not wasting any activity points but there are improvements for the other metrics. There is in fact a much, much simpler way to implement the encryption algorithm. EXAs do have a range that goes beyond 10000 values - we just need to use it. It's negative numbers, of course. I can rewrite the whole SENDER code to just this: code:
Now there's two possibilities. Either the result is less than 0 (the total was less than 9999), in which case I can just re-add the 9999 and send to #DATA. Or it's more, in which case we would have to apply the modulo operation. Since that's equivalent to subtracting 10000, and I already subtracted 9999, I just subtract one more and that's it. No more temporary files, everything can be done in-place. Because it's so much faster, I had to bump ENCRFILE's wait time to 55 loops. This solution clocks in at 431/76/4. Less lines of code and less cycles. You might've already realized the next step. Since the temporarily file isn't necessary anymore, we can delete the entire dedicated SENDER EXA and have the main data one handle the encryption logic. That skips a lot of M transmissions. code:
Now that I don't need to worry about activity anymore, I can also get rid of that annoying wait by doing the encryption in parallel with setting the dish. code:
While SETDISH does its thing, the ENCRFILE EXA and the data one are sitting in the SECURE host, communicating in local mode. The data EXA overwrites the values in Ember's file with the encrypted values. At the end it kills the ENCRFILE EXA, hops over to the transmitter, and sends all the contents of the file. I shuffled some code around, mostly to make sure EXAs that are finished fall through into code that makes them stop themselves. The different use of M somehow changed the order the dish EXAs receive the data in so I had to move the COPY M instructions back to the main SETDISH code. Next, I noticed that the encryption algorithm is still the slowest step by far. The most obvious thing I can remove from it are the two cycles to check EOF. I can't unroll that loop much, I don't have a lot of lines left, but there's another way. code:
In this solution, the encryption algorithm is still the slowest step. It's possible to change that, for instance by writing the raw value to F before checking if it's negative, and handling that later, when sending the data. However, that means you can't fully unroll the sender code anymore with the @REP 24, so you need TEST EOF instructions and everything, and it slows down the whole program significantly. So, I'll end it today with top scores of 207 cycles and 63 size. By the way, I hadn't noticed it before but there's some sort of ad in the zine, just after the satellite dish article. Sounds neat. Well, what did you think? The first vote. And for next time... Okay, no more trying to find shortcuts. Time for a brute-force solution to the money problem. I know you like messing around with bank systems... Carbon dioxide fucked around with this message at 18:48 on Apr 23, 2023 |
# ? Jun 19, 2022 10:57 |
|
Hacking those ATMs was your idea, Ember. And I'm not sure I understood it.
|
# ? Jun 19, 2022 11:35 |
|
Carbon dioxide posted:Also, the TJMP MANY is just a convenient way to make those EXAs that grabbed a weapon harmless. It may have been said before, but there are just so many times when you want something to die after a conditional, the first thing I do is look over the code to see if jumping somewhere completely unrelated kills the exa in that case. There almost always is one. I don't have good solutions for this one. I won't have good ones for a while it seems, the difficulty is ramping up.
|
# ? Jun 19, 2022 15:52 |
|
small solutioncode:
fast solution: code:
Quackles posted:Hacking those ATMs was your idea, Ember. And I'm not sure I understood it. silentsnack fucked around with this message at 20:57 on Jun 19, 2022 |
# ? Jun 19, 2022 16:27 |
|
Part 32 - Equity First Bank - Money Transfer === Trash World Inbox === silentsnack has some nice improvements again for KGOG-TV. silentsnack posted:small solution XB grabs the key file, gets a value each round and subtracts 10000 to prevent overflow, then makes a REPL which goes back to get the data. Since the repl can use VOID F to remove values it already read, there's no need to keep track of where in the data file we are. The EXA also drops a new KEY_RESET EXA in case the main XB is at the end of the file. Usually KEY_RESET dies immediately because the file isn't available, but if it grabs it, the pointer is at the beginning of the file so no SEEKs are necessary. silentsnack posted:fast solution: 81 cycles... how??? Seriously, this code is very hard to understand. For the dish, you found a way to unroll the loop by sending the difference between the expected and actual value to the #MOTR. It won't move more than one step at a time, even if you send a larger number, but once it's zero you know you're done. Other than that this solution is mostly very well-timed parallellism. XB makes a whole bunch of copies, each of them buffering 3 values in a file and them sending it to #DATA without any cycles wasted. Somehow it all lines up. === Equity First Bank - Money Transfer === Well, what did you think? Two votes for the same option. I'm not sure I understand it. That's okay... Great art is often mysterious. If you want to know the truth, though, that video was just some garbage data I had lying around. I just thought it would be fun to broadcast. You have a unique sense of fun, Ember. But, I guess you were noticed. Next up, I'm gonna go to Equity First again. That's the bank where I messed with the ATMs a while ago. Hacking banks is a bit iffy but it might solve my money troubles once and for all. Okay, no more trying to find shortcuts. Time for a brute-force solution to the money problem. I know you like messing around with bank systems... Another unanimous vote. Hacking those ATMs was your idea. Well, you get to do it again! This time with a little more urgency. OST: Leave No Trace The assignment: - Move EMBER-2's new account (file 300) into checking. Then iterate over the checking accounts listed in the directory (file 199) and, in that order, transfer $1.00 from each target account to EMBER-2's account. Finally, add the file ID of EMBER-2's account file to the end of the directory. - The keywords CREDIT and DEBIT are available in file 301. - For more information see "Network Exploration: Equity First Bank" in the first issue of the zine. Well, this is the same network as before, but they have disconnected all the ATMs. Perhaps I caused more trouble than I thought. Since we didn't do anything with the files last time, let's read up on them again. In short, I shouldn't mess with the first 4 values in any account file. To add a transaction from account X to Ember, I need to add a DEBIT transaction line to account X's file, with Ember's account number and the amount. I also need to add a CREDIT transaction with account X's number and the same amount to Ember's file. The assignment says to do this for checking accounts, so no need to touch the loans. Let's get started. I'll need the DEBIT and CREDIT keywords, but since they're only two values I think I can bring them along in X and T, which would save an EXA or a lot of M back and forth. code:
code:
code:
At the EOF it writes Ember's file id to the directory to officially register it, and kills the EMBERWRLOOP EXA. The final part is the TRANSACTION EXA. It grabs the account file, copies the account ID to EMBERWRLOOP, and adds the $1.00 Credit transaction line to the end of the file. It messages the DIRECTORY EXA when it's done. Note that the messages between Ember's account and the other accounts are in local mode while the "I'm done" message from the transaction EXA is in global mode. All EXAs are in the same host so it doesn't matter what modes these EXAs start in, but I need both modes to prevent messages getting mixed up. This initial solution scores 158/40/3. Top percentiles are 55, 40, and 2. I'm pretty sure there's some smart tricks to save a couple lines. For instance, the file IDs in 199 seem to be in order so you could just loop through all of them. But, you know, I'm happy with top percentile score on size, and I'll leave it to the thread to go beyond. Let's get the activity down instead. There's only one way to do so - remove that KILL instruction. I can replace the end of the DIRECTORY code with code:
code:
I don't like this slow code, so let's quickly go back to the previous 3-activity solution and look into lowering the cycle count. The easiest improvement is to not have the transaction EXA wait so long for the Ember EXA, by moving the step where it sends the account number. code:
Next, we have to look into parallellism. code:
XB first sends Debit in global mode, then Credit. XA makes a REPL still called EMBERWRLOOP which doesn't actually write anymore, it just sends the account number repeatedly. This way, the CREDIT EXAs can just write the $1.00 transaction to all accounts at once. After that is done, we loop through 199 again, grab the files again, and send the account numbers to EMBERAC, who writes the debit lines to Ember's account. A few more cycles can be won by preparing the Ember Ac Loop ahead of time. 88/55/4 As it stands, unrolling loops doesn't do much because the M timing is rather specific and messing with it tends to break things. I do have a bunch of other ideas. For instance, preparing Ember's account file with transactions with dummy account numbers and then fixing them later might save a couple cycles. Or making use of the fact there's always at least 5 accounts. But no matter what I tried, the transactions ended up in the wrong order. The timing is tough on this one. 88 isn't even the tenth percentile, but I'm afraid I'm going to stop it here anyway. Defrauding the bank... That's textbook crime, isn't it? Not to worry, your secret's safe with me. Straight to the vote. Before I move on to the next assignment, Nivas is here. Delivery... Nivas hands me the medication. This time it's the real version that was "liberated" from the drug company... I thought it might look more impressive than the bootleg, but it's basically the same. To be honest, I thought I probably wouldn't see you again. Didn't think you'd be able to put that kind of money together. So whatever you did... respect. Nivas hands me another package of the medication... and another. These are advance deliveries. I think... I think I need to take it easy for a while. The whole thing with the operation we did, those people I mentioned... It got a little hot for me. I'm gonna lay low for a bit. I might do some reading, think about the world we live in... For some reason I'm in kind of a spiritual mood lately. Anyway, nice doing business with you. Take care of yourself. Nivas closes the door, leaving me with the rest of the medicine. Interesting character. Everyone's doing what they can in order to survive... I hope Nivas is gonna be okay. Well, at least my medicine problem is solved for the forseeable future. For next time, there's another hacker battle coming up. If you keep on winning, they'll eventually have to accept that you're back. Carbon dioxide fucked around with this message at 11:13 on Jul 2, 2022 |
# ? Jun 25, 2022 13:47 |
|
|
# ? May 1, 2024 13:49 |
|
I had a 60 cycle solution I was playing with last week, but it's gone? I must have done something and accidentally deleted it. I remade at least it but with more lines somehow? 50 cycles is possible. 60/59/8 code:
|
# ? Jun 25, 2022 15:35 |