Skip to content

Instantly share code, notes, and snippets.

@evant
Created December 7, 2021 18:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evant/10f77202e946acfe3b7a7c76a3ea0a88 to your computer and use it in GitHub Desktop.
Save evant/10f77202e946acfe3b7a7c76a3ea0a88 to your computer and use it in GitHub Desktop.
Advent of Code 1a
Dear Princess Celestia: Advent of Code 1.
Today I learned how to calculate how quickly my submarine depth increases.
Did you know that the found depths have the numbers 0 and 0?
Did you know that the number of measurements is a number?
Did you know that the last measurement was a number?
Here's what I did,
I heard the last measurement.
the number of measurements got one more.
the found depths at the number of measurements is now the last measurement.
I did this while the last measurement is not 0.
the number of measurements got one less.
Did you know that the current measurement is the found depths at 1?
Did you know that the number of depth increases is 0?
For every measurement from 2 to the number of measurements,
When the found depths at measurement is more than the current measurement,
the number of depth increases got one more.
That's what I would do.
the current measurement is now the found depths at measurement.
That's what I did.
I said "The answer is: " the number of depth increases!
That's all about how to calculate how quickly my submarine depth increases!
Your faithful student, Pixel Light.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment