reset password
Author Message
rabbott
Posts: 1649
Posted 08:42 Apr 25, 2014 |

As we saw this week, the current rules for Alquerque reward jumps without consideration of the other player's jumps.  Change the rules so that the goal is your jumps minus the other player's jumps. Does your player play differently with those rules?

You will have to implement a form of bounded subtraction where A - B is 0 if B > A. It will look something like this.

;; (diff ?X ?Y ?Z) means X - Y = Z, where "-" is bounded subtraction.

(diff 0 ?X 0)          ;; 0 minus X is still 0.

(diff ?X 0 ?X)         ;; X minus 0 is X

(<= (diff ?A ?B ?D)    ;; X - Y = Z if (X-1) - (Y-1) = Z. 
    (succ ?A1 ?A)      ;; Repeatedly decrement X and Y until one of them becomes 0.
    (succ ?B1 ?B)
    (diff ?A1 ?B1 ?D))

Last edited by rabbott at 09:00 Apr 25, 2014.