Backgammom algorithm