2018 Day 20 Complete
This commit is contained in:
		@@ -7,8 +7,6 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	CLEAR_SCREEN = "\033[H\033[2J"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	MAX_INT = int(^uint(0) >> 1)
 | 
						MAX_INT = int(^uint(0) >> 1)
 | 
				
			||||||
	MIN_INT = -MAX_INT - 1
 | 
						MIN_INT = -MAX_INT - 1
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -110,19 +108,6 @@ func (f *Facility) setRoom(r *Room) {
 | 
				
			|||||||
	f.rooms[r.key()] = r
 | 
						f.rooms[r.key()] = r
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (f *Facility) string() string {
 | 
					 | 
				
			||||||
	var ret string
 | 
					 | 
				
			||||||
	for y := f.minY; y < f.maxY; y++ {
 | 
					 | 
				
			||||||
		for x := f.minX; x < f.maxX; x++ {
 | 
					 | 
				
			||||||
			if r, ok := f.rooms[f.key(x, y)]; !ok {
 | 
					 | 
				
			||||||
				ret += " " + r.key() + " "
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		ret += "\n"
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return ret
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
type Room struct {
 | 
					type Room struct {
 | 
				
			||||||
	x, y int
 | 
						x, y int
 | 
				
			||||||
	dist int
 | 
						dist int
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user