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 their skills
 
HomeGallerySearchRegisterLog in
 

 DiSoulV3 even better pet waifu convo skills

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 568
Join date : 2011-08-02

DiSoulV3 even better pet waifu convo skills Empty
PostSubject: DiSoulV3 even better pet waifu convo skills   DiSoulV3 even better pet waifu convo skills EmptySat Feb 13, 2021 8:15 am

all java classes

ComplimentRecog

Code:
package chobit;

import java.util.ArrayList;

public class ComplimentRecog {
   private ArrayList<String> containsMe1 = new ArrayList<String>();
   private ArrayList<String> containsMe2 = new ArrayList<String>();

   public ComplimentRecog() {
      containsMe1.add("stop thinking about you");
      containsMe1.add("you are truly");
      containsMe1.add("you are really good at");
      containsMe1.add("i appreciate your");
      containsMe1.add("you would make a really great");
      containsMe1.add("you are an awesome");
      containsMe1.add("you are a smart");
      containsMe1.add("you deserve a");
      containsMe1.add("you have cute");
      containsMe1.add("you have a cute");
      containsMe1.add("you have a remarkable");
      containsMe1.add("you are good");
      containsMe1.add("the world would be so boring without you");
      containsMe1.add("you are beautiful");
      containsMe1.add("you are so strong");
      containsMe1.add("you make me feel whole");
      containsMe1.add("you are so special to me");
      containsMe1.add("you are the light of my life");
      containsMe1.add("you have great");

      containsMe2.add("are my world");
      containsMe2.add("are my entire world");
      containsMe2.add("wow");
      containsMe2.add("hug");
      containsMe2.add("special");
      containsMe2.add("are perfect");

   }

   public String isCompliment(String str1) {
      if(strContains(str1, containsMe1)||(str1.contains("you")&&strContains(str1, containsMe2))) {
         int x = getRandomInt(3);
               switch (x) {
               case 0:
                  return "i am high performance";
               case 1:
                  return "because i am high performance";
               case 2:
            return "i love when you simp for me";
               }
      }
      return "";
   }

   private Boolean strContains(String str1, ArrayList<String> containsMe) {
      for (String temp : containsMe) {
         if (str1.contains(temp)) {
            return true;
         }
      }
      return false;
   }

   public int getRandomInt(int max) {
      // 3 : 0,1,2
      return (int) Math.floor(Math.random() * Math.floor(max));
   }
}

CldBool

Code:
package chobit;

public class CldBool {
   private Boolean modeActive = false;

   public Boolean getModeActive() {
      return modeActive;
   }

   public void setModeActive(Boolean modeActive) {
      this.modeActive = modeActive;
   }

}

EmoRecog

Code:
package chobit;

import java.util.HashSet;

public class EmoRecog {
   private HashSet<String> curious = new HashSet<String>();
   private HashSet<String> excited = new HashSet<String>();
   private HashSet<String> angry = new HashSet<String>();
   private HashSet<String> happy = new HashSet<String>();

   public EmoRecog() {
      excited.add("to");
      curious.add("why");
      curious.add("where");
      curious.add("when");
      curious.add("how");
      curious.add("who");
      curious.add("which");
      curious.add("whose");
      happy.add("good");
      happy.add("awesome");
      happy.add("great");
      happy.add("wonderful");
      happy.add("sweet");
      happy.add("happy");
      angry.add("hell");
      angry.add("crap");
      angry.add("fudge");
      angry.add("angry");
      angry.add("waste");
      angry.add("stupid");
      angry.add("retard");
   }

   public Boolean isCurious(String ear) {
      if (strContains(ear, curious)) {
         return true;
      }
      return false;
   }

   public Boolean isExcited(String ear) {
      if (strContains(ear, excited)) {
         return true;
      }
      return false;
   }

   public Boolean isAngry(String ear) {
      if (strContains(ear, angry)) {
         return true;
      }
      return false;
   }

   public Boolean isHappy(String ear) {
      if (strContains(ear, happy)) {
         return true;
      }
      return false;
   }

   private Boolean strContains(String str1, HashSet<String> containsMe) {
      for (String temp : containsMe) {
         if (str1.contains(temp)) {
            return true;
         }
      }
      return false;
   }
}

alg part : APSoulConvo

Code:
package chobit;

import java.util.Random;

public class APSoulConvo extends AbsAlgPart {
   private String reply = "";
   private ComplimentRecog complimentRecog = new ComplimentRecog();
   private EmoRecog emorecog = new EmoRecog();
   private String[] replies = { "chiinormal", "chiihappy", "chiiexcited", "chiicurious", "chiiangry" };
   private Random rand = new Random();
   private CldBool cldBool;
   private ZeroTimeGate timeGate;

   public APSoulConvo(CldBool cldBool, ZeroTimeGate timeGate) {
      super();
      this.cldBool = cldBool;
      this.timeGate = timeGate;
   }

   @Override
   public String action(String ear, String skin, String eye) {
      reply = "";
      // exit conditions :
      if (timeGate.isClosed()) {
         cldBool.setModeActive(false);
         return "";
      }
      switch (ear) {
      case "ok":
      case "okay":
      case "stop":
      case "stop it":
      case "shut up":
      case "be quiet":
         cldBool.setModeActive(false);
         return "";
      }
      if (ear.isEmpty()) {
         return "";
      }
      // determine reply, renew gate
      timeGate.open(1);
      reply = complimentRecog.isCompliment(ear);
      if (!reply.isEmpty()) {
         return reply;
      }
      if (emorecog.isCurious(ear)) {
         reply = "chiicurious";
         return reply;
      }
      if (emorecog.isAngry(ear)) {
         reply = "chiiangry";
         return reply;
      }
      if (emorecog.isHappy(ear)) {
         reply = "chiihappy";
         return reply;
      }
      if (emorecog.isExcited(ear)) {
         reply = "chiiexcited";
         return reply;
      }
      int x = rand.nextInt(replies.length);
      reply = replies[x];
      return reply;
   }

   @Override
   public Boolean itemize() {
      return false;
   }

   @Override
   public enumFail failure(String input) {
      return enumFail.ok;
   }

   @Override
   public Boolean completed() {
      return !this.cldBool.getModeActive();
   }

   @Override
   public AbsAlgPart clone() {
      return new APSoulConvo(this.cldBool, this.timeGate);
   }

}

and the skill :

Code:
package chobit;

import java.util.ArrayList;

public class DiSoulV3 extends DISkill {
   private DISkillUtils diSkillUtils = new DISkillUtils();
   private CldBool cldBool = new CldBool();
   private ZeroTimeGate timeGate = new ZeroTimeGate(1);
   private Boolean launchAlg = false;
   public DiSoulV3(Kokoro kokoro) {
      super(kokoro);
   }

   @Override
   public void input(String ear, String skin, String eye) {
      if (ear.equals("hi") && !cldBool.getModeActive()) {
         cldBool.setModeActive(true);
         launchAlg = true;
         return;
      }
   }

   @Override
   public void output(Neuron noiron) {
      if (launchAlg) {
         launchAlg = false;
         APSay apSay = new APSay(1, "hadouken");
         timeGate.open(1);
         APSoulConvo apSoulConvo = new APSoulConvo(this.cldBool, this.timeGate);
         ArrayList<AbsAlgPart> algParts = new ArrayList<>();
         algParts.add(apSay);
         algParts.add(apSoulConvo);
         Algorithm algorithm = new Algorithm("soulconvo", "soulv3", algParts);
         noiron.algParts.add(algorithm);
      }
   }
}

sweet chii

_________________
MB over and out emp it up
Back to top Go down
 
DiSoulV3 even better pet waifu convo skills
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: