def lambdas_to_plan(game, d):
    result = Network(game)
    for slot, term in d.items():
        term = parse_lambda(term)
        term = binarize_term(term)
        term = unfold_numbers(term)
        result.add_goal(Goal(term, slot))
    return result
 def mk_seq(self):
     value = number_term(self.value)
     sequence = []
     for t in [
         r'((put I) value)',
         ]:
         t = parse_lambda(t, locals())
         t = binarize_term(t)
         sequence += term_to_sequence(t)
     seq = SequenceBotNone(sequence, self.slot)
     seq.set_game(self.game)
     return seq
 def mk_seq(self):
     batslot = number_term(self.battery_slot)
     boost = number_term(self.boost)
     sequence = []
     for t in [
         r'(S help I batslot boost)',
         ]:
         t = parse_lambda(t, locals())
         t = binarize_term(t)
         sequence += term_to_sequence(t)
     seq = SequenceBotNone(sequence, self.execution_slot)
     seq.set_game(self.game)
     return seq
def test_combo_bot(slot = 0):
    tgtslot = number_term(0)
    selfslot = number_term(slot)
    #m = number_term(INITIAL_VITALITY)
    sequence = []
    for t in [
        #r'((\c f x. (\i. (\g. i c f x) (i f x))) (\c f x. (\i. (\g. i c f x) (i f x))) (dec) (zero))',
        r'(((\atkslot icomb. K (icomb get selfslot) (icomb dec atkslot)) tgtslot) I)',
        ]:
        t = parse_lambda(t, locals())
        t = binarize_term(t)
        sequence += term_to_sequence(t)
    return SequenceBot(sequence, slot)
 def mk_seq(self):
     batslot = number_term(self.battery_slot)
     boost = number_term(40960)
     sequence = []
     for t in [
         r'(\icomb. (K (icomb get batslot)) (icomb S help I batslot boost))',
         ]:
         t = parse_lambda(t, locals())
         t = binarize_term(t)
         sequence += term_to_sequence(t)
     seq = SequenceBotNone(sequence, self.battery_slot)
     seq.set_game(self.game)
     return seq
 def mk_seq(self):
     batslot = number_term(self.battery_slot)
     atkslot = number_term(MAX_SLOT - self.target_slot)
     dmg = number_term(self.dmg)
     sequence = []
     for t in [
         r'(attack batslot atkslot dmg)',
         ]:
         t = parse_lambda(t, locals())
         t = binarize_term(t)
         sequence += term_to_sequence(t)
     seq = SequenceBotNone(sequence, self.execution_slot)
     seq.set_game(self.game)
     return seq
Exemple #7
0
 def mk_seq(self):
     batslot = number_term(self.battery_slot)
     pppslot = number_term(self.pain_slot)
     obsslot = number_term(self.observer_slot)
     ggeslot = number_term(self.gauge_slot)
     sequence = []
     for t in [
         r"(\icomb. (K (icomb get batslot)) ((K (((S help I) batslot) (icomb get pppslot))) (attack batslot (icomb get obsslot) (icomb get ggeslot))))"
     ]:
         t = parse_lambda(t, locals())
         t = binarize_term(t)
         sequence += term_to_sequence(t)
     seq = SequenceBotNone(sequence, self.battery_slot)
     seq.set_game(self.game)
     return seq
def test_seq_bot(slot = 0):
    n = number_term(8192)
    m = number_term(INITIAL_VITALITY)

    #Y = r'(\f. (\q. q q) (\x. f (x x)))'
    #Y = parse_lambda(Y)

    sequence = []
    
    for t in [
        r'(attack zero zero n)',
        r'(attack (succ zero) zero n)',
        r'(zombie zero (\id. (help ((id succ) zero) zero m))'
        ]:
        t = parse_lambda(t, locals())
        t = binarize_term(t)
        sequence += term_to_sequence(t)

    return SequenceBot(sequence, slot)