public class DiOneWorder extends DiSkillV2 {
private String cry = "chi ";
private PercentDripper drip = new PercentDripper();
private Boolean mode = false;
@Override
public void input(String ear, String skin, String eye) {
if(ear.isEmpty()){return;}
if(ear.equals("chi")){
mode = !mode;
setSimpleAlg("toggled");
return;
}
if(mode && drip.drip()){
setSimpleAlg(convertToChi(ear));
}
}
public String convertToChi(String input) {
// Split the input string into words
String[] words = input.split("\\s+"); // Assumes words are separated by spaces
// Initialize an empty result string
StringBuilder result = new StringBuilder();
// Iterate through each word
for (String word : words) {
// Append "chi" to the result
result.append(cry);
}
// Remove the trailing space
if (result.length() > 0) {
result.deleteCharAt(result.length() - 1);
}
return result.toString();
}
}
public class DiOneWorder extends DiSkillV2 {
private String cry = "chi ";
private String toggler = "chi";
private PercentDripper drip = new PercentDripper();
private Boolean mode = false;
public void setCry(String cry) {
this.cry = cry + " ";
}
public void setDrip(PercentDripper drip) {
this.drip = drip;
}
public void setToggler(String toggler) {
this.toggler = toggler;
}
@Override
public void input(String ear, String skin, String eye) {
if(ear.isEmpty()){return;}
if(ear.equals(toggler)){
mode = !mode;
setSimpleAlg("toggled");
return;
}
if(mode && drip.drip()){
setSimpleAlg(convertToChi(ear));
}
}
public String convertToChi(String input) {
// Split the input string into words
String[] words = input.split("\\s+"); // Assumes words are separated by spaces
// Initialize an empty result string
StringBuilder result = new StringBuilder();
// Iterate through each word
for (String word : words) {
// Append "chi" to the result
result.append(cry);
}
// Remove the trailing space
if (result.length() > 0) {
result.deleteCharAt(result.length() - 1);
}
return result.toString();
}
}
class DiOneWorder(DiSkillV2):
def __init__(self):
super().__init__() # Call the superclass constructor
self.cry = "chi "
self.toggler = "chi"
self.drip = PercentDripper() # Assuming PercentDripper is implemented
self.mode = False
def set_cry(self, cry):
self.cry = cry + " "
def set_toggler(self, toggler):
self.toggler = toggler
def input(self, ear, skin, eye):
if not ear:
return
if ear == self.toggler:
self.mode = not self.mode
self.set_simple_alg("toggled")
return
if self.mode and self.drip.drip():
self.set_simple_alg(self.convert_to_chi(ear))
def convert_to_chi(self, input_str):
# Split the input string into words
words = input_str.split()
# Initialize an empty result string
result = ""
# Iterate through each word
for word in words:
# Append "chi" to the result
result += self.cry
# Remove the trailing space
if result:
result = result[:-1]
return result
class DiOneWorder(DiSkillV2):
def __init__(self):
super().__init__() # Call the superclass constructor
self.cry: str = "chi "
self.toggler: str = "chi"
self.drip: PercentDripper = PercentDripper() # Assuming PercentDripper is implemented
self.mode: bool = False
def set_cry(self, cry):
self.cry = cry + " "
def set_toggler(self, toggler):
self.toggler = toggler
def input(self, ear, skin, eye):
if not ear:
return
if ear == self.toggler:
self.mode = not self.mode
self.setSimpleAlg("toggled")
return
if self.mode and self.drip.drip():
self.setSimpleAlg(self.convert_to_chi(ear))
def convert_to_chi(self, input_str):
# Split the input string into words
words = input_str.split()
# Initialize an empty result string
result = ""
# Iterate through each word
for word in words:
# Append "chi" to the result
result += self.cry
# Remove the trailing space
if result:
result = result[:-1]
return result