Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Square Chest by ArchTauruS
def checkio(lines_list):
[line.sort() for line in lines_list]
squares = [
[[1, 2], [2, 6], [5, 6], [1, 5]],
[[2, 3], [3, 7], [6, 7], [2, 6]],
[[3, 4], [4, 8], [7, 8], [3, 7]],
[[5, 6], [6, 10], [9, 10], [5, 9]],
[[6, 7], [7, 11], [10, 11], [6, 10]],
[[7, 8], [8, 12], [11, 12], [7, 11]],
[[9, 10], [10, 14], [13, 14], [9, 13]],
[[10, 11], [11, 15], [14, 15], [10, 14]],
[[11, 12], [12, 16], [15, 16], [11, 15]],
[
[1, 2], [2, 3], [3, 7], [7, 11],
[9, 10], [10, 11], [1, 5], [5, 9]],
[
[2, 3], [3, 4], [4, 8], [8, 12],
[10, 11], [11, 12], [2, 6], [6, 10]],
[
[5, 6], [6, 7], [7, 11], [11, 15],
[13, 14], [14, 15], [5, 9], [9, 13]],
[
[6, 7], [7, 8], [8, 12], [12, 16],
[14, 15], [15, 16], [6, 10], [10, 14]],
[
[1, 2], [2, 3], [3, 4],
[4, 8], [8, 12], [12, 16],
[1, 5], [5, 9], [9, 13],
[13, 14], [14, 15], [15, 16]]]
return sum(all(dot in lines_list for dot in _) for _ in squares)
Sept. 17, 2014
Comments: