Hi Fabio,
Nice work!
You can simplify your hop rule as follows:
This actually gives a significant speedup of ~2,600 playouts per second as opposed to your original version's ~1,800. You can check this using Analysis > Time Random Playouts in Background.
Your formatting is perfect, except that we prefer to merge curly braces for collections to save a couple of lines and reduce indentation, so this:
becomes this:
But this is a minor point and need not be strictly adhered to.
Please keep them coming :)
Regards,
Cameron
Nice work!
You can simplify your hop rule as follows:
Code:
(move Hop
(between
if:(is Occupied (between))
(apply (if (is Enemy (who at:(between))) (remove (between))))
)
(to if:(is Empty (to)))
)
This actually gives a significant speedup of ~2,600 playouts per second as opposed to your original version's ~1,800. You can check this using Analysis > Time Random Playouts in Background.
Your formatting is perfect, except that we prefer to merge curly braces for collections to save a couple of lines and reduce indentation, so this:
Code:
(start
{
(place "Ball1" {"B4" "C5" "C6" ... "G5"})
(place "Ball2" {"B5" "C3" "C4" ... "G4"})
}
)
becomes this:
Code:
(start {
(place "Ball1" {"B4" "C5" "C6" ... "G5"})
(place "Ball2" {"B5" "C3" "C4" ... "G4"})
})
But this is a minor point and need not be strictly adhered to.
Please keep them coming :)
Regards,
Cameron