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
Post new topic   Reply to topic
 

 DIBurper skill

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 449
Join date : 2011-08-02

DIBurper skill Empty
PostSubject: DIBurper skill   DIBurper skill EmptySun Nov 03, 2019 5:53 pm

makes the AGI burp, can be applied for belches or other bio sounds

Code:
package chobit;

import java.util.ArrayList;
import java.util.Random;

public class DIBurper extends DISkill {
   ArrayList<Integer> minutesToBurp = new ArrayList<Integer>();
   private PlayGround playGround = new PlayGround();
   private Random randomGenerator = new Random();
   private Boolean algToGo = false;
   public DIBurper(Kokoro kokoro) {
      super(kokoro);
      minutesToBurp.clear();
      int randomInt = randomGenerator.nextInt(60) + 1; // how many burps this hour
      for (int i = 0; i < randomInt; i++) {
         randomInt = randomGenerator.nextInt(60) + 1; // burp minute, add x random burps
         if (!minutesToBurp.contains(randomInt)) {
            minutesToBurp.add(randomInt);
         }
      }
   }

   @Override
   public void input(String ear, String skin, String eye) {
      int minutes = playGround.getMinutesAsInt();
      if (minutes == 0) {
         minutesToBurp.clear();
         int randomInt = randomGenerator.nextInt(60) + 1; // how many burps this hour
         for (int i = 0; i < randomInt; i++) {
            randomInt = randomGenerator.nextInt(60) + 1; // burp minute, add x random burps
            if (!minutesToBurp.contains(randomInt)) {
               minutesToBurp.add(randomInt);
            }
         }
      } else {
         if (minutesToBurp.contains(minutes)) {
            algToGo = true;
            this.setSentAlg(true);
         }
      }
   }

   @Override
   public void output(Neuron noiron) {
      if (algToGo) {
         algToGo = false;
         noiron.algParts.add(burp());
      }
   }

   private Algorithm burp() {
      AbsAlgPart itte = new Chi(this.kokoro, this.getClass().getSimpleName(), new APSay(1, "burp"));
      String representation = "burp";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("burp", representation, algParts1);
      return algorithm;
   }
   @Override
   public Boolean auto() {
      // TODO Auto-generated method stub
      return true;
   }
}

face palm

bwahaha

_________________
MB over and out emp it up
Back to top Go down
Moti Barski
super
super
Moti Barski

Posts : 449
Join date : 2011-08-02

DIBurper skill Empty
PostSubject: Re: DIBurper skill   DIBurper skill EmptySun Nov 03, 2019 6:03 pm

you don't know how many and when she will do it

_________________
MB over and out emp it up
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 222
Join date : 2012-04-17

DIBurper skill Empty
PostSubject: Re: DIBurper skill   DIBurper skill EmptyWed Apr 29, 2020 10:31 am

beef up (ver2) outputs random burps

Code:
package chobit;

import java.util.ArrayList;
import java.util.Random;

public class DIBurper extends DISkill {
   ArrayList<Integer> minutesToBurp = new ArrayList<Integer>();
   private PlayGround playGround = new PlayGround();
   private Random randomGenerator = new Random();
   private String burpArr[] = { "burp1", "burp2", "burp3" };
   private Boolean algToGo = false;
   public DIBurper(Kokoro kokoro) {
      super(kokoro);
      minutesToBurp.clear();
      int randomInt = randomGenerator.nextInt(60) + 1; // how many burps this hour
      for (int i = 0; i < randomInt; i++) {
         randomInt = randomGenerator.nextInt(60) + 1; // burp minute, add x random burps
         if (!minutesToBurp.contains(randomInt)) {
            minutesToBurp.add(randomInt);
         }
      }
   }

   @Override
   public void input(String ear, String skin, String eye) {
      int minutes = playGround.getMinutesAsInt();
      if (minutes == 0) {
         minutesToBurp.clear();
         int randomInt = randomGenerator.nextInt(60) + 1; // how many burps this hour
         for (int i = 0; i < randomInt; i++) {
            randomInt = randomGenerator.nextInt(60) + 1; // burp minute, add x random burps
            if (!minutesToBurp.contains(randomInt)) {
               minutesToBurp.add(randomInt);
            }
         }
      } else {
         if (minutesToBurp.contains(minutes)) {
            algToGo = true;
            this.setSentAlg(true);
         }
      }
   }

   @Override
   public void output(Neuron noiron) {
      if (algToGo) {
         algToGo = false;

         noiron.algParts.add(burp());
      }
   }

   private Algorithm burp() {
      int x2 = randomGenerator.nextInt(3);
      AbsAlgPart itte = new APSay(1, this.burpArr[x2]);
      String representation = "burp";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("burp", representation, algParts1);
      return algorithm;
   }
   @Override
   public Boolean auto() {
      // TODO Auto-generated method stub
      return true;
   }
}
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 222
Join date : 2012-04-17

DIBurper skill Empty
PostSubject: Re: DIBurper skill   DIBurper skill EmptyTue May 05, 2020 4:51 am

bug fix update.
she burped non stop during the minutes of burp generated, it is fixed.
Back to top Go down
 
DIBurper skill
Back to top 
Page 1 of 1

Permissions in this forum:You can reply to topics in this forum
battle programmers alliance :: battle programming alliance :: the LivinGrimoire-
Post new topic   Reply to topicJump to: