Notes de Jérôme Prudent
Notes publiques ...

« Notes

Advent of code 2022 day2

Créée le 11 Sep 2023

  • I copied the input in the first column. Then I split the column in 2 columns with the menu Data > Split text to columns. Column A is elf’s, column B is mine.
  • Then I mapped 2 columns each letter to corresponding score: A=1, B=2, …,Z=3 I used the formula =IFS(A1="A",1,A1="B",2,A1="C",3) which his shorthand for imbricateds ifs. (the first column was wasteful)
  • Then I built a matrix for outcome of the match. But could’nt find a way to exploit this double entry table. So I wrote an IFS of the death with 9 branches. image.png
  • I had everything, a simple formula to sum up and … ⭐️
  • That was straightforward. Building the matrix was a great help for not doing errors in the big IFS. I’m shameful I couldn’t use the matrix though.
  • For the second part I noticeably used named functions. Named functions can be used in formulas. image.png Well, function …
  • The rest was straightforward ⭐️