func numberFromWires(wires string, key displayKey) string {
	// sorting makes things easier
	blah := sortString(wires)
	switch (blah) {
	case sortString(key.top + key.topLeft + key.topRight + key.bottomLeft + key.bottomRight + key.bottom):
		return "0"
	case sortString(key.topRight + key.bottomRight):
		return "1"
	case sortString(key.top + key.topRight + key.middle + key.bottomLeft + key.bottom):
		return "2"
	case sortString(key.top + key.topRight + key.middle + key.bottomRight + key.bottom):
		return "3"
	case sortString(key.topLeft + key.topRight + key.middle + key.bottomRight):
		return "4"
	case sortString(key.top + key.topLeft + key.middle + key.bottomRight + key.bottom):
		return "5"
	case sortString(key.top + key.topLeft + key.middle + key.bottomLeft + key.bottomRight + key.bottom):
		return "6"
	case sortString(key.top + key.topRight + key.bottomRight):
		return "7"
	case sortString(key.top + key.topLeft + key.topRight + key.middle + key.bottomLeft + key.bottomRight + key.bottom):
		return "8"
	case sortString(key.top + key.topLeft + key.topRight + key.middle + key.bottomRight + key.bottom):
		return "9"
	default:
		panic("something has gone horribly horribly wrong")
	}
}
// in retrospect... the display key keeping a map of (sorted) strings -> number would have been easier
// oh well
in retrospect... the display key keeping a map of (sorted) strings -> number would have been easier
oh well
// in retrospect ... the display key keeping a map of ( sorted ) strings - > number would have been easier // oh well
func numberFromWires(wires string, key displayKey) string {
	blah := sortString(wires)
	switch (blah) {
	case sortString(key.top + key.topLeft + key.topRight + key.bottomLeft + key.bottomRight + key.bottom):
		return "0"
	case sortString(key.topRight + key.bottomRight):
		return "1"
	case sortString(key.top + key.topRight + key.middle + key.bottomLeft + key.bottom):
		return "2"
	case sortString(key.top + key.topRight + key.middle + key.bottomRight + key.bottom):
		return "3"
	case sortString(key.topLeft + key.topRight + key.middle + key.bottomRight):
		return "4"
	case sortString(key.top + key.topLeft + key.middle + key.bottomRight + key.bottom):
		return "5"
	case sortString(key.top + key.topLeft + key.middle + key.bottomLeft + key.bottomRight + key.bottom):
		return "6"
	case sortString(key.top + key.topRight + key.bottomRight):
		return "7"
	case sortString(key.top + key.topLeft + key.topRight + key.middle + key.bottomLeft + key.bottomRight + key.bottom):
		return "8"
	case sortString(key.top + key.topLeft + key.topRight + key.middle + key.bottomRight + key.bottom):
		return "9"
	default:
		panic("something has gone horribly horribly wrong")
	}
}
func numberFromWires ( wires string , key displayKey ) string { blah := sortString ( wires ) switch ( blah ) { case sortString ( key . top + key . topLeft + key . topRight + key . bottomLeft + key . bottomRight + key . bottom ) : return " " case sortString ( key . topRight + key . bottomRight ) : return " " case sortString ( key . top + key . topRight + key . middle + key . bottomLeft + key . bottom ) : return " " case sortString ( key . top + key . topRight + key . middle + key . bottomRight + key . bottom ) : return " " case sortString ( key . topLeft + key . topRight + key . middle + key . bottomRight ) : return " " case sortString ( key . top + key . topLeft + key . middle + key . bottomRight + key . bottom ) : return " " case sortString ( key . top + key . topLeft + key . middle + key . bottomLeft + key . bottomRight + key . bottom ) : return " " case sortString ( key . top + key . topRight + key . bottomRight ) : return " " case sortString ( key . top + key . topLeft + key . topRight + key . middle + key . bottomLeft + key . bottomRight + key . bottom ) : return " " case sortString ( key . top + key . topLeft + key . topRight + key . middle + key . bottomRight + key . bottom ) : return " " default : panic ( " " ) } }
in retrospect... the display key keeping a map of (sorted) strings -> number would have been easier
oh well
in retrospect ... the display key keeping a map of ( sorted ) strings - > number would have been easier oh well
// sorting makes things easier