battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.

battle programmers allianceLog in

the LivinGrimoire Artificial General Intelligence software design pattern forum

descriptiona skill for arguing Emptya skill for arguing

more_horiz

Code:

package skills;

import AXJava.Responder;
import AXJava.TrgArgue;
import LivinGrimoire.DiSkillV2;

public class DiArguer extends DiSkillV2 {
    private TrgArgue argue = new TrgArgue();
    private Responder r1 = new Responder(); // replies against argument
    private Responder r2 = new Responder(); // replies for insistence
    private String finale = "number"; // replies after argueLim insistances
    private int argueLim = 13;

    public void setArgue(TrgArgue argue) {
        this.argue = argue;
    }

    public void setR1(Responder r1) {
        this.r1 = r1;
    }

    public void setR2(Responder r2) {
        this.r2 = r2;
    }

    public void setFinale(String finale) {
        this.finale = finale;
    }

    public void setArgueLim(int argueLim) {
        this.argueLim = argueLim;
    }

    @Override
    public void input(String ear, String skin, String eye) {
        if (argue.engageCommand(ear)== 0){return;}
        if (argue.engageCommand(ear) == 1){setSimpleAlg(r1.getAResponse());}
        else {
            if(argue.getCounter() > argueLim){setSimpleAlg(finale.replace("number",argue.getCounter()+ ""));return;}
            setSimpleAlg(r2.getAResponse());
        }
    }
}


what it does is argue against something.
IO:
enter input
may i stay up late
absolutely not
please
no way
please
sorry but no
please
no way
please
you are not allowed
please
you are not allowed
please
you are not allowed
please
write 15 lines that say proper sleep is important
please
write 17 lines that say proper sleep is important
please
write 19 lines that say proper sleep is important
please
write 21 lines that say proper sleep is important
please
write 23 lines that say proper sleep is important

descriptiona skill for arguing EmptyRe: a skill for arguing

more_horiz
as you can see this skill requires an additional skill for init:
b1.logicChobit.addSkill(new Di?().retObject());

this is to keep the values outside the main skill, and utilize several alternations of the skill

descriptiona skill for arguing EmptyRe: a skill for arguing

more_horiz
here is an example of how you set the finale line in the Di? init:

o1.setFinale("write number lines that say proper sleep is important");
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply