コード例 #1
0
def longMixedTerm(length, **aargs):
    return multimap(
        functionSource(trees.randomBinaryTree, length),
        [ mapI(trees.treeTerm(**aargs))
        , mapI(trees.cleverFold)
        , mapI(snd)
        , avoidDuplication ])
コード例 #2
0
def myrandrange(a, b):
    return functionSource(randrange, a, b)
コード例 #3
0
mediumOrderOfOperation = multimap(
    longMixedTerm(5),
    [ orderOfOperation
    , resultBetween(-200, 200)
    , renderSymbols])

hardOrderOfOperation = multimap(
    longMixedTerm(7, numbers=(randrange, [1, 24], {})),
    [ orderOfOperation
    , doubleBrackets
    , resultBetween(-700, 700)
    , renderSymbols])

longDivision = multimap(
    functionSource(divisionOhneRest),
    [ renderSymbols ])

hardLongDivision = multimap(
    functionSource(divisionOhneRest, divisor=[2,25], quotient=[1000, 7000]),
    [ renderSymbols ])

simpleMix = randomlyMix(
    [ additionUpTo(100)
    , substractionUpTo(30)
    , smallMultiplicationTable ])

mediumMix = randomlyMix(
    [ additionUpTo(1000)
    , substractionUpTo(200)
    , bigMultiplicationTable
コード例 #4
0
def myrandrange(a, b):
    return functionSource(randrange, a, b)
コード例 #5
0
def longMixedTerm(length, **aargs):
    return multimap(functionSource(trees.randomBinaryTree, length), [
        mapI(trees.treeTerm(**aargs)),
        mapI(trees.cleverFold),
        mapI(snd), avoidDuplication
    ])
コード例 #6
0
simpleOrderOfOperation = multimap(
    longMixedTerm(3), [orderOfOperation, nonNegative, renderSymbols])

mediumOrderOfOperation = multimap(
    longMixedTerm(5),
    [orderOfOperation,
     resultBetween(-200, 200), renderSymbols])

hardOrderOfOperation = multimap(
    longMixedTerm(7, numbers=(randrange, [1, 24], {})), [
        orderOfOperation, doubleBrackets,
        resultBetween(-700, 700), renderSymbols
    ])

longDivision = multimap(functionSource(divisionOhneRest), [renderSymbols])

hardLongDivision = multimap(
    functionSource(divisionOhneRest, divisor=[2, 25], quotient=[1000, 7000]),
    [renderSymbols])

simpleMix = randomlyMix(
    [additionUpTo(100),
     substractionUpTo(30), smallMultiplicationTable])

mediumMix = randomlyMix([
    additionUpTo(1000),
    substractionUpTo(200), bigMultiplicationTable, simpleOrderOfOperation
])

# -- define the outputs