day24: adding python z3, example

This commit is contained in:
efim
2023-12-24 11:47:22 +00:00
parent bea82cb548
commit 5b03b8f156
11 changed files with 378 additions and 96 deletions

View File

@@ -55,7 +55,7 @@ func TestIntersectExampleOne(t *testing.T) {
hA := ReadHailLine("19, 13, 30 @ -2, 1, -2")
hB := ReadHailLine("18, 19, 22 @ -1, -1, -2")
x, y, check := IntersectByTwoPoints(hA, hB)
x, y, check := IntersectBySlopeAndShift(hA, hB)
if !check {
panic("should intersect")
}
@@ -68,7 +68,7 @@ func TestIntersectExampleTwo(t *testing.T) {
hA := ReadHailLine("18, 19, 22 @ -1, -1, -2")
hB := ReadHailLine("20, 25, 34 @ -2, -2, -4")
x, y, check := IntersectByTwoPoints(hA, hB)
x, y, check := IntersectBySlopeAndShift(hA, hB)
if check {
panic("should not intersect")
}
@@ -78,6 +78,9 @@ func TestIntersectExampleTwo(t *testing.T) {
func TestExamplePairwiseChecks(t *testing.T) {
filename := "example"
hails := ReadHailFile(filename)
for _, hail := range hails {
t.Log(hail)
}
intersections := CheckPairwiseIntersections(hails)
t.Log("counted intersections ", intersections)