day22, example

This commit is contained in:
efim
2023-12-22 09:59:41 +00:00
parent 3ede691333
commit 2b3c7f4ca6
4 changed files with 77 additions and 12 deletions

View File

@@ -62,3 +62,26 @@ func TestSpaceSettleThirdOnTopFirst(t *testing.T) {
// and that overlaps 1-1, 0-2 AND 0-0, 0-2
t.Logf("other blocks should not supt %+v", block3.Supports)
}
func TestSpaceExampleSettleAll(t *testing.T) {
filename := "example"
blocks := ReadBlockFile(filename)
byZ := BlocksByZ(blocks)
space := NewSpace(byZ)
space.SettleAll()
t.Logf("settled space %+v", space)
// maybe i can check via console.
i := 2
t.Logf("level %d is : %+v", i, space.SettledOnZ[i])
// it looks ok for the example.
// let's hope?
t.Logf("for example, free blocks amount is %d", space.CountFreeBlocks())
// oh, i need 'supported'?
// how do i need to count the task question
// i guess we can start with set of all blocks, then?
// run over all, if some block is only supported by some underBlock - remove that underblock
}