Ejemplo n.º 1
0
def CompareWeight(n1, n2):
    io.printTTS("Compare weight of objects")
    io.printTTS("Bob is {} pounds".format(n1))
    pitem.emojiPrint('sheep', 1)
    io.printTTS("Joy is {} pounds".format(n2))
    pitem.emojiPrint('pig2', 1)

    io.printTTS("Who is heavier, Joy or Bob?")
    ans = io.readLine()
    res = ca.checkEqual(ans, 'Joy')
    while not res:
        io.printTTS("Double check")
        ans = io.readLine()
        res = ca.checkEqual(ans, 'Joy')
    io.printTTS("So we know that {} pounds is heavier than {} pounds".format(
        n2, n1))

    io.printTTS("Who is lighter, Joy or Bob?")
    ans = io.readLine()
    res = ca.checkEqual(ans, 'Bob')
    while not res:
        io.printTTS("Double check")
        ans = io.readLine()
        res = ca.checkEqual(ans, 'Bob')

    io.printTTS("So we know that {} pounds is lighter than {} pounds".format(
        n1, n2))
Ejemplo n.º 2
0
def decomposeNumBaseTen(n):
    io.printTTS("Subtract 10")
    io.printTTS("{} - 10 = ".format(n))

    ans = io.readInt()
    res = ca.checkEqual(ans, n - 10)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        res = ca.checkEqual(ans, n - 10)

    io.printTTS("So we know that {} = {} - {}".format(n - 10, n, 10))
Ejemplo n.º 3
0
def composeNumBaseTen(n):
    io.printTTS("Add numbers based on 10")
    io.printTTS("10 + {} = ".format(n))

    ans = io.readInt()
    res = ca.checkEqual(ans, n + 10)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        res = ca.checkEqual(ans, n + 10)

    io.printTTS("So we know that {} = {} + {}".format(10 + n, 10, n))
Ejemplo n.º 4
0
def AddupNum(m, n, n1):
    io.printTTS("Add up numbers")
    io.printTTS("Joy has {} {}".format(n1, m))
    pitem.emojiPrint(m, n1)
    io.printTTS("How many more {}s Joy need to buy so she will have {} {}s?".format(m, n, m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n - n1)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n - n1)
    
    io.printTTS("So we know that {} = {} + {}".format(n, n1, n - n1))
Ejemplo n.º 5
0
def decomposeObjBaseTen(m, n):
    io.printTTS("Take 10 objects away")
    io.printTTS("Bob has {} {}s".format(n, m))
    pitem.emojiPrint(m, n)
    io.printTTS("Joy takes 10 {}s away".format(m))
    pitem.emojiPrint(m, 10)
    io.printTTS("How many {}s does Bob have now?".format(m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n - 10)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n - 10)

    io.printTTS("So we know that {} = {} - {}".format(n - 10, n, 10))
Ejemplo n.º 6
0
def composeObjBaseTen(m, n):
    io.printTTS("Add objects based on 10")
    io.printTTS("Bob has 10 {}s".format(m))
    pitem.emojiPrint(m, 10)
    io.printTTS("Joy gives Bob {} more {}s".format(n, m))
    pitem.emojiPrint(m, n)
    io.printTTS("How many {}s does Bob have now?".format(m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n + 10)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n + 10)

    io.printTTS("So we know that {} = {} + {}".format(10 + n, 10, n))
Ejemplo n.º 7
0
def DecomposeNum(m, n, n1):
    io.printTTS("Decompose numbers")
    io.printTTS("We have {} {}".format(n, m))
    pitem.emojiPrint(m, n)
    io.printTTS("We give Joy {} {}".format(n1, m))
    pitem.emojiPrint(m, n1)
    io.printTTS("How many {} are left?".format(m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n - n1)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n - n1)

    io.printTTS("So we know that {} - {} = {}".format(n, n1, n - n1))
Ejemplo n.º 8
0
def SubObjects(m, n1, n2):
    io.printTTS("Subtract objects")
    io.printTTS("Bob has {} {}".format(n1, m))
    pitem.emojiPrint(m, n1)
    io.printTTS("Joy takes away {} {} from Bob".format(n2, m))
    pitem.emojiPrint(m, n2)
    io.printTTS("How many {} does Bob have now?".format(m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n1 - n2)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n1 - n2)

    io.printTTS("So we know that {} - {} = {}".format(n1, n2, n1 - n2))
Ejemplo n.º 9
0
def AddObjects(m, n1, n2):
    io.printTTS("Add objects")
    io.printTTS("Bob has {} {}".format(n1, m))
    pitem.emojiPrint(m, n1)
    io.printTTS("Joy has {} {}".format(n2, m))
    pitem.emojiPrint(m, n2)
    io.printTTS("How many {} do they have in total?".format(m))

    ans = io.readInt()
    pitem.emojiPrint(m, ans)
    res = ca.checkEqual(ans, n1 + n2)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        pitem.emojiPrint(m, ans)
        res = ca.checkEqual(ans, n1 + n2)

    io.printTTS("So we know that {} + {} = {}".format(n1, n2, n1 + n2))
Ejemplo n.º 10
0
def IdentifyShape(s):
    io.printTTS("Identify shapes")

    if s in twoDShapes:
        fig = pitem.plot2D(s)
    if s in threeDShapes:
        fig = pitem.plot3D(s)
    plt.draw()
    plt.pause(0.5)
    plt.close()

    io.printTTS("What is the shape in the picture?")
    print("hints:")
    print(twoDShapes)
    print(threeDShapes)
    ans = io.readLine()
    res = ca.checkEqual(ans, s)
    while not res:
        io.printTTS("Double check")
        ans = io.readLine()
        res = ca.checkEqual(ans, s)
Ejemplo n.º 11
0
def ClassifyCount(m1, n1, m2, n2, m3, n3):
    l = [m1] * n1 + [m2] * n2 + [m3] * n3
    r = random.SystemRandom()
    r.shuffle(l)
    pitem.emojiPrintList(l)

    io.printTTS("How many {} do you see?".format(m1))
    ans = io.readInt()
    res = ca.checkEqual(ans, n1)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        res = ca.checkEqual(ans, n1)

    io.printTTS("How many {} do you see?".format(m2))
    ans = io.readInt()
    res = ca.checkEqual(ans, n2)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        res = ca.checkEqual(ans, n2)

    io.printTTS("How many {} do you see?".format(m3))
    ans = io.readInt()
    res = ca.checkEqual(ans, n3)
    while not res:
        io.printTTS("Double check")
        ans = io.readInt()
        res = ca.checkEqual(ans, n3)
Ejemplo n.º 12
0
def Name2Number(a):
    print('Write {} in number:'.format(a))
    ans = io.readInt()
    CA.checkEqual(ans, w2n.word_to_num(a))
Ejemplo n.º 13
0
def Number2Name(a):
    io.printTTS('Spell {} in Characters:'.format(a))
    line = io.readLine()
    p = inflect.engine()
    CA.checkEqual(line, p.number_to_words(a))