This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 8 -- https://adventofcode.com/2025/day/8 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc08.input', Bool :v(:$verbose) = False); | |
| class ElectricalSystem | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 7 -- https://adventofcode.com/2025/day/7 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc07.input', Bool :v(:$verbose) = False); | |
| my @lines = $inputfile.lines; | |
| my $width = @lines[0].chars; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 6 -- https://adventofcode.com/2025/day/6 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc06.input', Bool :v(:$verbose) = False); | |
| # Apply the operator (+ or *) given as the last element to the remaining terms | |
| sub calculate(@problem is copy) is nodal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 5 -- https://adventofcode.com/2025/day/5 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc05.input', Bool :v($verbose) = False); | |
| sub to-range(Str $s) { Range.new(|$s.comb(/\d+/)».Int) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 4 -- https://adventofcode.com/2025/day/4 | |
| class PaperGrid | |
| { | |
| has Str $.map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 3 -- https://adventofcode.com/2025/day/3 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc03.input', Bool :v($verbose) = False); | |
| sub joltage($bank, $count=2) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 2 -- https://adventofcode.com/2025/day/2 | |
| unit sub MAIN(IO() $inputfile where *.f = 'aoc02.input', Bool :v($verbose) = False); | |
| # Find invalid IDs in a list of ranges | |
| multi invalid-ids(Str $ranges, Bool :$simple = False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 1 -- https://adventofcode.com/2025/day/1 | |
| class Safe | |
| { | |
| has Int $.modulo = 100; | |
| has Int $.dial = $!modulo div 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2025 day 1 -- https://adventofcode.com/2025/day/1 | |
| class Safe | |
| { | |
| has Int $.modulo = 100; | |
| has Int $.dial = $!modulo div 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env raku | |
| use v6.d; | |
| $*OUT.out-buffer = False; # Autoflush | |
| # Advent of Code 2024 day 19 -- https://adventofcode.com/2024/day/19 | |
| class TowelArranger | |
| { | |
| has @.towels; | |
| has @.designs; |
NewerOlder