« first day (2420 days earlier)      last day (882 days later) » 

6:17 AM
Goodmorning all
 
 
2 hours later…
8:15 AM
Hello hello :-)
 
8:49 AM
good morning
 
Hello
@Jaap how is your part2 lol... part1 was easy, but wouldn't scale for part2
 
@zx8754 still struggling with it :-/
 
yep same here... I think idea is not to store all values.
 
that was my conclusion too, trying to figure out how to do it without storing all the values
no luck so far
@zx8754 even on the example data I get Error: vector memory exhausted (limit reached?)
and I have 32gb of RAM .....
 
too bad I can't jump in, this seems fun !
And I have 64 gb RAM :-)
 
9:05 AM
@Cath it is never too late, you can start from day1 and catch up
OK, didn't solve it yet, but I think we just need one vector length of 9, and shift left on each iteration...
 
@zx8754 yep but lack of time :-(
 
9:37 AM
@zx8754 I think you need 2 vectors: one with the numbers (0:8) and one with the counts
 
10:00 AM
@Jaap got it! just one vector, keep shifting to the left, and fix 6s.
 
@zx8754 I'm close
 
I've been close for past 45 mins :))))
 
what's the question/constraint/task to fulfill?
 
@Cath sooo you have time :) here is day6: adventofcode.com/2021/day/6
 
10:15 AM
@zx8754 still not but you're so tempting me !! ;-p
do we need to simulate another initial state ?
 
@zx8754 solved! :-)
 
I'm so dumb that I don't understand the Q : they give an initial state but also tell how many fishes there will be after 80 days. So what are we suppose to do really ? :-/
 
count fish :P
 
yep but change the initial state ?
After 80 days, there would be a total of 5934.

Find a way to simulate lanternfish. How many lanternfish would there be after 80 days?
 
@Cath yes, they give you solution for example data, you will get much bigger real data.... example data is for you to test your solution.
@Cath start with day1, to get into the mood
 
10:30 AM
@Cath you need a for-loop (at least that's how I solved it); in each iteration you change the state
 
@zx8754 you need to log in to get the "real" initial state ?
@Jaap you d'ont need to find the formula then apply it to 80 days ?
 
too much text to build up the story, doesn't help.
 
do you have the real initial state ?
I'll try with their dummy data...
 
@Cath Yes, I think everyone gets different data.
 
@Cath yes, but it is different for each participant
 
10:32 AM
oh ok I see
 
you need to log in to get the puzzle input
 
yeah, I won't do that but I can still play with this one :-)
 
@Cath The earlier you submit the solution, the more points!
 
10:50 AM
@Jaap our solutions are almost identical :) I keep forgetting to use scan...
 
11:11 AM
length(stepOneToTwo(c(3, 4, 3, 1, 2), 80))
[1] 5934
think I've got a recursive function that works pretty well :-)
can I try it on your init set ?
@zx8754 @Jaap
 
This one is Jaaps, there is a link to mine in readme file, too.
 
thanks :-)
the "data.txt" is the init set ?
stepOneToTwo <- function(x, t) {
			if(t==0) {
			   return(x)
			} else {
                           unlist(lapply(x, function(y) if(y==0) stepOneToTwo(c(6, 8), t-1) else stepOneToTwo(y-1, t-1)))
                        }}
FWIW my sol above
I get length of 352151 with the initial set of data.txt
 
@Cath yes, there is a text file for each day
 
ok, so I found 352151, hope it's the right answer (for Jaap's data)
 
@Cath try jaap's solution, and compare
In my repo, I add answers as comments in the R code.
 
11:18 AM
@Cath correct!
 
@Jaap cool !! thanks :-)
I can't believe you have actually created a githup repo for the game :-D
 
@Cath many do, next weekend i'll try to make the list more complete
@zx8754 good idea; going to do that too
 
@Cath this guy has a website... he is number1 on this leaderboard: adventofcode.com/2021/leaderboard/private/view/1032765
 
and thanks for the earlier discussion which tempted me enough it made me try the game, I had fun trying and I always love recursive function, I didn't have the occasion to create one in a long time :-)
 
Cath, now try part2... t=256
 
11:22 AM
@zx8754 oh my, since 2015 ?!!
@zx8754 will make my pc explode probably ^^ . Same init ?
 
@Cath you can solve start solving any past year, no need to time travel :D
 
lol, surely a good way to have fun when you're bored :-)
@zx8754 anyone try to benchmark the different sol ?
 
@Cath nah, not me. Already spending too much time on it.
 
:-D
if you try to sign in via github, they ask for some permission to go in your account, right? I find it a little "scary"...
recursive function takes a lot of time but doesn't seem too greedy on RAM
 
@Cath it is ok.
Pretty sure safer than fb
 
11:38 AM
@zx8754 good point...
 
 
4 hours later…
3:51 PM
@zx8754 I've tried is part 2 sol, doesn't seem to work or am I missing something ? :-/ (tried it with toy example)
 
4:24 PM
@Cath day6 part2? your recursive function?
 
@zx8754 the guy who made a website with the game, his part one sol works but not the second
 
@Cath do you get an error?
 
@Cath you are right, his solution gives wrong output for my data
 
30 messages moved to Trash can
 
@Cath Just asked on twitter, let's see if comes back.
 
4:38 PM
@zx8754 for my data I also get the wrong output with his solution
 
 
3 hours later…
7:41 PM
@zx8754 great minds think alike ;-)
 

« first day (2420 days earlier)      last day (882 days later) »