From e8bfbd90da994036a2a05c99436ec2d1b118af0c Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 4 Dec 2023 18:33:14 -0500 Subject: [PATCH] Update readme formatting --- 2023/day2/README.md | 16 +++++++++------- 2023/day2/src/main.rs | 10 ++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/2023/day2/README.md b/2023/day2/README.md index ed1ba34..eca4b61 100644 --- a/2023/day2/README.md +++ b/2023/day2/README.md @@ -23,22 +23,24 @@ from the bag (like 3 red, 5 green, 4 blue). For example, the record of a few games might look like this: +``` Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green +``` In game 1, three sets of cubes are revealed from the bag (and then put back again). The first set is 3 blue cubes and 4 red cubes; the second set is 1 red cube, 2 green cubes, and 6 blue cubes; the third set is only 2 green cubes. -The Elf would first like to know which games would have been possible if the bag contained only 12 red cubes, -13 green cubes, and 14 blue cubes? +The Elf would first like to know which games would have been possible if the bag contained **only 12 red cubes, +13 green cubes, and 14 blue cubes?** -In the example above, games 1, 2, and 5 would have been possible if the bag had been loaded with that configuration. -However, game 3 would have been impossible because at one point the Elf showed you 20 red cubes at once; -similarly, game 4 would also have been impossible because the Elf showed you 15 blue cubes at once. If you add up the -IDs of the games that would have been possible, you get 8. +In the example above, games 1, 2, and 5 would have been **possible** if the bag had been loaded with that configuration. +However, game 3 would have been **impossible** because at one point the Elf showed you 20 red cubes at once; +similarly, game 4 would also have been **impossible** because the Elf showed you 15 blue cubes at once. If you add up the +IDs of the games that would have been possible, you get **8**. Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and -14 blue cubes. What is the sum of the IDs of those games? +14 blue cubes. **What is the sum of the IDs of those games?** diff --git a/2023/day2/src/main.rs b/2023/day2/src/main.rs index e7a11a9..abc89fd 100644 --- a/2023/day2/src/main.rs +++ b/2023/day2/src/main.rs @@ -1,3 +1,9 @@ -fn main() { - println!("Hello, world!"); +struct Cubes { + red: usize, + blue: usize, + green: usize, } + +fn main() { + // TODO: implement +} \ No newline at end of file