0

Anyone here familiar with Advent of code

Just need help with some puzzles

11th Dec 2021, 1:53 PM
John Delvin
John Delvin - avatar
18 Antworten
+ 3
Alex When am solving these puzzles, i always store the input in a file and then read the data, reshape it and use it but with this puzzle my usual way was broken and i tried using numpy to reshape the data but failed. So you are free to solve your way. Or you can just reshape the data and i will do the rest.
12th Dec 2021, 10:22 AM
John Delvin
John Delvin - avatar
+ 3
I made a code setup in case anyone else would like to solve the puzzle: https://code.sololearn.com/cvMp4QRylj8p/?ref=app
12th Dec 2021, 1:24 PM
Alex
Alex - avatar
+ 2
boards = np.array_split(dataset, dataset.size / 5) Don't know how you named your variables. Dataset is the cleaned list and boards the grouped lines Let me know if this works. I rarely use python
12th Dec 2021, 11:52 AM
Alex
Alex - avatar
+ 2
Alex finally done. I need to take nap.
12th Dec 2021, 2:03 PM
John Delvin
John Delvin - avatar
+ 1
Where do you need help? I think I can help you.
11th Dec 2021, 2:22 PM
l0ckD2wN
+ 1
l0ckD2wN do you know how to solve this https://adventofcode.com/2021/day/4 in python
11th Dec 2021, 5:14 PM
John Delvin
John Delvin - avatar
+ 1
Part 1 or 2?
11th Dec 2021, 10:56 PM
Alex
Alex - avatar
12th Dec 2021, 9:01 AM
John Delvin
John Delvin - avatar
+ 1
Could you tell us the individual steps with which you wanted to solve the task? Or do you have a particular step you are struggling with?
12th Dec 2021, 9:30 AM
Alex
Alex - avatar
+ 1
Ash, give it a try.
12th Dec 2021, 10:42 AM
John Delvin
John Delvin - avatar
+ 1
Ash Try day1
12th Dec 2021, 10:50 AM
John Delvin
John Delvin - avatar
+ 1
Alex i already did all that and got the list. What i wanna know is how can i group each 5 rows separatelty?
12th Dec 2021, 11:49 AM
John Delvin
John Delvin - avatar
+ 1
Alex it has worked,thanks alot.
12th Dec 2021, 12:02 PM
John Delvin
John Delvin - avatar
+ 1
Congrats! Part 2 after your nap ^^
12th Dec 2021, 2:05 PM
Alex
Alex - avatar
0
Part 1, I guess. Is there any input given?
12th Dec 2021, 8:40 AM
l0ckD2wN
0
So you have problems handling the dataset. I don't want to give a whole solution (I'd need to write it in python first ^^), but maybe I can you by describing how I parsed the inputfile. 1. read file as a string array of lines 2. parse the first line into an integer array (these are used to run the bingo game loop after parsing the boards) 3. remove the first line and all empty lines What's now being left is a clean list of bingo board rows. Each 5 rows are 1 board. Hope this helps you a bit. Have fun and just ask if something isn't clear.
12th Dec 2021, 11:04 AM
Alex
Alex - avatar
0
Alex am done with both parts,
12th Dec 2021, 2:07 PM
John Delvin
John Delvin - avatar
0
looks interesting how does this look? https://code.sololearn.com/cnGtm7D8akrM/?ref=app
14th Dec 2021, 10:28 AM
Bob_Li
Bob_Li - avatar