declare -A tile
19. 10. 2022An attempt at almost βwave collapse algorithmβ. Tiles with 4 nodes, to compare they must be shifted 2 chars. Only compare with left and top.
# Maybe
# β β β ββ β β£ β³ β« β» β
declare -A tile
tile[Β·]=____
tile[β]=_b_d
tile[β]=a_c_
tile[β]=_bc_
tile[β]=__cd
tile[β]=ab__
tile[β]=a__d
tile[β£]=abc_
tile[β³]=_bcd
tile[β«]=a_cd
tile[β»]=ab_d
tile[β]=abcd
Shift string (rotate the four nodes)
string="_bc_"
echo ${string:2:2}${string:0:2}
# c__b
# Which is actually a__d
# for first char on the left (d is not allowed) that becomes
# a___, fits are [β]=a_c_ and [β£]=abc_ and [β]=ab__
β or β or β
β β£ β
To be continuedβ¦