Skip to content

Commit 6961dff

Browse files
committed
2024, day 6
1 parent 9b489af commit 6961dff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

2024/6/common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ const (
1616

1717
type P struct{ x, y int }
1818

19-
func parseMap() (map[P]any, P, uint8) {
19+
func parseMap() (map[P]struct{}, P, uint8) {
2020
var pos P
2121
scanner := bufio.NewScanner(os.Stdin)
22-
m := map[P]any{}
22+
m := map[P]struct{}{}
2323
for i := 0; scanner.Scan(); i++ {
2424
line := scanner.Text()
2525
for j, c := range line {

2024/6/main2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type State struct {
2626
Dir uint8
2727
}
2828

29-
func testObstacle(m map[P]any, obstacle, pos P, dir uint8) bool {
29+
func testObstacle(m map[P]struct{}, obstacle, pos P, dir uint8) bool {
3030

3131
// impossible if the guard is there
3232
if obstacle == pos {

0 commit comments

Comments
 (0)