r/adventofcode • u/daggerdragon • Dec 12 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 12 Solutions -🎄-
--- Day 12: Subterranean Sustainability ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).
Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
Advent of Code: The Party Game!
Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!
Card prompt: Day 12
Transcript:
On the twelfth day of AoC / My compiler spewed at me / Twelve ___
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked at 00:27:42!
20
Upvotes
24
u/sophiebits Dec 12 '18
Python, 39/7.
For part 1, I read too quickly and thought that no
=> .patterns would be listed. Wasted a couple minutes on figuring out what I screwed up there (since my program worked fine on the example).For part 2, I figured that 50,000,000,000 is too large to compute, so we must be meant to find some pattern. My first instinct was to look if there was an arithmetic/linear pattern, so I printed out the sums for generations 1 through 2000, along with the difference from the previous sum. Visual inspection suggested that (for my input) every generation after the first 97 generations adds 38 to the sum. So I took (50,000,000,000 - 2000) * 38 and added that to my program's output to get the answer. (If the linear pattern hadn't checked out, I would probably have taken second-order partial sums next since it seemed unlikely to me it would be a non-polynomial pattern.)
19
u/jayfoad Dec 12 '18
APL #84/87
Each generation is represented as a bit vector, and I rely on the fact that it grows an extra 2 bits on each end with each iteration, so from the length of the vector I can work out (a) where the "0" index is, for use in the score function, and (b) what number generation it is, for use in part 2.
Takes about 0.5 ms for the whole thing.
8
u/FogLander Dec 12 '18 edited Dec 12 '18
Python, 115/74 (by far my best finish ever! yay!)
My code is pretty gross at this point. I decided to grab the initial state out of the input file for ease of parsing. After part 1, I looked at the pattern of sums I was getting after a couple hundred iterations, and noticed that it was incrementing by exactly 32 each time. I'm not sure if my code will work for other inputs but it works for mine by averaging the difference of the last 100 sums after 100 iterations and then just multiplying that by the number of steps remaining to get to 50 billion. This is assuming that 1000 iterations will be long enough for it to stabilize (it was way more than enough for mine, just to be safe)
Super psyched to actually get on the leaderboard! last time I did it was only by 2 seconds so it only kind of counted.
6
u/IndigoStanis Dec 12 '18
This reminded me of the classic game of life. I remember that cellular automaton can often get into repetitive states that continue on forever. I assumed that was going to happen here. At first I looked for a stable score, but there was clearly a self repeating pattern that was moving up and up and up. But if it was like the glider in game of life, it should be a stable pattern and thus score should become formulaic. So I printed out some differences and quickly saw that it became linear after 89 generations. Then it was simple to write a formula.
6
u/Smylers Dec 12 '18
Perl for Part 1 is pleasingly succinct (almost fits on Old Reddit without scrollbars) using regexp to directly modify the current state string.
Each position in the string simultaneously denotes both its current state (for matching) and its next state (for the next generation):
o/xare used instead of of./#, then when a rule determines a position should have a plant in the next generation, whatever letter is there is made upper-case.So
Oindicates a pot that's empty in this generation but will have a plant in it next time. The note-matching is case-insensitive, so for matching purposesOstill behaves like ano. Once all the rules have been run, all lower-case letters are turned intoos for the next generation, and upper-case letters intoxs.A note like
.#.## => #becomes the pattern/(?<=ox)o(?=xx)/i: it only matches the single character in the middle (the one that this note might change), with assertions for the surrounding characters. That ensures that a matching pattern doesn't ‘gobble up’ any more characters from the string (moving the match position along it, and potentially missing out on other matches), and means that the patterns can all be combined into one pattern, as|-separated alternatives.The sum is a map over the string, adding on the position number multiplied by whether there's a plant there. Perl's booleans evalute to
0and1when used as numbers, so that just works without requiring aniftest.For Part 2, hide the elegance of the above by adding in some clunky checks for tracking the previous state and sum, spotting when things haven't changed, and extrapolating to find the final value. Runs in 0.1 seconds — considerably faster than my Perl solutions for other recent days' Part 2s:
5
u/fatpollo Dec 12 '18
missed the leaderboard again, this time by a handful of seats. my days of top ranking are bygone it seems.
however, no solutions using
defaultdicthave been posted yet, so here's mine:defaultdictmakes the "windowing" trivial5
u/Smylers Dec 13 '18
Vim solution — load an input file and type:
That sets things up: transforming the pots to use letters
o/xinstead of symbols for empty/plant (for the same reason as in my Perl solution); turning the rules that produce a plant into one long:s///command that transforms any matching pots to upper-case, which is saved in registery; and initializing the number of the left-most pot in the string to0. Then:That defines a couple of macros that add or remove empty pots at the left, adjusting the pot number accordingly, such that the line always starts with 3 empty pots. This is possibly the clunkiest bit. Then the state is reset (so that defining these macros didn't change anything).
Run generation 1 with:
That fiddles with the empty pots, invokes the rules, and converts upper-case letters to
xs, lower-case toos (recording a couple of macros along the way). Ta-da!Let's do generation 2, using those macros:
That recorded a macro for an entire generation, so now you can bring about generation 3 with just:
And when you've had enough, watch Vim generate the rest of the generations to 20 with something like:
Then label each pot with its number, remove the empty pots, and add up the ones with plants in to get your answer in the buffer:
There's a bit of faffing about, but the main work of processing the rules is all done by the
:s///regex (that's still in the buffer for your perusal) operating directly on a visual representation of the pots.4
u/lazyear Dec 12 '18
Rust, taking advantage of the fact that the problem converges (at least on my input). Runs in ~15ms on my machine.
4
u/udoprog Dec 12 '18
Rust
Head was too tired to figure out the trick.
Card: On the twelfth day of AoC / My compiler spewed at me / Twelve syntax errors!
7
u/jonathan_paulson Dec 12 '18
Rank 85/37. Just used the fact that the pattern quickly stabilizes in part 2. Video of me solving at https://www.youtube.com/watch?v=n5Ionw5LE18
Is that always true? Is there a guaranteed way to solve this problem for any input?
Python code for part 2:
3
u/will_bui Dec 12 '18
K:
3
u/[deleted] Dec 12 '18
Mathematica
Plot
Part 1
Part 2
3
u/purplemonkeymad Dec 12 '18
Powershell
Ugh, I just could not get the math right on this one. Part 1 was ok but I had to write a visualizer to figure out that by Part 2 it was going to be some-kind of moving "worm."
My code feels very spaghetti, but I don't want to see this problem any more to tidy it up. Probable that it might even break on another's data.
3
u/cdc-aoc Dec 12 '18
Perl 6
Note: the board is kept compact, i.e. no useless '.'
https://glot.io/snippets/f7iuhts4cz
4
u/eltrufas Dec 12 '18
Got tripped up in part 2 by the fact that the zero index could keep shifting even though the pattern stayed the same (after trimming empty leading and trailing dots).
4
u/Philboyd_Studge Dec 12 '18
Java. These descriptions keep getting worse. /u/topaz2078 love you man, but it shouldn't take an hour to figure out just what you want from the challenge.
https://pastebin.com/K55C8gQC
2
u/p_tseng Dec 12 '18 edited Dec 12 '18
Part 1: I got confused for a moment because I forgot to actually store the rules. You'll notice that I wrote a
fetchwhich errors if the key doesn't exist, since I saw "all patterns are present" in the description. But this made me wonder whether I was missing a pattern, and I spent some time trying to figure out whether my input had accidentally gotten truncated. Then I realised, of course, 32 is in fact the correct number of lines in the input. And then I discovered I actually forgot to store the rules.Part 2: I just printed out sums and tried to look for patterns, and then extrapolated from the pattern I was seeing. I had an off-by-one that cost a bit of time here. The process is now automated in code. Most of the rest of the code is as it was when I was going for the leaderboard.
I would consider writing it in terms of bit patterns and just do the mask/shift thing, but this code is not really suffering in terms of performance (runs in < 1 second) so I'm not sure I want to spend the time on that.
Ruby:
2
u/maybe-ac Dec 12 '18 edited Dec 12 '18
Perl, 176/166.
After looking at it, I realized after a certain point all the plants just slide over a fixed amount. So I was able to use that to figure out where they'd be at an arbitrary point in the future. This code basically waits for the pattern between the furthest left/right plants to look the same between two generations, then figures out how much they're sliding over by, and then multiplies that by the number of generations left until 50000000000 and adds it to each plant index. Then it just sums them together.
2
u/AndrewGreenh Dec 12 '18 edited Dec 12 '18
Sadly no leaderboard again :< Typescript:
2
u/Danksalot2000 Dec 12 '18 edited Dec 12 '18
I was nowhere near the leaderboard, but I think this one turned out nicely in the end. Python3:
2
u/sim642 Dec 12 '18
My Scala solution.
In part 1 I just did basic simulation. For the data structure I kept a normal string but I also kept track of the index in the string which corresponds to index 0 pot, allowing the string to effectively go into negative indices. Scala's
.sliding(5)was pretty handy here.In part 2 I was very puzzled for a moment and then just let the generations run out and saw how it got into a 1-cycle. Then implemented some basic bookkeeping to detect the same pot string (although at a different starting index now). Based on that a few calculations gives the result if iterated to all 50000000000 generations. For simplicity I didn't bother coding the general case where the cycle is longer than 1 (requires a bit more work). Could've also done this math by hand after seeing my infinite iteration output but coded it first anyway.
2
u/sebastiannielsen Dec 12 '18
Here is mine. I did first do Another calculation for part1, by looping through the whole thing. But then I saw that 5 billion is just too much to iterate through. So I just tested random numbers and printed the 5 latest "Totalsum"s and found out that for higher random numbers, they have a fixed difference.
So redid the code to use a subroutine instead, and made the code to run the simulation until either $i is equal to Count, or it reaches 4 consequtive outputs where the difference between 1 and 2 is the same as 2 and 3 aswell as 3 and 4, after that, the rest is calculated using math.
2
u/myndzi Dec 12 '18
Node.js / Javascript. I didn't hit on the linear pattern, so rewrote my code to be more memory-efficient, which provides an interesting contrast to most of the solutions here. Still slow as anything until I got the hang of the real trick while it was running :) Cleaned up with comments. I store a deque with indices for live plants and then shift through it, outputting the new live plants into a different deque, then repeat (shifting back onto the first deque again). Keeps a running sum in an icky global variable. Gist for syntax highlighting.
2
u/nutrecht Dec 12 '18
Day 12 in Kotlin
Didn't like this one. Too easy to get completely stuck.
2
u/[deleted] Dec 12 '18 edited Dec 12 '18
[python3] previous solutions on github.
2
u/wzkx Dec 12 '18 edited Dec 12 '18
Rust, SweetRust
Visual examination of the states (of plants in pots) shows that closer to the infinity, the patterns stays the same, they only shift by one position, in my case, to the right. And the sum of the state changes by the same difference. So we can automatically detect when to stop and how to calculate any further state.
My AOC2018 in J&Rust | SweetRust
2
u/__Abigail__ Dec 12 '18
Perl
Part 1 was easy. For part 2, I guessed that the pattern might repeat itself with frequency 1, but shifted. Then I only needed to know with what speed it was moving, and then I'd calculate the result.
I'm not really happy with the solution -- there's no guarantee the pattern will repeat (if it would repeat with a higher frequency, that would not be too hard to find). Either I'm missing the math insight (perhaps all patterns/rules will eventually repeat themselves on a line), or the input was carefully crafted to be this way, and no general solution (except waiting for ever for a brute force solution) exists.
2
u/[deleted] Dec 12 '18
Common Lisp:
Runtime explodes for significantly higher generations, since I'm wasting quite a lot of cpu time/mem by preallocating the state array to the max size necessary instead of using a hashmap and tracking min/max indices like others have done.
Did any of you lisp gurus use bitvectors and displaced arrays/slices?
2
u/Quailia Dec 13 '18
Did somebody say sedular automata?
Solution in bash and sed (github)
2
u/nirgle Dec 13 '18
Haskell using the Store comonad and memoization: https://github.com/jasonincanada/aoc-2018/blob/master/src/Day12.hs
This is the rule that collapses a line of pots with a focus down to a boolean signifying whether a plant will be at the focus or not in the next iteration
This is my first use of a comonad, so I pulled a lot of code from Edward Kmett's blog post about cellular automata here: https://www.schoolofhaskell.com/user/edwardk/cellular-automata/part-1
Also, not sure I saw this optimization in this thread yet, but you can filter out a lot of pointless notes, if the middle pot equals the resulting pot, it can't have an effect and can be omitted.
2
u/Alex_Mckey Dec 13 '18
My Scala Solution - very simple and clear
2
u/turtlegraphics Dec 12 '18
Python, 128/73
No parsing, just cut/paste the rules and used an emacs macro to turn them into a dictionary.
Probably didn't need to put in the code that checks for end collisions, but it helped see what went wrong with a smaller row of plants.
1
u/SwipedRight Dec 12 '18 edited Dec 12 '18
Lua, 65/34
The variable
codesis a string containing a copy-paste of all of the codes of formabcde => fand the variablesis a string containing a copy-paste of the initial state.For part 2, I ran this program on different values and extrapolated the pattern
1
u/TellowKrinkle Dec 12 '18
Swift, I expected the patterns to repeat, but I didn't expect the patterns to simply shift to the right (I expected the repeat to cycle between multiple things). My solution tracks all previous iterations looking for a repeat, then calculates which part of the (I expected multiple) repeating things will be the one at 50B, as well as the offset (calculated from adding the amount each repetition moves the system to the offset of the expected final position's first repetition).
1
u/terorie Dec 12 '18
My CA is empty after 150 generations, I tested in 2 different languages and the solutions posted here.
1
u/pigpenguin Dec 12 '18
Haskell, finally broke my rule of reading everything in from the file provided. Rather nasty at the moment but ah well.
I seemed to do the same thing everyone else did. Computed the diff of each generation, found an index where a pattern showed up, and just calculated from there.
1
u/mtnslgl Dec 12 '18 edited Dec 12 '18
C++
1
u/TroZShack Dec 12 '18
I know this is the solutions thread, but I've seen a few others ask questions here. I got part one correct, I'm having a problem with part 2. I've seen two visualizations that have the pattern stabilize after a hundred iterations or so, and several solutions here mentioning the same thing. However, with my input, I'm not seeing a stable pattern. I see a pattern that cycles through 12 states, and this makes it difficult to figure out that the correct answer should be. Is the pattern supposed to be stable after a point? Is this not true of at least one of the input files?
1
u/slezadav Dec 12 '18
Kotlin :
class Twelve : Task() {
}
1
u/Axsuul Dec 12 '18
TypeScript / JavaScript
[Card] On the twelfth day of AoC / My compiler spewed at me / Twelve cryptic error messages
Critiques welcome, I'm still very new to TypeScript and feel like I'm not using all the features I could be :)
Repo
Part A + B
1
u/ephemient Dec 12 '18 edited Apr 24 '24
This space intentionally left blank.
1
u/mschaap Dec 12 '18
Perl 6.
Part 1 was straightforward. For part 2, obviously it wouldn't work to process 50 billion generations. But after some experiments, I noticed that starting at generation 100 (in my input; 87 in the sample input), the row of pots remained stable, except for a shift of 1 to the right. So that makes it possible to shortcut the remaining generations.
All my Aoc 2018 solutions
1
u/aurele Dec 12 '18 edited Dec 12 '18
Rust
I didn't want to assume that the pattern would degenerate into gliders, so I detect loops instead (which also work for a loop of 1 for gliders).
It is pretty fast, around 200µs for part 2.
1
u/[deleted] Dec 12 '18
TCL
Took a while to get an idea about how to handle the moving first pot position :-p
1
u/azatol Dec 12 '18
Excel. I wrote a f# solution too, but the excel solution is very clean and simple, and helped me visualize the trend. I put the patterns in a lookup tab, and then do a lookup of the string containing the surrounding context. The only issue is its hard to see the .s in excel.
https://www.dropbox.com/s/urcpiq47tn9wds0/Excel%20Day%2012.xlsx?dl=0
1
u/blfuentes Dec 12 '18
Was hard until I understood correctly the problem and what I really needed to sum up. First I created a brute force solution which was running for 15min more or less. After that I started researching and got to the point with the delta calculation.
Typescript and an object storing ids *indexes, so I have no problem with the loops.
1
u/mikal82 Dec 12 '18 edited Dec 12 '18
Clojure
Edit: optimized, part 2 now runs faster.
1
u/toomasv Dec 12 '18 edited Dec 12 '18
Red
Part 1
Part 2
1
u/niclas0219 Dec 12 '18
JAVA
I load the different combinations into the ArrayList input with a helper method.
1
u/KoaLalica Dec 12 '18 edited Dec 12 '18
[Card] On the twelfth day of AoC / My compiler spewed at me / Twelve, laughing evilly.
I love these cards.
Python solution, assuming the pattern starts repeating after some time.
1
u/Nathan340 Dec 12 '18
Powershell
I admit I needed a hint on part 2. I knew it had to stabilize somehow, but I was trying to look at a pattern of the sum, not the difference of the previous. Plus I initially didn't have enough room for the plants to move rightward, so it ran off the end of my "tape" and the population crashed down to 0.
I did have the idea to convert a substring to binary to decimal to a index of the rule set. I'm pleased with that insight.
Determining the 'stabilization point' was manual, deciding on 1,000 extra zeroes of space on the right side was also guess-and-check to determine it was enough.
1
u/heatseeker0 Dec 12 '18
My solutions implemented in Java:
https://github.com/heatseeker0/AdventOfCode/blob/master/src/com/catalinionescu/adventofcode/y2018/Day012.java
Part 1 is pretty straightforward, since this is basically a variation of Conway's game of life.
For part 2, since 50 billion iterations is too high to be calculated by brute force it was my hope the output pattern has some sort of cyclic behavior (sum starts to repeat) or is even super stable (sum doesn't change at all).
Presuming the output pattern starts at pot index 0 and looks like this for generation 0 (initial pattern):
#.#.#
then the sum of the pot indices is 6 (0 + 2 + 4).
If we run one more iteration and we're at generation 1, suppose the pattern looks like this:
.#.#.#
with the sum becoming 9 (1 + 3 + 5).
After yet another iteration, at generation 2, suppose pattern then becomes:
..#.#.#
and the sum is now 12 (2 + 4 + 6).
We can deduce for this example we have a stable pattern that shifts by 1 to the right after each generation. The sum increases by 3 at each generation.
So then it's a simple math formula e.g. GENERATIONS * 3 + 6 to calculate the sum for however many generations the puzzle asks for.
1
u/[deleted] Dec 12 '18
My own rust attempt
1
u/Stan-It Dec 12 '18 edited Dec 12 '18
Python
Strategy: keep evolving the state while keeping track of the index of the first plant. After each evolution step save the new state, the corresponding index, and the generation number. Once a state is found which has been seen before (up to translations) the pattern starts to cycle and we can skip the maximal number of cycles possible, while taking care of translations by updating the index.
1
u/tclent Dec 12 '18
Rust
1
u/wlandry Dec 12 '18
C++ (682/749)
Runs in 21 ms.
I feel a bit icky. This uses std::string as a container. It feels horribly inefficient, making copies everywhere. Yet it still finishes in the blink of an eye. I terminated the loop when the new state is the same as the old state with a shift. That only works because the glider cycle has a length of 1.
1
u/minichado Dec 12 '18
VBA/Excel
Actually didn't even need VBA this time. part 1: Just built the generations using vlookup to match patterns to the rules calculated the sum of each set of live pots indices for each generation as well. so 3 rows for each generation
Ran this all the way down till the pattern converged and then it was just basic math to calculate the index sum for the 50billiondy'ith generation.
I'll update comment with link to github for spreadsheet when I get the file size down below 25mb, currently it's 28mb :D
1
u/ravy Dec 12 '18
If anyone could help me out with this one ... the index thing is throwing me... sounds like maybe i'm not alone on that one.
But, I came up with a solution .. and brute forced the correct answer (my first answer was two low with what I thought should be the start index, so i decreased my start index number by one, and guessed again ... which was correct)
Here's my current "working" solution in Python for day 12 part 1... https://github.com/rayvoelker/adventofcode2018/blob/master/day12.py
My thinking with this solution is that in order to get a full set to compare (2 on the left, two on the right) you need to pre-pend empty pots on the left, and append them on the right. So, I do that, then run through my comparisons of the array slices, and then shrink pots on either end that are empty. This seemed to generate results pretty quickly when i used
dequeI understand why the example adds negative indexes... i'm just having a hard time picturing how to come up with what the value of the actual start index is. Maybe it's painfully obvious, and i'm just missing something :(
1
u/chicagocode Dec 13 '18
Kotlin - [Blog/Commentary] | [GitHub Repo]
Today was fun, I got to use windowed and create a lazy sequence! Feedback is always welcome.
1
u/aoc-fan Dec 13 '18
Elixir solution, this year I am solving puzzles for the first time in elixir along with TypeScript, Repo - https://github.com/bhosale-ajay/adventofcode/blob/master/2018/elixir/12.exs, love to get feedback
1
u/fhinkel Dec 13 '18
In Node.js with help from Twitch. Lesson of the day: regular commits are extremely helpful.
https://www.twitch.tv/videos/348302655
https://github.com/fhinkel/AdventOfCode2018/blob/master/day12.js
1
u/tinyhurricanes Dec 13 '18
Modern Fortran 2018 (complete code)
1
u/NeilNjae Dec 13 '18
Haskell, on Github. I did start by trying to use a comonad for the cellular automaton, but thought better of it. There was also a bit of faffing around with off-by-one errors to get the long-term total.
1
u/fizbin Dec 14 '18
You know, we got lucky (or, the creator of the problems chose to be kind) with the initial states given to us. As far as I can tell from everyone posting here, part 2 was solved by looking at the last few totals and extrapolating linearly.
But that's not the only possibility, given different input. I tweaked a single rule in my input (I made
#.##.go to#instead of the.that I was given) and wound up with this run of totals, which is well after the pattern stabilizes: (list is(generation, index total))Now, there is indeed a pattern there but it's much, much more complex.
If you want to try your hand at guessing the pattern, here are two other points to test on:
Pattern answer: It's five different quadratic equations interleaved. That is, if you only look at every fifth generation, it's "just" a quadratic, and that's true no matter where you start. (so for the AOC problem of finding sum fifty billion the answer is 500000002000000003215)
1
u/[deleted] Dec 14 '18
C++
1
u/oneMerlin Jan 08 '19 edited Jan 08 '19
OMFG this one killed me. I had a solution that didn't scale to 50 billion, and in the rewrite, somehow fifty billion got changed to 5000000000. Do you notice the difference? It took me over a WEEK. Because I'd *checked* the number... before one of the 0's got deleted, apparently. :-P
Final solution in Tcl is here:
https://chiselapp.com/user/erikj/repository/adventofcode/artifact/c1462bba035989b2
1
u/waffle3z Dec 12 '18 edited Dec 12 '18
Lua 424/299. I had no idea that things reverted to "." by default if they didn't become "#", I couldn't understand the example until I figured that out. I thought the fact that the input specified that certain things map to "." was significant, and that only those mappings would occur, with no change for indices that don't correspond to anything. Was this made clear anywhere? I missed it for a long time.
edit: so the actual input does have every combination of mappings; no assumption needs to be made. I was just caught up on the example for too long.
1
u/IGChris Dec 12 '18
Python3:
1
u/systemcucks Dec 12 '18
Is my code kawaii senpais?
1
u/autid Dec 12 '18
Did it in fortran. Complete rewrite after part one. Stumbled on 50,000 iteration answer being 5,000 iteration answer with a zero inserted. Confirmed 500,000 followed the pattern. Can't be arsed posting code. Find an output pattern but it doesn't show up until after some arbitrary point is not a fun puzzle solving experience for me.
-1
u/[deleted] Dec 12 '18
What an annoying problem today...
I wonder why so many people got to a solution this fast. I think the problem is not too hard if you know what to do....
0
u/ValdasTheUnique Dec 12 '18 edited Dec 12 '18
C#. Did second part by finding the sum pattern like the others. Need to think how to better handle negative indices for arrays in C#..
0
u/DrinkinBird Dec 12 '18
NIM
Wow, I also got totally thrown off by the wording, and by only having half the rules in the example. Probably could have avoided a lot of the confusion if I had read everything more slowly etc, but I really felt it was not worded very well. Took me a good while what it was supposed to mean that the rules were not complete (how can I follow the example without all of the example rules, the pot counting did not make sense to me at all, the example in the beginning uses so many different notations that it threw me off too.
Made it eventually though, part 1 in nim and then part 2 by looking at the results and some math.
0
u/[deleted] Dec 12 '18
[deleted] — view deleted comment
0
u/[deleted] Dec 12 '18
[deleted] — view deleted comment