Skip to content

Commit 6895ea2

Browse files
committed
Tidy comments
1 parent 6dc0804 commit 6895ea2

File tree

34 files changed

+50
-50
lines changed

34 files changed

+50
-50
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It should generally fall into one of the following two categories:
2020

2121
When contributing to this project, you must agree that you have authored 100% of the content,
2222
that you have the necessary rights to the content and that the content you contribute
23-
may be provided under the project licence.
23+
may be provided under the project license.
2424

2525
## Guidelines
2626

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Place input files in `input/yearYYYY/dayDD.txt` including leading zeroes. For ex
4242

4343
**Document**
4444
* Build docs including private items `cargo doc --document-private-items`
45-
* Build doc then open HTML landing page `cargo doc --document-private-items --open`
45+
* Build docs then open HTML landing page `cargo doc --document-private-items --open`
4646

4747
**Miscellaneous**
4848
* Code quality lints `cargo clippy`

src/util/grid.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
//! assert_eq!(grid[point], b'2');
1717
//! ```
1818
//!
19-
//! A convenience [`parse`] method creates a `Grid` directly from a 2 dimenionsal set of
20-
//! ASCII characters, a common occurence in Advent of Code inputs. The [`same_size_with`] function
19+
//! A convenience [`parse`] method creates a `Grid` directly from a 2 dimensional set of
20+
//! ASCII characters, a common occurrence in Advent of Code inputs. The [`same_size_with`] function
2121
//! creates a grid of the same size, that can be used for in BFS algorithms for tracking visited
22-
//! location or for tracking cost in Djikstra.
22+
//! location or for tracking cost in Dijkstra.
2323
//!
2424
//! [`Point`]: crate::util::point
2525
//! [`parse`]: Grid::parse

src/year2015/day17.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn part1(input: &[u32]) -> u32 {
5959
input.iter().sum()
6060
}
6161

62-
/// We want the number of combination with the fewest containers, so find first non-zero value.
62+
/// We want the number of combinations with the fewest containers, so find first non-zero value.
6363
pub fn part2(input: &[u32]) -> u32 {
6464
*input.iter().find(|&&n| n > 0).unwrap()
6565
}

src/year2016/day15.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! For simplicity we use the "search by sieving" method. We start at zero with a step the size of
88
//! the first integer. Then we search for each subsequent integer located at the correct offset of
9-
//! minutes and multiply the step by the new integer. This preserve the relative offset at each step
9+
//! minutes and multiply the step by the new integer. This preserves the relative offset at each step
1010
//! in the next search.
1111
use crate::util::iter::*;
1212
use crate::util::parse::*;

src/year2016/day16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
//!
3333
//! Now for the really neat part. We can recursively find the number of ones in `y` by repeating
3434
//! the same process by setting the new `length` to `next`. We keep recursing until the length
35-
//! is less the size of the inital input and we can lookup the final count from the prefix sum.
35+
//! is less the size of the initial input and we can lookup the final count from the prefix sum.
3636
use crate::util::parse::*;
3737

3838
/// Build a prefix sum of the number of ones at each length in the pattern

src/year2017/day03.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! ------------>
2020
//! ```
2121
//!
22-
//! The first component is the horizonal or vertical distance from the centre to the ring,
22+
//! The first component is the horizontal or vertical distance from the centre to the ring,
2323
//! in this case 2 steps. The second component is the distance from the target number to the
2424
//! center of each edge, in this case 2 - 1 = 1.
2525
//!

src/year2017/day24.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
//! # Electromagnetic Moat
22
//!
3-
//! Both parts are calculated at the same time by recurively building all possible bridge
4-
//! combinations. Two optimizations are used to speed things up ten times
3+
//! Both parts are calculated at the same time by recursively building all possible bridge
4+
//! combinations. Two optimizations are used to speed things up ten times.
55
//!
66
//! First ports that only appear in two components are merged. For example `2/17` and `17/3`
77
//! becomes a single component `2/3` with a weight of 39 and a length of 2. This shaves about 30%
88
//! off the time needed.
99
//!
1010
//! The second optimization is far more critical and reduces the time needed by 85%. The
11-
//! observation is that compenets with two ports the same, for example `7/7` are always optimal
11+
//! observation is that components with two ports the same, for example `7/7` are always optimal
1212
//! to pick first, as they increase strength and length without changing the port number.
1313
//!
1414
//! If we can place such a component then there's no need to consider further components which
15-
//! reduces the total number of combination to consider.
15+
//! reduces the total number of combinations to consider.
1616
use crate::util::bitset::*;
1717
use crate::util::iter::*;
1818
use crate::util::parse::*;

src/year2018/day09.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//! ```
3535
//!
3636
//! Things start to get interesting at the 19th marble. When we pick the 23rd marble this will
37-
//! be 7 places counter clockwise, so we can optimize by not adding it at all the the circle.
37+
//! be 7 places counter clockwise, so we can optimize by not adding it at all to the circle.
3838
//! Instead we save the value for later.
3939
//!
4040
//! ```none

src/year2018/day16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn part2(input: &Input) -> usize {
7474

7575
while let Some(index) = masks.iter().position(|m| m.count_ones() == 1) {
7676
let mask = masks[index];
77-
// This opcode has only 1 possible mapping, so remove possbility from other opcodes.
77+
// This opcode has only 1 possible mapping, so remove possibility from other opcodes.
7878
masks.iter_mut().for_each(|m| *m &= !mask);
7979
// Add mapping.
8080
convert[index] = mask.trailing_zeros() as usize;

0 commit comments

Comments
 (0)