Methods and Keywords

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.

Contents

General 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.

Canonical Games

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
(n1,n2,n3,...)
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 even.
IsInfinitesimal(G)true if G is infinitesimal.
IsNimber(G)true if G is a nimber.
IsNumber(G)true if G is a number.
IsNumberish(G)true if G is number-ish.
IsOdd(G)true if G is odd.
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.

Loopy Games

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.

Specific Games

Amazons
(S1,S2,S3,...)
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
(S1,S2,S3,...)
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
(S1,S2,S3,...)
The Domineering position with rows given by S1,S2,S3,... Each Sn should be a string consisting only of the following characters: . X
DomineeringRectangle
(m,n)
The empty m by n Domineering position.
Konane
(S1,S2,S3,...)
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
(x1,y1,x2,y2,
 x3,y3,x4,y4)
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 .

General Game Analysis

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.

Miscellaneous

Length(L)The length of the list L.
Contains(L,X)true if the object X is contained in the list 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 ff 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
(t,X1,X2,...)
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.

Keywords

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.


Return to Tutorial Contents