Created
October 19, 2021 08:48
-
-
Save curegit/48c89904951b38c1b6527b933c56db3e to your computer and use it in GitHub Desktop.
組合せゲーム Subtraction の定義 (CGSuite)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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