-
Notifications
You must be signed in to change notification settings - Fork 6
SageMath generators
Here are two recommended resources:
- Tutorial: https://doc.sagemath.org/html/en/tutorial/index.html
- Reference Manual: https://doc.sagemath.org/html/en/reference/index.html
One note: the "working directory" for running your generators is the location of bank.xml
. So, for example,
if you have a bank at /my/great/bank/bank.xml
, you are editing a generator at /my/great/bank/outcomes/foo/generator.sage
,
and you want to load some common custom code at /my/great/bank/library/common.sage
, you should use the line
load("library/common.sage")
in your generator.
When authoring SageMath generators, CheckIt supplies a CheckIt
module with several helpful tools.
Given one or more latex_names
of strings, returns a tuple
of Sage variables. random_order
names them so that they appear
in expressions in a random order.
Usage: a,b,c = CheckIt.vars('a','\\beta','C')
# a,\beta,C will be displayed in a random order when combined into an expression.
Represents the equation sum(terms)==0
, but with terms shuffled randomly
to each side.
Usage: CheckIt.shuffled_equation(x^2,y^2)
might return x^2+y^2=0
, x^2=-y^2
, etc.