Exemple #1
0
class computer2a(computer):
    delay = variable(("float", "quantity"))(1.0)
    delayed_move = sleep("trigger")()
    connect(delay, delayed_move)
    connect(delayed_move, ("p", "trigger_get_move"))

    trigger_move = antenna(delayed_move.inp)
Exemple #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()
    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)
Exemple #3
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)
Exemple #4
0
class myhive(commandhive):
    _hivecontext = hivemodule.appcontext(myapp)

    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)

    b = chessboard()
    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)
Exemple #5
0
class computer2b(frame):
    params = parameter("ParamComputer_698767")

    par = get_parameter("params")
    p = chessUCI(par.player, par.engine_binary, par.engine_dir)
    del par
    start = startsensor()
    connect(start, p.trigger_get_move)

    delay = variable(("float", "quantity"))(1.0)
    delayed_move = sleep("trigger")()
    connect(delay, delayed_move)
    connect(delayed_move, p.trigger_get_move)

    turn = antenna(p.turn)
    trigger_move = antenna(delayed_move.inp)
    make_move = antenna(p.make_move)
    move = output(p.get_move)
Exemple #6
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)
Exemple #7
0
class computer2(frame):
    par1_player = parameter("str")
    par2_engine_binary = parameter("str")
    par3_engine_dir = parameter("str", None)

    p = chessUCI(get_parameter("par1_player"),
                 get_parameter("par2_engine_binary"),
                 get_parameter("par3_engine_dir"))
    start = startsensor()
    connect(start, p.trigger_get_move)

    delay = variable(("float", "quantity"))(1.0)
    delayed_move = sleep("trigger")()
    connect(delay, delayed_move)
    connect(delayed_move, p.trigger_get_move)

    turn = antenna(p.turn)
    trigger_move = antenna(delayed_move.inp)
    make_move = antenna(p.make_move)
    move = output(p.get_move)