Example #1
0
class myhive(commandhive):
    _hivecontext = hivemodule.appcontext(myapp)

    g = chessprocessor2()
    exc_v = except_valueerror()
    connect(g.evexc, exc_v)

    com = commandsensor()

    turn = variable("str")("White")
    t_turn = transistor("str")()
    connect(g.turn, t_turn)
    connect(t_turn, turn)

    on_next = on_next()
    connect(on_next, t_turn)
    connect(g.made_move, on_next)

    p1 = filter(("str", "chess"))()
    connect(com, p1)
    turn_p1 = equal2("str")("Black")
    connect(turn, turn_p1)
    connect(turn_p1, p1.filter)

    p2 = chessUCI("White", "glaurung")
    connect(g.turn, p2.turn)
    connect(on_next, p2.trigger_get_move)

    start = startsensor()
    connect(start, p2.trigger_get_move)

    k = chesskeeper()
    connect(k, g)
    connect(p1.true, g)
    connect(p2, g)
    connect(g, k)
    connect(g, p2.make_move)

    b = chessboard2("Black")
    connect(turn, b.turn)
    connect(b.get_move, g)
    connect(g, b.make_move)

    d = display("str")()
    connect(g, d)

    ex = exitactuator()
    connect(g.finished, ex)

    raiser = bee.raiser()
    bee.connect("evexc", raiser)
Example #2
0
class myhive(commandhive):
    _hivecontext = hivemodule.appcontext(myapp)

    g = chessprocessor2()
    exc_v = except_valueerror()
    connect(g.evexc, exc_v)

    com = commandsensor()

    turn = variable("str")("White")
    t_turn = transistor("str")()
    connect(g.turn, t_turn)
    connect(t_turn, turn)

    on_next = on_next_tick()
    connect(on_next, t_turn)
    connect(g.made_move, on_next)

    on_next2 = on_next_tick()
    connect(g.made_move, on_next2)

    p1 = computer2b(("White", "glaurung"))
    connect(g.turn, p1.turn)
    connect(on_next, p1.trigger_move)

    p2 = computer2b(("Black", "glaurung"))
    connect(g.turn, p2.turn)
    connect(on_next2, p2.trigger_move)

    k = chesskeeper()
    connect(k, g)
    connect(p1.move, g)
    connect(p2.move, g)
    connect(g, k)
    connect(g, p1.make_move)
    connect(g, p2.make_move)

    b = chessboard2(None)
    connect(turn, b.turn)
    connect(b.get_move, g)
    connect(g, b.make_move)

    d = display("str")()
    connect(g, d)

    ex = exitactuator()
    connect(g.finished, ex)

    raiser = bee.raiser()
    bee.connect("evexc", raiser)
Example #3
0
class myhive(commandhive):
    g = chessprocessor2()
    exc_v = except_valueerror()
    connect(g.evexc, exc_v)

    com = commandsensor()

    turn = variable("str")("White")
    t_turn = transistor("str")()
    connect(g.turn, t_turn)
    connect(t_turn, turn)

    on_next = on_next()
    connect(on_next, t_turn)
    connect(g.made_move, on_next)

    p1 = filter(("str", "chess"))()
    connect(com, p1)
    turn_white = equal2("str")("White")
    connect(turn, turn_white)
    connect(turn_white, p1.filter)

    p2 = filter(("str", "chess"))()
    connect(com, p2)
    turn_black = equal2("str")("Black")
    connect(turn, turn_black)
    connect(turn_black, p2.filter)

    k = chesskeeper()
    connect(k, g)
    connect(p1.true, g)
    connect(p2.true, g)
    connect(g, k)

    d = display("str")()
    connect(g, d)

    ex = exitactuator()
    connect(g.finished, ex)

    raiser = bee.raiser()
    bee.connect("evexc", raiser)