mirror of
				https://github.com/onyx-and-iris/aoc2024.git
				synced 2025-11-04 06:51:47 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			258 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			258 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package pad
 | 
						|
 | 
						|
func neighbours(c coords, r rune) coords {
 | 
						|
	switch r {
 | 
						|
	case '^':
 | 
						|
		return coords{c.x, c.y - 1}
 | 
						|
	case '>':
 | 
						|
		return coords{c.x + 1, c.y}
 | 
						|
	case 'v':
 | 
						|
		return coords{c.x, c.y + 1}
 | 
						|
	case '<':
 | 
						|
		return coords{c.x - 1, c.y}
 | 
						|
	default:
 | 
						|
		return c
 | 
						|
	}
 | 
						|
}
 |