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
 

 dIBukubukuchagama skill

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 445
Join date : 2011-08-02

dIBukubukuchagama skill Empty
PostSubject: dIBukubukuchagama skill   dIBukubukuchagama skill EmptyWed Apr 15, 2020 1:08 am



bukubukuchagama timer skill :

between 1 and 2 minutes and between 20 and 21 minutes

https://streamable.com/1e0xc8

DIBukubukuchagama java cls :

Code:
package com.yotamarker.lgkotlin1;

import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DIBukubukuchagama extends DISkill {
    // simple timer alarm
    private TimeGate timeGate = new TimeGate();
    private int mode = 0;

    public DIBukubukuchagama(Kokoro kokoro) {
        super(kokoro);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void input(String ear, String skin, String eye) {
        if (ear.contains("reminder")) {
            // "\\d+"
            String minutes = regexChecker("\\d+", ear);
            if (!minutes.isEmpty()) {
                int intMinutes = Integer.parseInt(minutes);
                mode = 1;
                timeGate.setPause(intMinutes);
            }
        }
    }

    @Override
    public void output(Neuron noiron) {
        switch (mode) {
            case 1:
                noiron.algParts.add(verbatimGorithm(new APVerbatim("alarm set")));
                timeGate.close();
                mode = 2;
                break;
            case 2:
                if (!timeGate.isClosed()) {
                    noiron.algParts.add(verbatimGorithm(new APVerbatim("oniichan alarm")));
                    mode = 0;
                }
                break;
            default:
                break;
        }
    }

    public static String regexChecker(String theRegex, String str2Check) {
        Pattern checkRegex = Pattern.compile(theRegex);
        Matcher regexMatcher = checkRegex.matcher(str2Check);
        while (regexMatcher.find()) {
            if (regexMatcher.group().length() != 0) {
                return regexMatcher.group().trim();
            }
        }
        return "";
    }

    private Algorithm verbatimGorithm(AbsAlgPart itte) {
        // returns a simple algorithm for saying sent parameter
        String representation = "bukubukuchagama";
        ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
        algParts1.add(itte);
        Algorithm algorithm = new Algorithm("bukubukuchagama", representation, algParts1);
        return algorithm;
    }
}

a timer skill and hi tier at that

sweet

_________________
MB over and out emp it up
Back to top Go down
 
dIBukubukuchagama 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: