instance Show Cube where
show c =
- "Cube_" ++ (show (i c)) ++ "," ++ (show (j c)) ++ "," ++ (show (k c)) ++
- " (Center: " ++ (show (center c)) ++ ")" ++
- " (xmin: " ++ (show (xmin c)) ++ ")" ++
- " (xmax: " ++ (show (xmax c)) ++ ")" ++
- " (ymin: " ++ (show (ymin c)) ++ ")" ++
- " (ymax: " ++ (show (ymax c)) ++ ")" ++
- " (zmin: " ++ (show (zmin c)) ++ ")" ++
- " (zmax: " ++ (show (zmax c)) ++ ")"
+ "Cube_" ++ subscript ++ "\n" ++
+ " h: " ++ (show (h c)) ++ "\n" ++
+ " Center: " ++ (show (center c)) ++ "\n" ++
+ " xmin: " ++ (show (xmin c)) ++ "\n" ++
+ " xmax: " ++ (show (xmax c)) ++ "\n" ++
+ " ymin: " ++ (show (ymin c)) ++ "\n" ++
+ " ymax: " ++ (show (ymax c)) ++ "\n" ++
+ " zmin: " ++ (show (zmin c)) ++ "\n" ++
+ " zmax: " ++ (show (zmax c)) ++ "\n"
+ where
+ subscript =
+ (show (i c)) ++ "," ++ (show (j c)) ++ "," ++ (show (k c))
+
empty_cube :: Cube
empty_cube = Cube 0 0 0 0 empty_values