예제 #1
0
class myhive(commandhive):
    g = chessprocessor()
    com = commandsensor()

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

    p2 = filter(("str", "chess"))()
    connect(com, p2)
    turn_black = equal2("str")("Black")
    connect(g.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)
예제 #2
0
class myhive(commandhive):
    _hivecontext = hivemodule.appcontext(myapp)

    g = chessprocessor()
    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)
    connect(k.evexc, exc_v)

    b = chessboard()
    connect(turn, b.turn)
    connect(b.get_move, g)
    connect(g, b.make_move)
    connect(b.evexc, exc_v)

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

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

    raiser = bee.raiser()
    bee.connect("evexc", raiser)
예제 #3
0
class human(frame):
    player = parameter("str")

    p = filter(("str", "chess"))()
    turn_p = equal2("str")(get_parameter("player"))
    connect(turn_p, p.filter)

    com = antenna(p.inp)
    turn = antenna(turn_p.inp)
    move = output(p.true)
예제 #4
0
class myhive(commandhive):
    g = chessprocessor()
    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)