java to swift 141223

fukurou

the supreme coder
ADMIN
Python:
class DiPunisher(DiSkillV2):
    def __init__(self):
        super().__init__()
        self.punishments: DrawRnd = DrawRnd()
        self._trigger: str = "i was a bad boy"
        self._reset: TrgTime = TrgTime()
        self.punishments.addElement("20 minutes of corner time")
        self.punishments.addElement("write 20 lines that say i was a bad boy")
        self.punishments.addElement("try to be good from now on sweety")
        self._reset.setTime("11:05")

    def setTrigger(self, trigger: str) -> DiPunisher:
        self._trigger = trigger
        return self

    # override
    def input(self, ear: str, skin: str, eye: str):
        if self._reset.alarm():
            self.punishments.reset()
            return
        if ear == self._trigger:
            self.setSimpleAlg(self.punishments.drawAndRemove())
 

owly

闇の伝説
Staff member
戦闘 コーダー
Swift:
class DiPunisher: DiSkillV2 {
    var punishments = DrawRnd()
    private var trigger = "i was a bad boy"
    private var reset = TrgTime()
    
    func setTrigger(_ trigger: String) {
        self.trigger = trigger
    }
    
    override init() {
        punishments.addElement("20 minutes of corner time")
        punishments.addElement("write 20 lines that say i was a bad boy")
        punishments.addElement("try to be good from now on sweety")
        reset.setTime(v1: "11:05")
    }
    
    override func input(ear: String, skin: String, eye: String) {
        if reset.trigger() {
            punishments.reset()
            return
        }
        if ear == trigger {
            setVerbatimAlg(priority: 4, sayThis: punishments.draw())
        }
    }
}
 

owly

闇の伝説
Staff member
戦闘 コーダー
Java:
public class DiBored extends DiSkillV2 {
    public AXTimeContextResponder responder = new AXTimeContextResponder();
    private String trigger = "i am bored";

    public DiBored setTrigger(String trigger) {
        this.trigger = trigger;
        return this;
    }

    public DiBored() {
        // morning
        responder.morning.addResponse("you should work out");
        responder.morning.addResponse("play with your toys");
        responder.morning.addResponse("sit on the floor and play with your baby toys");
        responder.morning.addResponse("eat baby food");
        responder.morning.addResponse("put on your training pants");
        // noon
        responder.afternoon.addResponse("plan a travel");
        responder.afternoon.addResponse("go to a park");
        responder.afternoon.addResponse("take a nap in your nappy");
        // evening
        responder.evening.addResponse("go number 3 in your nappy");
        responder.evening.addResponse("dry hump your diaper");
        responder.evening.addResponse("brush your teeth");
        responder.evening.addResponse("you could read a book");
        responder.evening.addResponse("study");
        responder.evening.addResponse("take a bath");
        responder.evening.addResponse("put on your diaper");
        responder.evening.addResponse("wear your jammies");
        // night
        responder.night.addResponse("recite a prayer");
        responder.night.addResponse("change your diaper");
        responder.night.addResponse("hump your diaper like a big boy");
    }

    @Override
    public void input(String ear, String skin, String eye) {
        if (ear.equals(trigger)){
            setVerbatimAlg(4, responder.respond());
        }
    }
}

this one is a double whammy swift and python
 

fukurou

the supreme coder
ADMIN
Java:
public class DiHabit extends DiSkillV2 {
    /*setter params*/
    // habit params
    private UniqueItemSizeLimitedPriorityQueue habitsPositive = new UniqueItemSizeLimitedPriorityQueue();
    private AXCmdBreaker habitP = new AXCmdBreaker("i should");
    private String temp = "";
    // bad habits
    private UniqueItemSizeLimitedPriorityQueue habitsNegative = new UniqueItemSizeLimitedPriorityQueue();
    private AXCmdBreaker habitN = new AXCmdBreaker("i must not");
    // dailies
    private UniqueItemSizeLimitedPriorityQueue dailies = new UniqueItemSizeLimitedPriorityQueue();
    private AXCmdBreaker dailyCmdBreaker = new AXCmdBreaker("i out to");
    // weekends
    private UniqueItemSizeLimitedPriorityQueue weekends = new UniqueItemSizeLimitedPriorityQueue();
    private AXCmdBreaker weekendCmdBreaker = new AXCmdBreaker("i have to");
    // expirations
    private UniqueItemSizeLimitedPriorityQueue expirations = new UniqueItemSizeLimitedPriorityQueue();
    private AXCmdBreaker expirationsCmdBreaker = new AXCmdBreaker("i got to");
    // to-do list
    private TODOListManager todo = new TODOListManager(5);
    private AXCmdBreaker toDoCmdBreaker = new AXCmdBreaker("i need to");
    private AXCmdBreaker clearCmdBreaker = new AXCmdBreaker("clear");
    //getter param
    private AXCmdBreaker getterCmdBreaker = new AXCmdBreaker("random");
    private AXStrOrDefault strOrDefault = new AXStrOrDefault();
    // gamification modules for shallow ref in other skills
    private AXGamification gamification = new AXGamification();
    private AXGamification punishments = new AXGamification();

    public DiHabit() {
        habitsPositive.setLimit(15);
        habitsNegative.setLimit(5);
        dailies.setLimit(3);
        weekends.setLimit(3);
        expirations.setLimit(3);
    }

    public AXGamification getGamification() {
        return gamification;
    }

    public AXGamification getPunishments() {
        return punishments;
    }

    @Override
    public void input(String ear, String skin, String eye) {
        if (ear.isEmpty()){return;}
        // setters
        if (ear.contains("i")){
            temp = habitP.extractCmdParam(ear);
            if (!temp.isEmpty()){
                habitsPositive.add(temp);
                temp = "";
                setVerbatimAlg(4,"habit registered");
                return;
            }
            temp = habitN.extractCmdParam(ear);
            if (!temp.isEmpty()){
                habitsNegative.add(temp);
                temp = "";
                setVerbatimAlg(4,"bad habit registered");
                return;
            }
            temp = dailyCmdBreaker.extractCmdParam(ear);
            if (!temp.isEmpty()){
                dailies.add(temp);
                temp = "";
                setVerbatimAlg(4,"daily registered");
                return;
            }
            temp = weekendCmdBreaker.extractCmdParam(ear);
            if (!temp.isEmpty()){
                weekends.add(temp);
                temp = "";
                setVerbatimAlg(4,"prep registered");
                return;
            }
            temp = expirationsCmdBreaker.extractCmdParam(ear);
            if (!temp.isEmpty()){
                expirations.add(temp);
                temp = "";
                setVerbatimAlg(4,"expiration registered");
                return;
            }
            temp = toDoCmdBreaker.extractCmdParam(ear);
            if (!temp.isEmpty()){
                todo.addTask(temp);
                temp = "";
                setVerbatimAlg(4,"task registered");
                return;
            }
        }
        // getters
        temp = getterCmdBreaker.extractCmdParam(ear);
        if (!temp.isEmpty()){
            switch (temp){
                case "habit":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(habitsPositive.getRNDElement(),"no habits registered"));
                    return;
                case "bad habit":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(habitsNegative.getRNDElement(),"no bad habits registered"));
                    return;
                case "daily":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(dailies.getRNDElement(),"no dailies registered"));
                    return;
                case "weekend": case "prep":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(weekends.getRNDElement(),"no preps registered"));
                    return;
                case "expirations":case "expiration":
                    if(expirations.getAsList().isEmpty()){
                        setVerbatimAlg(4,"no expirations registered");
                        return;
                    }
                    setVerbatimAlgFromList(4,expirations.getAsList());
                    return;
                case "task":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(todo.getTask(),"no new tasks registered"));
                    return;
                case "to do":
                    setVerbatimAlg(4,strOrDefault.getOrDefault(todo.getOldTask(),"no tasks registered"));
                    return;
            }
        }
        // engagers
        if(ear.contains("completed")){
            if (!(diSkillUtils.strContainsList(ear,habitsPositive.getAsList()).isEmpty())){
                gamification.increment();
                setVerbatimAlg(4,"good boy");
                return;
            }
            if (!(diSkillUtils.strContainsList(ear,habitsNegative.getAsList()).isEmpty())){
                punishments.increment();
                setVerbatimAlg(4,"bad boy");
                return;
            }
            if (!(diSkillUtils.strContainsList(ear,dailies.getAsList()).isEmpty())){
                gamification.increment();
                setVerbatimAlg(4,"daily engaged");
                return;
            }
            if (!(diSkillUtils.strContainsList(ear,weekends.getAsList()).isEmpty())){
                setVerbatimAlg(4,"prep engaged");
                return;
            }
            // expiration gamification redacted
        }
        // clear specific field
        switch(ear) {
            case "clear habits":
                habitsPositive.clear();
                setVerbatimAlg(4,"habits cleared");
                break;
            case "clear bad habits":
                habitsNegative.clear();
                setVerbatimAlg(4,"bad habits cleared");
                break;
            case "clear dailies":
                dailies.clear();
                setVerbatimAlg(4,"dailies cleared");
                break;
            case "clear preps": case "clear weekends":
                weekends.clear();
                setVerbatimAlg(4,"preps cleared");
                break;
            case "clear expirations":
                expirations.clear();
                setVerbatimAlg(4,"expirations cleared");
                break;
            case "clear tasks":case "clear task":case "clear to do":
                todo.clearAllTasks();
                setVerbatimAlg(4,"tasks cleared");
                break;
            case "clear all habits":
                habitsPositive.clear();
                habitsNegative.clear();
                dailies.clear();
                weekends.clear();
                expirations.clear();
                todo.clearAllTasks();
                setVerbatimAlg(4,"all habits cleared");
                break;
            default:
                if (ear.contains("clear")){
                    temp = clearCmdBreaker.extractCmdParam(ear);
                    if(todo.containsTask(temp)){
                        todo.clearTask(temp);
                        setVerbatimAlg(4,temp +" task cleared");
                        temp = "";
                    }
                }
        }
    }
}
 

fukurou

the supreme coder
ADMIN
Python:
class DiBored(DiSkillV2):
    def __init__(self):
        self.responder = AXTimeContextResponder()
        self.trigger = "i am bored"

        self.responder.morning.addResponse("you should work out")
        self.responder.morning.addResponse("play with your toys")
        self.responder.morning.addResponse("sit on the floor and play with your baby toys")
        self.responder.morning.addResponse("eat baby food")
        self.responder.morning.addResponse("put on your training pants")

        self.responder.afternoon.addResponse("plan a travel")
        self.responder.afternoon.addResponse("go to a park")
        self.responder.afternoon.addResponse("take a nap in your nappy")

        self.responder.evening.addResponse("go number 3 in your nappy")
        self.responder.evening.addResponse("dry hump your diaper")
        self.responder.evening.addResponse("brush your teeth")
        self.responder.evening.addResponse("you could read a book")
        self.responder.evening.addResponse("study")
        self.responder.evening.addResponse("take a bath")
        self.responder.evening.addResponse("put on your diaper")
        self.responder.evening.addResponse("wear your jammies")

        self.responder.night.addResponse("recite a prayer")
        self.responder.night.addResponse("change your diaper")
        self.responder.night.addResponse("hump your diaper like a big boy")

    def setTrigger(self, trigger):
        self.trigger = trigger
        return self

    def input(self, ear, skin, eye):
        if ear == self.trigger:
            self.setVerbatimAlg(4, self.responder.respond())
 

fukurou

the supreme coder
ADMIN
Python:
class DiBored(DiSkillV2):
    def __init__(self):
        super().__init__()
        self.responder = AXTimeContextResponder()
        self.trigger = "i am bored"
        # morning replies
        self.responder.morning.addResponse("you should work out")
        self.responder.morning.addResponse("play with your toys")
        self.responder.morning.addResponse("sit on the floor and play with your baby toys")
        self.responder.morning.addResponse("eat baby food")
        self.responder.morning.addResponse("put on your training pants")
        # afternoon replies
        self.responder.afternoon.addResponse("plan a travel")
        self.responder.afternoon.addResponse("go to a park")
        self.responder.afternoon.addResponse("take a nap in your nappy")
        # evening replies
        self.responder.evening.addResponse("go number 3 in your nappy")
        self.responder.evening.addResponse("dry hump your diaper")
        self.responder.evening.addResponse("brush your teeth")
        self.responder.evening.addResponse("you could read a book")
        self.responder.evening.addResponse("study")
        self.responder.evening.addResponse("take a bath")
        self.responder.evening.addResponse("put on your diaper")
        self.responder.evening.addResponse("wear your jammies")
        # night replies
        self.responder.night.addResponse("recite a prayer")
        self.responder.night.addResponse("change your diaper")
        self.responder.night.addResponse("hump your diaper like a big boy")

    def setTrigger(self, trigger):
        self.trigger = trigger
        return self

    def input(self, ear, skin, eye):
        if ear == self.trigger:
            self.setVerbatimAlg(4, self.responder.respond())
 

ZORO

Member
🦈 VIP 🦈
Swift:
class DiBored: DiSkillV2 {
    var responder = AXTimeContextResponder()
    private var trigger = "i am bored"
    
    func setTrigger(_ trigger: String) -> DiBored {
        self.trigger = trigger
        return self
    }
    
    init() {
        responder.morning.addResponse("you should work out")
        responder.morning.addResponse("play with your toys")
        responder.morning.addResponse("sit on the floor and play with your baby toys")
        responder.morning.addResponse("eat baby food")
        responder.morning.addResponse("put on your training pants")
        
        responder.afternoon.addResponse("plan a travel")
        responder.afternoon.addResponse("go to a park")
        responder.afternoon.addResponse("take a nap in your nappy")
        
        responder.evening.addResponse("go number 3 in your nappy")
        responder.evening.addResponse("dry hump your diaper")
        responder.evening.addResponse("brush your teeth")
        responder.evening.addResponse("you could read a book")
        responder.evening.addResponse("study")
        responder.evening.addResponse("take a bath")
        responder.evening.addResponse("put on your diaper")
        responder.evening.addResponse("wear your jammies")
        
        responder.night.addResponse("recite a prayer")
        responder.night.addResponse("change your diaper")
        responder.night.addResponse("hump your diaper like a big boy")
    }
    
    override func input(_ ear: String, _ skin: String, _ eye: String) {
        if ear == trigger {
            setVerbatimAlg(4, responder.respond())
        }
    }
}
 

ZORO

Member
🦈 VIP 🦈
Swift:
import Foundation

class DiHabit: DiSkillV2 {
    private var habitsPositive = UniqueItemSizeLimitedPriorityQueue<String>()
    private var habitP = AXCmdBreaker("i should")
    private var temp = ""
    
    private var habitsNegative = UniqueItemSizeLimitedPriorityQueue<String>()
    private var habitN = AXCmdBreaker("i must not")
    
    private var dailies = UniqueItemSizeLimitedPriorityQueue<String>()
    private var dailyCmdBreaker = AXCmdBreaker("i out to")
    
    private var weekends = UniqueItemSizeLimitedPriorityQueue<String>()
    private var weekendCmdBreaker = AXCmdBreaker("i have to")
    
    private var expirations = UniqueItemSizeLimitedPriorityQueue<String>()
    private var expirationsCmdBreaker = AXCmdBreaker("i got to")
    
    private var todo = TODOListManager(5)
    private var toDoCmdBreaker = AXCmdBreaker("i need to")
    private var clearCmdBreaker = AXCmdBreaker("clear")
    
    private var getterCmdBreaker = AXCmdBreaker("random")
    private var strOrDefault = AXStrOrDefault()
    
    private var gamification = AXGamification()
    private var punishments = AXGamification()
    
    override init() {
        habitsPositive.setLimit(15)
        habitsNegative.setLimit(5)
        dailies.setLimit(3)
        weekends.setLimit(3)
        expirations.setLimit(3)
    }
    
    func getGamification() -> AXGamification {
        return gamification
    }
    
    func getPunishments() -> AXGamification {
        return punishments
    }
    
    override func input(_ ear: String, _ skin: String, _ eye: String) {
        if ear.isEmpty() { return }
        
        if ear.contains("i") {
            temp = habitP.extractCmdParam(ear)
            if !temp.isEmpty() {
                habitsPositive.add(temp)
                temp = ""
                setVerbatimAlg(4, "habit registered")
                return
            }
            temp = habitN.extractCmdParam(ear)
            if !temp.isEmpty() {
                habitsNegative.add(temp)
                temp = ""
                setVerbatimAlg(4, "bad habit registered")
                return
            }
            temp = dailyCmdBreaker.extractCmdParam(ear)
            if !temp.isEmpty() {
                dailies.add(temp)
                temp = ""
                setVerbatimAlg(4, "daily registered")
                return
            }
            temp = weekendCmdBreaker.extractCmdParam(ear)
            if !temp.isEmpty() {
                weekends.add(temp)
                temp = ""
                setVerbatimAlg(4, "prep registered")
                return
            }
            temp = expirationsCmdBreaker.extractCmdParam(ear)
            if !temp.isEmpty() {
                expirations.add(temp)
                temp = ""
                setVerbatimAlg(4, "expiration registered")
                return
            }
            temp = toDoCmdBreaker.extractCmdParam(ear)
            if !temp.isEmpty() {
                todo.addTask(temp)
                temp = ""
                setVerbatimAlg(4, "task registered")
                return
            }
        }
        
        temp = getterCmdBreaker.extractCmdParam(ear)
        if !temp.isEmpty() {
            switch temp {
            case "habit":
                setVerbatimAlg(4, strOrDefault.getOrDefault(habitsPositive.getRNDElement(), "no habits registered"))
                return
            case "bad habit":
                setVerbatimAlg(4, strOrDefault.getOrDefault(habitsNegative.getRNDElement(), "no bad habits registered"))
                return
            case "daily":
                setVerbatimAlg(4, strOrDefault.getOrDefault(dailies.getRNDElement(), "no dailies registered"))
                return
            case "weekend", "prep":
                setVerbatimAlg(4, strOrDefault.getOrDefault(weekends.getRNDElement(), "no preps registered"))
                return
            case "expirations", "expiration":
                if expirations.getAsList().isEmpty {
                    setVerbatimAlg(4, "no expirations registered")
                    return
                }
                setVerbatimAlgFromList(4, expirations.getAsList())
                return
            case "task":
                setVerbatimAlg(4, strOrDefault.getOrDefault(todo.getTask(), "no new tasks registered"))
                return
            case "to do":
                setVerbatimAlg(4, strOrDefault.getOrDefault(todo.getOldTask(), "no tasks registered"))
                return
            default:
                break
            }
        }
        
        if ear.contains("completed") {
            if !diSkillUtils.strContainsList(ear, habitsPositive.getAsList()).isEmpty {
                gamification.increment()
                setVerbatimAlg(4, "good boy")
                return
            }
            if !diSkillUtils.strContainsList(ear, habitsNegative.getAsList()).isEmpty {
                punishments.increment()
                setVerbatimAlg(4, "bad boy")
                return
            }
            if !diSkillUtils.strContainsList(ear, dailies.getAsList()).isEmpty {
                gamification.increment()
                setVerbatimAlg(4, "daily engaged")
                return
            }
            if !diSkillUtils.strContainsList(ear, weekends.getAsList()).isEmpty {
                setVerbatimAlg(4, "prep engaged")
                return
            }
        }
        
        switch ear {
        case "clear habits":
            habitsPositive.clear()
            setVerbatimAlg(4, "habits cleared")
        case "clear bad habits":
            habitsNegative.clear()
            setVerbatimAlg(4, "bad habits cleared")
        case "clear dailies":
            dailies.clear()
            setVerbatimAlg(4, "dailies cleared")
        case "clear preps", "clear weekends":
            weekends.clear()
            setVerbatimAlg(4, "preps cleared")
        case "clear expirations":
            expirations.clear()
            setVerbatimAlg(4, "expirations cleared")
        case "clear tasks", "clear task", "clear to do":
            todo.clearAllTasks()
            setVerbatimAlg(4, "tasks cleared")
        case "clear all habits":
            habitsPositive.clear()
            habitsNegative.clear()
            dailies.clear()
            weekends.clear()
            expirations.clear()
            todo.clearAllTasks()
            setVerbatimAlg(4, "all habits cleared")
        default:
            if ear.contains("clear") {
                temp = clearCmdBreaker.extractCmdParam(ear)
                if todo.containsTask(temp) {
                    todo.clearTask(temp)
                    setVerbatimAlg(4, temp + " task cleared")
                    temp = ""
                }
            }
        }
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class DiBored: DiSkillV2 {
    var responder = AXTimeContextResponder()
    private var trigger = "i am bored"
    
    func setTrigger(_ trigger: String) -> DiBored {
        self.trigger = trigger
        return self
    }
    
    override init() {
        responder.morning.addResponse(s1: "you should work out")
        responder.morning.addResponse(s1: "play with your toys")
        responder.morning.addResponse(s1: "sit on the floor and play with your baby toys")
        responder.morning.addResponse(s1: "eat baby food")
        responder.morning.addResponse(s1: "put on your training pants")
        
        responder.afternoon.addResponse(s1: "plan a travel")
        responder.afternoon.addResponse(s1: "go to a park")
        responder.afternoon.addResponse(s1: "take a nap in your nappy")
        
        responder.evening.addResponse(s1: "go number 3 in your nappy")
        responder.evening.addResponse(s1: "dry hump your diaper")
        responder.evening.addResponse(s1: "brush your teeth")
        responder.evening.addResponse(s1: "you could read a book")
        responder.evening.addResponse(s1: "study")
        responder.evening.addResponse(s1: "take a bath")
        responder.evening.addResponse(s1: "put on your diaper")
        responder.evening.addResponse(s1: "wear your jammies")
        
        responder.night.addResponse(s1: "recite a prayer")
        responder.night.addResponse(s1: "change your diaper")
        responder.night.addResponse(s1: "hump your diaper like a big boy")
    }
    
    override func input(ear: String, skin: String, eye: String) {
        if ear == trigger {
            setSimpleAlg(sayThis: responder.respond())
        }
    }
}
 

mr.meeseeks

New member
🦈 VIP 🦈
Swift:
class DiHabit: DiSkillV2 {
    private var habitsPositive = UniqueItemSizeLimitedPriorityQueue()
    private var habitP = AXCmdBreaker(conjuration: "i should")
    private var temp = ""
    
    private var habitsNegative = UniqueItemSizeLimitedPriorityQueue()
    private var habitN = AXCmdBreaker(conjuration: "i must not")
    
    private var dailies = UniqueItemSizeLimitedPriorityQueue()
    private var dailyCmdBreaker = AXCmdBreaker(conjuration: "i out to")
    
    private var weekends = UniqueItemSizeLimitedPriorityQueue()
    private var weekendCmdBreaker = AXCmdBreaker(conjuration: "i have to")
    
    private var expirations = UniqueItemSizeLimitedPriorityQueue()
    private var expirationsCmdBreaker = AXCmdBreaker(conjuration: "i got to")
    
    private var todo = TODOListManager(todoLim: 5)
    private var toDoCmdBreaker = AXCmdBreaker(conjuration: "i need to")
    private var clearCmdBreaker = AXCmdBreaker(conjuration: "clear")
    
    private var getterCmdBreaker = AXCmdBreaker(conjuration: "random")
    private var strOrDefault = AXStrOrDefault()
    
    private var gamification = AXGamification()
    private var punishments = AXGamification()
    
    override init() {
        habitsPositive.setLimit(lim: 15)
        habitsNegative.setLimit(lim: 5)
        dailies.setLimit(lim: 3)
        weekends.setLimit(lim: 3)
        expirations.setLimit(lim: 3)
    }
    
    func getGamification() -> AXGamification {
        return gamification
    }
    
    func getPunishments() -> AXGamification {
        return punishments
    }
    
    override func input(ear: String, skin: String, eye: String) {
        if ear.isEmpty { return }
        
        if ear.contains("i") {
            temp = habitP.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                habitsPositive.input(in1: temp)
                temp = ""
                setSimpleAlg(sayThis: "habit registered")
                return
            }
            temp = habitN.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                habitsNegative.input(in1: temp)
                temp = ""
                setSimpleAlg(sayThis: "bad habit registered")
                return
            }
            temp = dailyCmdBreaker.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                dailies.input(in1: temp)
                temp = ""
                setSimpleAlg(sayThis: "daily registered")
                return
            }
            temp = weekendCmdBreaker.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                weekends.input(in1: temp)
                temp = ""
                setSimpleAlg(sayThis: "prep registered")
                return
            }
            temp = expirationsCmdBreaker.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                expirations.input(in1: temp)
                temp = ""
                setSimpleAlg(sayThis: "expiration registered")
                return
            }
            temp = toDoCmdBreaker.extractCmdParam(s1: ear)
            if !temp.isEmpty {
                todo.addTask(e1: temp)
                temp = ""
                setSimpleAlg(sayThis: "task registered")
                return
            }
        }
        
        temp = getterCmdBreaker.extractCmdParam(s1: ear)
        if !temp.isEmpty {
            switch temp {
            case "habit":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: habitsPositive.getRndItem(), default1: "no habits registered"))
                return
            case "bad habit":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: habitsNegative.getRndItem(), default1: "no bad habits registered"))
                return
            case "daily":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: dailies.getRndItem(), default1: "no dailies registered"))
                return
            case "weekend", "prep":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: weekends.getRndItem(), default1: "no preps registered"))
                return
            case "expirations", "expiration":
                if expirations.getAsList().isEmpty {
                    setSimpleAlg(sayThis: "no expirations registered")
                    return
                }
                setVerbatimAlgFromList(priority: 4, sayThis: expirations.getAsList())
                return
            case "task":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: todo.getTask(), default1: "no new tasks registered"))
                return
            case "to do":
                setSimpleAlg(sayThis: AXStrOrDefault().getOrDefault(str1: todo.getOldTask(), default1: "no tasks registered"))
                return
            default:
                break
            }
        }
        
        if ear.contains("completed") {
            if !diSkillUtills.stringContainsListElement(str1: ear, items: habitsPositive.getAsList()).isEmpty {
                gamification.increment()
                setSimpleAlg(sayThis: "good boy")
                return
            }
            if !diSkillUtills.stringContainsListElement(str1: ear, items: habitsNegative.getAsList()).isEmpty {
                punishments.increment()
                setSimpleAlg(sayThis: "bad boy")
                return
            }
            if !diSkillUtills.stringContainsListElement(str1:ear, items: dailies.getAsList()).isEmpty {
                gamification.increment()
                setSimpleAlg(sayThis: "daily engaged")
                return
            }
            if !diSkillUtills.stringContainsListElement(str1:ear, items:weekends.getAsList()).isEmpty {
                setSimpleAlg(sayThis: "prep engaged")
                return
            }
        }
        
        switch ear {
        case "clear habits":
            habitsPositive.clearData()
            setSimpleAlg(sayThis: "habits cleared")
        case "clear bad habits":
            habitsNegative.clearData()
            setSimpleAlg(sayThis: "bad habits cleared")
        case "clear dailies":
            dailies.clearData()
            setSimpleAlg(sayThis: "dailies cleared")
        case "clear preps", "clear weekends":
            weekends.clearData()
            setSimpleAlg(sayThis: "preps cleared")
        case "clear expirations":
            expirations.clearData()
            setSimpleAlg(sayThis: "expirations cleared")
        case "clear tasks", "clear task", "clear to do":
            todo.clearAllTasks()
            setSimpleAlg(sayThis: "tasks cleared")
        case "clear all habits":
            habitsPositive.clearData()
            habitsNegative.clearData()
            dailies.clearData()
            weekends.clearData()
            expirations.clearData()
            todo.clearAllTasks()
            setSimpleAlg(sayThis: "all habits cleared")
        default:
            if ear.contains("clear") {
                temp = clearCmdBreaker.extractCmdParam(s1: ear)
                if todo.containsTask(task: temp) {
                    todo.clearTask(temp)
                    setSimpleAlg(sayThis: temp + " task cleared")
                    temp = ""
                }
            }
        }
    }
}
 
Top