last day (15 days later) » 

20:08
4
A: Golfing strings in Fourier

GeobitsJava, 14307139 bytes Hamlet - 601,218 Genesis - 13,705,921 The idea here is to do all the work upfront, by making a character->character map. Then you can just loop through and grab the shortest strings. A bit of an exception has to be made for numerals, so I check for them in the main loop. ...

I think this doesn't handle strings of digits with leading zeroes correctly. For instance, on the input 01, I believe it outputs 01o, which is not correct.
Also, I think you're misusing the accumulator. In the else clause of the main loop, you choose between using the actual value of the accumulator and the character value of the previous character. You cannot make the latter choice if the two are different, because that means you used o the time before, and the accumulator does not contain the previous character's value.
Right, both should be fixed now. Thanks!
When I run this on my machinge, I get 625474 for Hamlet and 13705922 for Genesis.
@isaacg Are you running it on the same file (with same line endings)? I ran into a problem with line endings earlier. When I run mine and yours on the same file, they both show the posted scores.
When I run your answer on Genesis, I get 13705922, no trailing newline, no linebreak issues. Moreover, when I diff it against my answer, it's character for character identical, except for a stylistic 100a vs. *10a where the previous accumulator was 10.
20:08
@isaacg I don't know what the issue you're seeing is then. Here's the output it gives me, saved straight to a file with size 13705921 in both the text editor and file->properties dialog.
Alright, the only difference is that my version has one more a at the end, which prints out a second trailing newline. This means that your source file has one trailing newline, while mine has 2. If both submissions are run on the same source file, they should output the same length result.
That would clear it up nicely. Using either one is fine by me as long as they're the same (and everyone else is using the same version also).
OK, I think the one online has the trailing newlines, so we should probably use that one.
Works for me, will update. Let me run my Hamlet again to make sure, but I believe it's correct.
Do you happen to know where the extra few are coming from in your Hamlet? Curious, because it looks like we're doing basically the same thing, just in a different way.
 
1 hour later…
21:39
Yeah, I think we should have identical outputs. If you could post your output, I'd be able to figure it out. @Geobits
No problem. I'll have to do it later, though. About to eat, and at a different computer afterward.
Actually, I think I figured it out. I had a minor bug in my code that was costing me 4 bytes.
Actually, it was costing me 6 bytes, so now I'm 2 bytes up on you. I'll edit this in to my post. What's probably going on is we have competing minor improvements.

last day (15 days later) »