Fix 2020 Day 3
Fixed a bug in the CoordByteMap during 2021 day 9
This commit is contained in:
		@@ -28,8 +28,8 @@ func countTrees(field h.CoordByteMap, x, y int) int {
 | 
				
			|||||||
	trees := 0
 | 
						trees := 0
 | 
				
			||||||
	pos := h.Coordinate{X: x, Y: y}
 | 
						pos := h.Coordinate{X: x, Y: y}
 | 
				
			||||||
	for pos.Y < field.Height {
 | 
						for pos.Y < field.Height {
 | 
				
			||||||
		if pos.X > field.Width {
 | 
							if pos.X >= field.Width {
 | 
				
			||||||
			pos.X = pos.X - field.Width - 1
 | 
								pos.X = pos.X - field.Width
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if field.Get(pos) == '#' {
 | 
							if field.Get(pos) == '#' {
 | 
				
			||||||
			trees++
 | 
								trees++
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user