Skip to content

Instantly share code, notes, and snippets.

@curegit
Created October 19, 2021 08:48
Show Gist options
  • Save curegit/48c89904951b38c1b6527b933c56db3e to your computer and use it in GitHub Desktop.
Save curegit/48c89904951b38c1b6527b933c56db3e to your computer and use it in GitHub Desktop.
組合せゲーム Subtraction の定義 (CGSuite)
class Subtraction extends ImpartialGame
var lrset; // The subtraction set
var n; // The heap size
method Subtraction(Set lrset, Number n)
end
override method Options(Player player)
return setof(Subtraction(lrset, n - k) for k in lrset where n - k >= 0);
end
override property ToString.get
return "Subtraction(" + lrset.ToString + "," + n.ToString + ")";
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment