Post History
Haskell + hgl, 134 bytes k=cy"X.XX" x#1=[4,0,9,9]!x 2#y=8 3#y=[8,9,4,4]!y x#3=[0,3]!x _#_=0 x?y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k] Attempt This Onlin...
Answer
#4: Post edited
# [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 136 bytes- ```haskell
- k=cy"X.XX"
2#y=[8,9]!y- 3#y=[8,9,4,4]!y
x#1=[4,0]!x- x#3=[0,3]!x
- _#_=0
- x?y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k]
- ````
[Attempt This Online!](https://ato.pxeger.com/run?1=lZHPaoNAEMbpdZ9i_BNYy0asbiAJbnMpgd4CvQgiIlGpWTWp1eJCL731HXrxUvpM6dN0g54sNA0s7Dczv4_5YD6-HqNnnuR5d1Sy4rCvanhqojxLsySGTZXkTZygYbD5bOp0Oj--c7YVqmd6nopsTTB_ThaBIpAzaEIJPdWtdsN8SqxAaaV2mG8R56RDLWQWalfiFZdkZ7jT9OUOqN5OqIbFhBqs5iD0uIKdLlXrSlW6W-HHlQ2ccCKXm55KeNDn-b56SxleGaiIspLFewRQhHB4AB1SsC35ZEeWqor6EcbXt33DAHdgXcliG5ZLuC9rwwDfNs1FcIZ3LuTpL_4vw3ocaXZuxXoc6n8OerFjNnb0l-i6_v8B)- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
- # [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 134 bytes
- ```haskell
- k=cy"X.XX"
- x#1=[4,0,9,9]!x
- 2#y=8
- 3#y=[8,9,4,4]!y
- x#3=[0,3]!x
- _#_=0
- x?y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k]
- ````
- [Attempt This Online!](https://ato.pxeger.com/run?1=lZHNaoNAFIXpdp7i-hOYKROxOgENTrMpge4C3QgiIlGp8Sep1eJAN930JbrJJvSZ0qfpFLOy0DQwzNx77ne4B-bj8zF-LtKy3B-VvNptmxaeurjMszxNYNWkZZek6DRYHbo2mzrH94Kvheobvq-iXrvhAaMmdakbKj2yNMEdZMs7cKTGKAsVISmbBya1f4hIi7iJ-oV4xTXdEG-avdwB0_sJ07CYMMLbAoSeNLDRZdV7sqq9tQiSxoKCFlSuNnyVFuGQ5uvqLeN4QVAV5zVPtgigimD3ADpkYJnySEW2qoqGEcbXt4NAwDuxnmSxBfM53NctIRBYhuGGZ3j7Qp794v8yLMeRZudWLMeh_udgFztmY8fwE_v98H4D)
- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
#3: Post edited
# [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 142 bytes- ```haskell
- k=cy"X.XX"
- 3#y=[8,9,4,4]!y
2#y=[8,9,8,8]!y- x#1=[4,0]!x
- x#3=[0,3]!x
- _#_=0
f x y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k]- ````
[Attempt This Online!](https://ato.pxeger.com/run?1=lZHNaoNAFIXpdp7i-hMYy0SsTsAEp6sS6C7QjSAiEpWaUZNaLQ7tM_QFunFT8kzp03SC6cZC08DAnHPvd5gD87F_jJ95WhT9QcnL3bZu4KmNizzL0wRWdVq0SYpOi9Vn22RT9_DO2Vqovun7KnI0wQKXzAklNFQEsn-8S9yj77QbFlBihUontcMCizhHHWkRs1AGHYg3XJGN4U2zlzugejehGhYTarCGg9CTGja6VJ0nVeWtRZDUNnDCiaxg-irh4dDq6-q1jPOKJVsEUEawewAdMrAteeREWlVFwwrj69thYIB3Yj3JYhsWC7ivGsOAwDbNeXiGdy7k6S_-r8ByXGl27onluNT_EvTixGycGP6g74f7Gw)- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
- # [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 136 bytes
- ```haskell
- k=cy"X.XX"
- 2#y=[8,9]!y
- 3#y=[8,9,4,4]!y
- x#1=[4,0]!x
- x#3=[0,3]!x
- _#_=0
- x?y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k]
- ````
- [Attempt This Online!](https://ato.pxeger.com/run?1=lZHPaoNAEMbpdZ9i_BNYy0asbiAJbnMpgd4CvQgiIlGpWTWp1eJCL731HXrxUvpM6dN0g54sNA0s7Dczv4_5YD6-HqNnnuR5d1Sy4rCvanhqojxLsySGTZXkTZygYbD5bOp0Oj--c7YVqmd6nopsTTB_ThaBIpAzaEIJPdWtdsN8SqxAaaV2mG8R56RDLWQWalfiFZdkZ7jT9OUOqN5OqIbFhBqs5iD0uIKdLlXrSlW6W-HHlQ2ccCKXm55KeNDn-b56SxleGaiIspLFewRQhHB4AB1SsC35ZEeWqor6EcbXt33DAHdgXcliG5ZLuC9rwwDfNs1FcIZ3LuTpL_4vw3ocaXZuxXoc6n8OerFjNnb0l-i6_v8B)
- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
#2: Post edited
# [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 144 bytes- ```haskell
- k=cy"X.XX"
- 3#y=[8,9,4,4]!y
- 2#y=[8,9,8,8]!y
- x#1=[4,0]!x
- x#3=[0,3]!x
- _#_=0
f x y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy"...X",k]- ````
[Attempt This Online!](https://ato.pxeger.com/run?1=lZDPaoNAEMbp1acY_wTWslmsbsAEt6cS6C3QiyBiJbrUrJrUanGhD9F7L15Knyl9miq2FwtNc5rfzHwf8zFvHw_xk0jzvDuqWXHYVzU8NnGe8SxNYFOleZOkyvdi897UfO4eXwXbSs0nvq8pji5Z4OIlppiGqlTsn97F7tC3-hULKLZCte3ZYYGFnYEjPWKWwqEF-YJKvDO9OX--AWq0M6ojOaMmqwVII6lgZ_TUej2V3lYGSWWDwAL3EQghvoZFOOb6vLgv4qxkyV4BKCJA6PIaDnegaSZ4w6BnDzggG1YruC1r04TAJmQZntA7Z-rpL_1fhvU00uLUifU01P8c9GzHYuoYH911Y_0C)- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
...X...X...X...X...X- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
...X...X...X...X...X- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
...X...X...X...X...X- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
...X...X...X...X...X- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
...X...X...X...X...X- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
- # [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 142 bytes
- ```haskell
- k=cy"X.XX"
- 3#y=[8,9,4,4]!y
- 2#y=[8,9,8,8]!y
- x#1=[4,0]!x
- x#3=[0,3]!x
- _#_=0
- f x y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy".X",k]
- ````
- [Attempt This Online!](https://ato.pxeger.com/run?1=lZHNaoNAFIXpdp7i-hMYy0SsTsAEp6sS6C7QjSAiEpWaUZNaLQ7tM_QFunFT8kzp03SC6cZC08DAnHPvd5gD87F_jJ95WhT9QcnL3bZu4KmNizzL0wRWdVq0SYpOi9Vn22RT9_DO2Vqovun7KnI0wQKXzAklNFQEsn-8S9yj77QbFlBihUontcMCizhHHWkRs1AGHYg3XJGN4U2zlzugejehGhYTarCGg9CTGja6VJ0nVeWtRZDUNnDCiaxg-irh4dDq6-q1jPOKJVsEUEawewAdMrAteeREWlVFwwrj69thYIB3Yj3JYhsWC7ivGsOAwDbNeXiGdy7k6S_-r8ByXGl27onluNT_EvTixGycGP6g74f7Gw)
- I first set up a pretty dense background pattern which doesn't break any rules:
- ```
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- XXX.XXX.XXX.XXX.XXX.
- X.XXX.XXX.XXX.XXX.XX
- .X.X.X.X.X.X.X.X.X.X
- X.XXX.XXX.XXX.XXX.XX
- ```
- All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error.
- Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses.
- There might be an opportunity to optimize this by finding better numbers.
#1: Initial revision
# [Haskell](https://www.haskell.org) + [hgl](https://gitlab.com/wheatwizard/haskell-golfing-library), 144 bytes ```haskell k=cy"X.XX" 3#y=[8,9,4,4]!y 2#y=[8,9,8,8]!y x#1=[4,0]!x x#3=[0,3]!x _#_=0 f x y|(n,j)<-fvD 4$x%4#(y%4)=tk y$dr j$tk x<dr n<cy[dr2 k,k,cy"...X",k] ```` [Attempt This Online!](https://ato.pxeger.com/run?1=lZDPaoNAEMbp1acY_wTWslmsbsAEt6cS6C3QiyBiJbrUrJrUanGhD9F7L15Knyl9miq2FwtNc5rfzHwf8zFvHw_xk0jzvDuqWXHYVzU8NnGe8SxNYFOleZOkyvdi897UfO4eXwXbSs0nvq8pji5Z4OIlppiGqlTsn97F7tC3-hULKLZCte3ZYYGFnYEjPWKWwqEF-YJKvDO9OX--AWq0M6ojOaMmqwVII6lgZ_TUej2V3lYGSWWDwAL3EQghvoZFOOb6vLgv4qxkyV4BKCJA6PIaDnegaSZ4w6BnDzggG1YruC1r04TAJmQZntA7Z-rpL_1fhvU00uLUifU01P8c9GzHYuoYH911Y_0C) I first set up a pretty dense background pattern which doesn't break any rules: ``` XXX.XXX.XXX.XXX.XXX. X.XXX.XXX.XXX.XXX.XX ...X...X...X...X...X X.XXX.XXX.XXX.XXX.XX XXX.XXX.XXX.XXX.XXX. X.XXX.XXX.XXX.XXX.XX ...X...X...X...X...X X.XXX.XXX.XXX.XXX.XX XXX.XXX.XXX.XXX.XXX. X.XXX.XXX.XXX.XXX.XX ...X...X...X...X...X X.XXX.XXX.XXX.XXX.XX XXX.XXX.XXX.XXX.XXX. X.XXX.XXX.XXX.XXX.XX ...X...X...X...X...X X.XXX.XXX.XXX.XXX.XX XXX.XXX.XXX.XXX.XXX. X.XXX.XXX.XXX.XXX.XX ...X...X...X...X...X X.XXX.XXX.XXX.XXX.XX ``` All we have to do is make sure the pattern is aligned so there's always a path. I wish I had some clever way of doing this, but I just use a bunch of magic numbers I calculated by trial and error. Since the pattern repeats with period 4, I just tried every pair of numbers on the range 1-4 and found a shifting that lined up. I encoded these in base 4 and that's what the program uses. There might be an opportunity to optimize this by finding better numbers.