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


battle programming a forum for elite programmers with extreme will power to sharpen theire skills
 
HomeSearchRegisterLog in
 

 DSpeller get times

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 464
Join date : 2011-08-02

DSpeller get times Empty
PostSubject: DSpeller get times   DSpeller get times EmptyThu Oct 24, 2019 2:20 am

spell as in spell caster
while I gave this class the ability to tell times you can similarly
add other capabilities for fast activation.

input trigger sentence, output trigger result alg
for example
what is the time : 6:45

DSpeller

Code:


import java.util.ArrayList;

public class DSpeller extends AbsCmdReq implements Neuronable {
    private String param;
    private Boolean active;

    @Override
    public void output(Neuron noiron) {
        if (this.active) {
            APSpell maho = new APSpell(this.param);
            ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
            algParts1.add(maho);
            Algorithm algorithm = new Algorithm("spell", this.param, algParts1);
            noiron.algParts.add(algorithm);
        }
    }

    @Override
    public void input(String command) {
        // TODO Auto-generated method stub
        switch (command) {
            case "what is the time":
            case "what is the date":
            case "what is the year":
            case "current seconds":
            case "current minutes":
            case "current hour":
            case "which day is it":
            case "greet":
                active = true;
                this.param = command;
                break;
            default:
                active = false;
                break;

        }
    }

}

this skill is very useful for programming course home work, and stuff

cop cop3 cop2 ¯_(ツ)_/¯

_________________
MB over and out emp it up
Back to top Go down
 
DSpeller get times
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: the LivinGrimoire-
Jump to: