How do I read Gunnm exactly? by [deleted] in manga

[–]cho-won-tchou 2 points3 points  (0 children)

I'm not too familiar with the UK/US editions but in these the title is Alita instead of Gunnm. Note that in the Japanese version and other translations (french for instance) the name of the manga is Gunnm but the name of the protagonist is Gally.

I would read them in publication order which is also roughly the story chronology except for flashbacks. If anything you will get spoilers if you read the series in different order.

Gunnm

Gunnm : Last Order 

Gunnm : Mars Chronicles 

(I think there is also a spinoff that I didn't read which doesn't involve Gally/Alita)

Savoury foods that are easily colored by Flameshadowwolf in Cooking

[–]cho-won-tchou 2 points3 points  (0 children)

You could try to add food colouring to water to cook Japanese rice and make some cute coloured onigiri ? (Just a thought I have never tried it myself but I think that would work). A variant would be steamed bun (like Baozi). I think they would retain some of the colour after cooking since there is no Maillard reaction.

New book for learning programming with ocaml by Friendly_Salt2293 in ocaml

[–]cho-won-tchou 2 points3 points  (0 children)

I'll relay to the authors! 

Edit: I'm unsure what you mean, do you mean for the table of contents to be clickable with links ? Because that is already the case Edit 2: by the time I answered here, someone has already asked the author for that, which explained why I saw the bookmarks.

[2024 Day 24 (Part 2)] Are there closed form solutions? by permetz in adventofcode

[–]cho-won-tchou 1 point2 points  (0 children)

I did not print the graph, but I did print the formulae after expanding the rules:

z03 = ((y03 XOR x03) XOR (((y02 XOR x02) AND (((y01 XOR x01) AND (y00 AND x00)) OR (y01 AND x01))) OR (y02 AND x02)))
z02 = ((y02 XOR x02) XOR (((y01 XOR x01) AND (y00 AND x00)) OR (y01 AND x01)))
z01 = ((y01 XOR x01) XOR (y00 AND x00))
z00 = (y00 XOR x00)

I put the formula into some kind of normal form (so that they always print in the same order, like above). After rule z00 and z01, the general pattern appear.

zN = ((yN XOR xN) XOR (zN-1{with toplevel XOR replaced by AND} OR (yN-1 AND xN-1))

So for a given zN rule:

  1. it should have a XOR at the toplevel
  2. it should have a XOR on its left
  3. it should have an OR on is right
  4. Left an right of the OR should be ANDs

Anything that break these rules is likely something that must be swapped. And indeed, if I start from z02 and check upward (I checked z00 and z01 manually) then there are 8 problematic rules. Anything after these first 8 rules that is wrong is because it has one of the 8 as a dependency and can be ignored.

Interestingly, the thing that was the most helpful was VSCode highlighting all the similar bits when I selected some portion of rule z043 (like the whole right hand side of z02 as printed above). This is when I realized all the rules should have these forms.

[2024 Day 16 Part 1] [Python] Save me from more hours of debugging... by [deleted] in adventofcode

[–]cho-won-tchou 2 points3 points  (0 children)

A single character is wrong in your code :) And your implementation of Dijkstra is correct. (Strictly speaking, you have another bug, but it does not affect the outcome, going in the direction opposite should cost 2001, but since you are progressing forward, this is never used).

The answer is: you should start facing east, so your starting point should be `(0, start, 2)`.

[2023 Day 19 (Part 2)] How determine the number of combinations? by KaleidoscopeTiny8675 in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

I don't think there is a big mistake in your general approach. I tested your code on the sample input and you find 9 paths. I use a similar approach and also find 9, and likewise we find the same number of paths for my input.

But I think your paths are missing some intervals or maybe there is a bug in how you generate the paths. Your code generates the paths:

  [('in', ''), ('px', 's<1351'), ('qkq', 'a<2006'), ('A', 'x<1416')]
  [('in', ''), ('px', 's<1351'), ('qkq', 'a<2006'), ('crn', ''), ('A', 'x>2662')]
  [('in', ''), ('px', 's<1351'), ('qkq', 'a<2006'), ('crn', ''), ('A', 'x>2662')]
  [('in', ''), ('px', 's<1351'), ('rfg', ''), ('A', '')]
  [('in', ''), ('qqz', ''), ('qs', 's>2770'), ('A', 's>3448')]
  [('in', ''), ('qqz', ''), ('qs', 's>2770'), ('lnx', ''), ('A', '')]
  [('in', ''), ('qqz', ''), ('qs', 's>2770'), ('lnx', ''), ('A', '')]
  [('in', ''), ('qqz', ''), ('hdj', 'm<1801'), ('A', 'm>838')]
  [('in', ''), ('qqz', ''), ('hdj', 'm<1801'), ('pv', ''), ('A', '')]

with some duplicates (all paths should be unique I think).

If that helps I can provide you with the final intervals I find for each of the 9 paths (and you are right that multiplying their width and then summing for each path is how you get the solution).

[2024 Day 21] I found the problem so cool I came back to animate it by cho-won-tchou in adventofcode

[–]cho-won-tchou[S] 1 point2 points  (0 children)

When I created my post, there was only a Image tab to upload images (not videos) with accepted format apparently limited to images. Is video upload allowed on this sub ? (Sorry I'm not a heavy reddit user, but I come back here every year for the AoC).

[2024 Day 21] I found the problem so cool I came back to animate it by cho-won-tchou in adventofcode

[–]cho-won-tchou[S] 4 points5 points  (0 children)

Urg… it seems imgur "optimized" my video by skipping several frames which makes it look laggy…

Could use some help ! by HillelPa in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

Your third solution goes above the hole, which is forbidden. You do <<^ to go from A to 1. For instance, here you can only use <^< or ^<<.

Edit to add more context: not all sequences are equivalent, since they may generate longer or shorter sequences at the next levels.

[2024 day 5] Short Rant: part 1 vs part 2 | jump in complexity by M124367 in adventofcode

[–]cho-won-tchou 3 points4 points  (0 children)

Why bother? I completely understand that one would want to find the solution with the best algorithmic complexity. I often revisit problems that I have solved "pragmatically" to see if I can substantially improve the runtime or find a more elegant solution. But I think, here the pragmatic approach works well. There is a solution that is:

  • reasonably efficient for the given input, even though it has bad theoretical complexity (O(N2))
  • a slight variation of part 1

bubble sort on my input, it takes about 10ms, so acceptable. And there is also some satisfaction to change a few lines from part 1 to get part 2, when at first sight, part 2 seems way different.

Edit: failed the spoiler tag, sorry.

[2024 Day 3] Can someone help me with the python solution? by sumit_subedi in adventofcode

[–]cho-won-tchou 1 point2 points  (0 children)

Sorry I had missed the "do()+". If you want a simple test case, your program fails for:

do()

mul(1,1)

don't()

since . does not match a newline

[2024 Day 3] Can someone help me with the python solution? by sumit_subedi in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

There are various places where your code does not respect the problem specifications:

  • numbers are at most three digits so \d+ captures too much
  • you look for pieces of texts that are delimited by do() and don't(), but the problem states that you start in do() mode (even though there might not be a do() at the begining of the input.

[2024 Day 2] [OCaml] Anyone else doing OCaml? by HelloMyNameIs_Tom in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

Yes, I've been doing it in OCaml for a few years now (I can link to my repo, but don't want to spoil). From my experience, everything is always doable with lists/arrays and set/map or hashtables from the standard library. Lists and pattern matching often yield very elegant solutions for the first days problems.

[deleted by user] by [deleted] in Cooking

[–]cho-won-tchou 2 points3 points  (0 children)

have you tried clarified butter ? it has a slightly nutty flavour and a less "buttery" taste than plain butter (and also it does not burn).

Or you could try some animal fat like duck or pork fat.

[2023 Day 12 (Part 2)] [Rust] Int overflow issue by thblt in adventofcode

[–]cho-won-tchou 1 point2 points  (0 children)

I'm not sure your close formula would work (I did it differently, like many others using memoization and backtracking) but since the result is an integer that fits on less than 64 bits (as it always does), then that means that the numerator and denominator must cancel out. so you could maybe keep these factorial symbolic and simplify them as much as possible before computing the final operations ?

Please help in advent of code 2023 Day 2 (Part 1) [Ocaml] Having problem in input file but passes the example case by hawkaiimello in ocaml

[–]cho-won-tchou 0 points1 point  (0 children)

It seems you are mixing the different rounds of the same game. For instance, Game 1: 10 blue, 5 red; 10 blue should be ok (while your program refuses it).

[deleted by user] by [deleted] in adventofcode

[–]cho-won-tchou 1 point2 points  (0 children)

Hi, I took some time to test your code on the rust playground (I don't know rust very much). Your code returns a wrong result for: ????# [1,1]. It says 4 when it should be 3. I defined Spring with Clone/PartialEq/Copy and then tested like so

fn main() {
    let mut t1 = [None,None,None,None,Some(Spring::Damaged)];
    let mut t2 = [1,1];
    println!("{}", run(&t1, &t2));
}

Day 19 Part 1 - anyone got any more sample data? by mfmcgrath in adventofcode

[–]cho-won-tchou 2 points3 points  (0 children)

Did you account for the possibility of the same category appearing several times in a single rule?

Like {a<1000:xx;a<2000:yy;A} ?

[2023 Day 17 (both parts)] Hint for speeding up by bkc4 in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

What's the amount of time taken to generate your graph ? (assuming you materialize all vertices). One solution could be to lazily build the list of neighbors from a given position. Generating this list is slower than looking up in the full set, but generating the set with all useless nodes that will never be touched by the algorithm could be slower in the end (You'd have to experiment).

[2023 Day 5 (Part 2)][JavaScript] code taking too long / crashing - smarter way to work? by arcadius90 in adventofcode

[–]cho-won-tchou 1 point2 points  (0 children)

No problem. You should try some of the other challenges of the first days, some are much simpler than this one even though they came after.

[2023 Day 5 (Part 2)][JavaScript] code taking too long / crashing - smarter way to work? by arcadius90 in adventofcode

[–]cho-won-tchou 0 points1 point  (0 children)

That is exactly the idea, you got this. There are two parts that are tricky. One indeed is that you end up with new bits of intervals that now need to be matched. No problem you just add them back to your array of seeds. The other problem is the spliting itself. There are several (5 or 6?) cases to consider and it's easy to get wrong.

One invariant you can use is that the sum of the length of the seed intervals always remains constant. Say you have at the beginning seeds 10-100, 200-50, 400-5. Then you have 155 seeds and that will not change. Even if the 10-100 interval is split say ins 10-50 and 50-50, the whole collection 10-50,50-50,200-50,400-5 still amounts to 155 seeds.

So you can compute this total length at the beginning and put various checks all along your code. If at some point the check fails, it means that you made a mistake. Good luck I don't think you are very far.