This appendix lists all of the methods (built-in functions) and keywords currently available in Combinatorial Game Suite. G,H,S,T,
etc. represent games.
Canonicalize(G) | The canonical form of G. |
C(G) | Shorthand for Canonicalize(G). |
LeftOptions(G) | The left options of G. |
RightOptions(G) | The right options of G. |
OrdinalSum(G,H) | The ordinal sum of G and H. |
Mean(G) | The mean value of G. |
Temperature(G) | The temperature of G. |
Thermograph(G) | The thermograph of G.
(Use Plot(Thermograph(G)) to plot it.) |
Cool(G,t) | G cooled by the temperature t. |
Chill(G) | G cooled by 1. |
Freeze(G) | G cooled by its temperature. |
Heat(G,T) | G heated by T. |
Overheat(G,S,T) | G overheated from S to T. |
Dissociate(G) | The Norton thermal dissociation of G. |
LeftStop(G) | The left stop of G. |
RightStop(G) | The right stop of G. |
Tiny(G) | Tiny-G. |
Miny(G) | Miny-G. |
Pow(G,n) | The game Gn. (G must have form {0|H}) |
PowTo(G,n) | The game G->n. (G must have form {0|H}) |
Superstar | The
superstar with exponent n1,n2,n3,... |
LeftIncentives(G) | The canonical left incentives of G. |
RightIncentives(G) | The canonical right incentives of G. |
Incentives(G) | The canonical incentives of G. |
Birthday(G) | The canonical birthday of G. |
LeftCriticalTemps(G) | The left critical
temperatures of G. |
RightCriticalTemps(G) | The right
critical temperatures of G. |
IsAllSmall(G) | true if G is all small. |
IsEven(G) | true if G
is a (canonical or misere) even game. |
IsInfinitesimal(G) | true if G is infinitesimal. |
IsNimber(G) | true if G
is a (canonical or misere) nimber. |
IsNumber(G) | true if G
is a number. |
IsNumberish(G) | true if G
is number-ish. |
IsOdd(G) | true if G
is a (canonical or misere) odd game. |
AtomicWeight(G) | The atomic weight of G. |
Rcf(G) | The reduced canonical form of G. |
OrthodoxForm(G) | An orthodox form for G
(obtained by eliminating unorthodox options for G and all
of its followers). |
ConwayProduct(G,H) | The Conway product of G
and H. |
Onside(G) | The onside of G. |
Offside(G) | The offside of G. |
Upsum(G,H) | The upsum of G and H. |
Downsum(G,H) | The downsum of G and H. |
Degree(G) | The degree of loopiness of G. |
Sidle(G) | The sidled form of G. |
Options(G) | The options of the impartial game G |
Heap(R,n) | A heap with rules R and size n |
GrundySequence(R,n) | A list of the first n values of the heap game
with rules R |
HeapRules(f) | Converts the procedure f into heap rules |
Games in canonical misere form, as in Winning Ways and On Numbers and Games
M(G1,G2,...,Gn) | The misere game with options
G1,G2,...,Gn |
GValue(G) | The normal play nim-value of G, G+(G). |
MisereGValue(G) | The misere nim-value of G, G-(G). |
Genus(G) | The genus sequence [G+(G), G-(G), G-(G+2), G-(G+2+2), ...]. |
IsTame(G) | True if G can be treated as a nim-heap sum |
IsRestive(G) | True if G is restive, of genus 0λ or 1λ. |
IsHalfTame(G) | True if G is half-tame, G+G tame of genus 00. |
IsRestless(G) | True if G is restless, of genus g0 or g1. |
Phylum(G) | A string "NIMHEAP", "HEREDITARILY_TAME", "REVERSIBLY_TAME", "TAMEABLE", "WILD_OF_TAME_GENUS", "HEREDITARILY_RESTIVE", "REVERSIBLY_RESTIVE", "WILD_OF_RESTIVE_GENUS", "RESTLESS", "WILD_OF_RESTLESS_GENUS", or "WILD" |
DiscriminatorPN(G,H) | A canonical misere game K such that o-(G+K)=P and o-(G+H)=N. |
Discriminator(G,H) | A canonical misere game K such that o-(G+K) ≠ o-(H+K). |
IsLinked(G,H) | True if there exists a canonical misere game K such that o-(G+K) = o-(H+K) = P. |
FindLink(G,H) | If IsLinked(G,H), then a canonical misere game K for which o-(G+K) = o-(H+K) = P. |
Mate(G) | The game G-, in which all canonical positions of G have *0, *1 replaced with *1, *0. |
IsExtraverted(G) | True if every option of G is a part of G. |
IsIntroverted(G) | True if G is a part of every option of G. Only *0 and *1 are introverted. |
MisereDifference(G,H) | A canonical misere game K such that G=H+K, if one exists. |
Parts(G) | A list of all nonzero even canonical misere games K such that Difference(G,K) exists |
PrimeParts(G) | A list of all of Parts(G) that are prime. |
Partitions(G) | A list of all lists of prime parts of G that sum to G. Factorizations of odd canonical misere games are preceded by *1 |
IsPrime(G) | True G has no parts other than 0, 1, G, and G+1. IsPrime(*0) is true. |
Amazons |
The Amazons position with rows given by S1,S2,S3,... Each Sn should be a string consisting only of the following characters: L R . X
(Example:
Amazons("L...","R...")) |
Clobber |
The Clobber position with rows given by S1,S2,S3,... Each Sn should be a string consisting only of the following characters: L R . |
Domineering |
The Domineering position with rows given by S1,S2,S3,... Each Sn should be a string consisting only of the following characters:
. X |
DomineeringRectangle |
The empty m by n Domineering position. |
Konane |
The Konane position with rows given by S1,S2,S3,... Each Sn should be a string consisting only of the following characters: L R
. |
FoxAndGeeseTable |
A table containing the values of all Fox and Geese positions with the specified coordinates for the geese. The coordinates are zero-based with (0,0) corresponding to the lower-left corner.
(Example: FoxAndGeeseTable(1,3,3,3,5,3,7,3)) |
ToadsAndFrogs(S) |
The Toads and Frogs position given by S. S should be a string consisting only of the following three characters: T F . |
SensibleLeftOptions(G) |
A minimal set of sensible left options of G
(roughly, those that correspond to a canonical option via a reversible
sequence of moves). |
SensibleRightOptions(G) |
A minimal set of sensible right options of G. |
SensibleLeftLines(G) |
A set of sensible left lines of play of G.
This is a list of lists, each containing a reversible sequence of moves
from G that terminates in a left option of C(G).
There will be exactly one sequence for each left option of C(G). |
SensibleRightLines(G) |
A set of sensible right lines of play of G. |
OrthodoxLeftOptions(G) |
A minimal set of orthodox left options of G
(those that are thermographically relevant). |
OrthodoxRightOptions(G) |
A minimal set of orthodox right options of G. |
OrthodoxLeftLines(G) |
A set of orthodox left lines of play of G.
There will be exactly one sequence for each left option of OrthodoxLeftOptions(C(G)). |
OrthodoxRightLines(G) |
A set of orthodox right lines of play of G. |
Length(L) | The length of the list or string L. |
Contains(L,X) | true if the object X
is contained in the list or string L. |
Add(L,X) | Adds the object X to
the end of the list L. |
Remove(L,n) | Removes the nth
object from the list L, decreasing the length of L
by one. |
Append(L1,L2) | Appends
the list L2 to the end of L1. |
IsBound(L,n) | true if there is an
object at the nth position of the list L. |
Unbind(L,n) | Removes the nth
object from the list L, leaving the length of L
unchanged (and a hole at position n). |
Sort(L,f) | Sorts the list L
according the comparator procedure f. f
must be a two-argument procedure with f(X,Y) a canonical
game for each pair X,Y in L. If f(X,Y) < 0,
then X is sorted before Y; if f(X,Y) > 0,
then X is sorted after Y; otherwise the
relative position of X and Y in L
is unchanged. |
Clone(L) | A shallow copy of the list L. |
CreateTable(n) | An empty table with n
columns. |
AddTableRow |
Adds a row to the table t whose entries consist of X1,
X2, ... (the entries can be any objects). |
Plot(T1,T2,...) | Plots the specified thermograph(s) on a single graph. |
KoPlot(G) | Plots the left and right
komaster thermographs of a game G. |
Explore(G) | Opens a new Explorer with G
in its view. |
Edit(G) | Equivalent to Explore(G). |
Mod(m,n) | m modulo n. |
WriteKernelState(S) | Writes the kernel
state to the file S. |
RestoreKernelState(S) | Restores the
kernel state from the file S. |
ResetKernel() | Resets the kernel. |
The following are CGSuite keywords and therefore may not be used as variable names:
| and break by clear continue defined do elif else end err false |
fi for from if in is literally local log not od option |
or out proc remember return seq tabulate then to true while |
Also, variable names may not begin with "v"; it's reserved for down, double-down, etc.