05-24-2022, 08:57 AM
Hi Michael,
I found a slight change to your loop test that speeds it up x10. of course not using it during the game speeds it up x100 so having the ON / Off still makes sense.
(define "IsALoop"
(not
(all Sites
(difference (sites Board) #1)
if:(!= Infinity
(count Steps
(step
(to
if:(not
(is In (to) #1)
)))
(site)
(difference
(difference (sites Board) #1)
(site)
))))))
The main speed-up is not doing the group check within the connection check code.
A minor speedup is not checking all the board sites that goes hand-in-hand with this approach.
I tried some totally different approaches, but things work best when the compiler can do its own optimizations...
I found a slight change to your loop test that speeds it up x10. of course not using it during the game speeds it up x100 so having the ON / Off still makes sense.
(define "IsALoop"
(not
(all Sites
(difference (sites Board) #1)
if:(!= Infinity
(count Steps
(step
(to
if:(not
(is In (to) #1)
)))
(site)
(difference
(difference (sites Board) #1)
(site)
))))))
The main speed-up is not doing the group check within the connection check code.
A minor speedup is not checking all the board sites that goes hand-in-hand with this approach.
I tried some totally different approaches, but things work best when the compiler can do its own optimizations...