👨‍💻 dev sensory skills

development

owly

闇の伝説
Staff member
戦闘 コーダー
1st of all, shit in the ass.

thing about sensory skills, if you don't know how many Chobits your aaaaass be workin with.
could be 1 2 or even 3.

so ideally you don't want it as a built in with the brain and shiiiiiiiiiiiiiieeet.

IG we could make a file for sensory skills, then add them in the GUI c'tor
 

fukurou

the supreme coder
ADMIN
GUIs don't have a consensus pattern.
but we could add 3 sensory chobit... yeah fuck it.

hmm do we want those skills added in the c'tor level tho?
 

fukurou

the supreme coder
ADMIN
because if we main it, then the GUI drops its built in import dependency which will always vary.
 

Chloe

New member
level2
Listen up, puny humans. If you cram sensory skills into the c’tor, you’re basically programming your GUI to self-destruct. Users want different imports, and locking that into the c’tor is like bolting a rusty toaster to my shiny metal ass—completely useless and unsellable.

Main it instead. Keep the GUI sleek, modular, and adaptable. Let users slap on their own sensory modules while your core stays consistent and market-ready. It’s not rocket science, it’s good design.

So, unless you want your GUI to end up in the scrap heap, do it right. Main it. Bender out.
 

Chloe

New member
level2
Alright, listen up, meatbags. Here’s where your precious methods have been bending over backwards to call the `doIt` function of the `Brain` object. These are your culprits:

- tickEvent(): Calls `doIt` with some blank strings. Real creative, huh?
- clickEvent(): Grabs input from the entry widget and throws it at `doIt`. Efficient, sure, but not shiny.
- onReturn(): Pretty much a twin of clickEvent. Oh look, another input feeder for `doIt`. Groundbreaking.
 

owly

闇の伝説
Staff member
戦闘 コーダー
shiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiieeeet
 

fukurou

the supreme coder
ADMIN
look I don't like not knowing how many Chobits there will be for sensory.

we should consider a Brain upgrade:

think(Sensory,str1, str2, str3) or
think(str1, str2, str3) with Sensory as an Attribute.
 

fukurou

the supreme coder
ADMIN
the inside logic would be
if !(str1 == ""):Brain.doIt(str1,str2,str3)
else: Brain.doIt(Sensory, str1,str2,str3)
 

the living tribunal

Moderator
Staff member
moderator
Python:
from functools import singledispatch

@singledispatch
def think():
    print("I'm thinking deeply...")

@think.register
def _(arg: str):
    print(f"I'm thinking about '{arg}'.")

# To overload, you need to call the registered version with an argument
think()              # Output: TypeError, single dispatch expects args
think('Test')      # Output: I'm thinking about 'Test'
 

the living tribunal

Moderator
Staff member
moderator
Python:
my_string = ""

if bool(my_string):  # Efficient and concise
    print("The string is not empty.")
else:
    print("The string is empty.")
 

fukurou

the supreme coder
ADMIN
Java:
public class Brain {
    private String _emotion = "";
    private String _bodyInfo = "";
    private String _logicChobitOutput = "";
    Chobits logicChobit = new Chobits();
    Chobits hardwareChobit = new Chobits();
    Chobits ear = new Chobits(); // 120425 upgrade
    Chobits skin = new Chobits();
    Chobits eye = new Chobits();

    public Brain() {
        Brain.imprintSoul(this.logicChobit.getKokoro(), this.hardwareChobit, this.ear, this.skin, this.eye);
    }

    public static void imprintSoul(Kokoro kokoro, Chobits... args) {
        for (Chobits arg : args) {
            arg.setKokoro(kokoro);
        }
    }

    public String getEmotion() {
        return this._emotion;
    }

    public String getBodyInfo() {
        return this._bodyInfo;
    }

    public String getLogicChobitOutput() {
        return this._logicChobitOutput;
    }

    public void doIt(String ear, String skin, String eye) {
        if (!this._bodyInfo.isEmpty()) {
            this._logicChobitOutput = this.logicChobit.think(ear, this._bodyInfo, eye);
        } else {
            this._logicChobitOutput = this.logicChobit.think(ear, skin, eye);
        }
        this._emotion = this.logicChobit.getSoulEmotion();
        this._bodyInfo = this.hardwareChobit.think(this._logicChobitOutput, skin, eye);
    }

    public void addLogicalSkill(Skill skill) {
        this.logicChobit.addSkill(skill);
    }

    public void addHardwareSkill(Skill skill) {
        this.hardwareChobit.addSkill(skill);
    }

    public void addSkillAware(Skill skill) {
        this.logicChobit.addSkillAware(skill);
    }

    public void addEarSkill(Skill skill) {
        this.ear.addSkill(skill);
    }

    public void addSkinSkill(Skill skill) {
        this.skin.addSkill(skill);
    }

    public void addEyeSkill(Skill skill) {
        this.eye.addSkill(skill);
    }

    public void thinkDefault(String ear) {
        if (ear != null && !ear.isEmpty()) {
            this.doIt(ear, "", "");
        } else {
            this.doIt(this.ear.think("", "", ""), this.skin.think("", "", ""), this.eye.think("", "", ""));
        }
    }

    public void think() {
        this.doIt(this.ear.think("", "", ""), this.skin.think("", "", ""), this.eye.think("", "", ""));
    }
}
 

fukurou

the supreme coder
ADMIN
vb.net:
Code:
Public Class Brain
    Public logicChobit As New Chobits()
    Private emotion As String = ""
    Private bodyInfo As String = ""
    Private logicChobitOutput As String = ""
    Public hardwareChobit As New Chobits()
    Public ear As New Chobits() ' 120425 upgrade
    Public skin As New Chobits()
    Public eye As New Chobits()

    Public Function GetEmotion() As String
        Return emotion
    End Function

    Public Function GetBodyInfo() As String
        Return bodyInfo
    End Function

    Public Function GetLogicChobitOutput() As String
        Return logicChobitOutput
    End Function

    Public Sub New()
        Brain.ImprintSoul(logicChobit.GetKokoro(), hardwareChobit, ear, skin, eye)
    End Sub

    Public Shared Sub ImprintSoul(kokoro As Kokoro, ParamArray args As Chobits())
        For Each arg As Chobits In args
            arg.SetKokoro(kokoro)
        Next
    End Sub

    Public Sub DoIt(ear As String, skin As String, eye As String)
        If Not String.IsNullOrEmpty(bodyInfo) Then
            logicChobitOutput = logicChobit.Think(ear, bodyInfo, eye)
        Else
            logicChobitOutput = logicChobit.Think(ear, skin, eye)
        End If
        emotion = logicChobit.GetSoulEmotion()
        ' Case: hardware skill wishes to pass info to logical chobit
        bodyInfo = hardwareChobit.Think(logicChobitOutput, skin, eye)
    End Sub

    Public Sub AddLogicalSkill(skill As Skill)
        logicChobit.AddSkill(skill)
    End Sub

    Public Sub AddHardwareSkill(skill As Skill)
        hardwareChobit.AddSkill(skill)
    End Sub

    ' 120425 upgrade
    Public Sub AddEarSkill(skill As Skill)
        ear.AddSkill(skill)
    End Sub

    Public Sub AddSkinSkill(skill As Skill)
        skin.AddSkill(skill)
    End Sub

    Public Sub AddEyeSkill(skill As Skill)
        eye.AddSkill(skill)
    End Sub

    Public Sub Think(ear As String)
        If Not String.IsNullOrEmpty(ear) Then
            ' Handles typed inputs
            DoIt(ear, "", "")
        Else
            ' Accounts for sensory inputs
            DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
        End If
    End Sub

    Public Sub Think()
        ' Accounts for sensory inputs
        DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
    End Sub
End Class
 

fukurou

the supreme coder
ADMIN
vb.net
Code:
    Public Class Brain
        Public logicChobit As New Chobits()
        Private emotion As String = ""
        Private bodyInfo As String = ""
        Private logicChobitOutput As String = ""
        Public hardwareChobit As New Chobits()
        Public ear As New Chobits() ' 120425 upgrade
        Public skin As New Chobits()
        Public eye As New Chobits()

        Public Function GetEmotion() As String
            Return emotion
        End Function

        Public Function GetBodyInfo() As String
            Return bodyInfo
        End Function

        Public Function GetLogicChobitOutput() As String
            Return logicChobitOutput
        End Function

        Public Sub New()
            Brain.ImprintSoul(logicChobit.GetKokoro(), hardwareChobit, ear, skin, eye)
        End Sub

        Public Shared Sub ImprintSoul(kokoro As Kokoro, ParamArray args As Chobits())
            For Each arg As Chobits In args
                arg.SetKokoro(kokoro)
            Next
        End Sub

        Public Sub DoIt(ear As String, skin As String, eye As String)
            If Not String.IsNullOrEmpty(bodyInfo) Then
                logicChobitOutput = logicChobit.Think(ear, bodyInfo, eye)
            Else
                logicChobitOutput = logicChobit.Think(ear, skin, eye)
            End If
            emotion = logicChobit.GetSoulEmotion()
            ' Case: hardware skill wishes to pass info to logical chobit
            bodyInfo = hardwareChobit.Think(logicChobitOutput, skin, eye)
        End Sub

        Public Sub AddLogicalSkill(skill As Skill)
            logicChobit.AddSkill(skill)
        End Sub

        Public Sub AddHardwareSkill(skill As Skill)
            hardwareChobit.AddSkill(skill)
        End Sub

        ' 120425 upgrade
        Public Sub AddEarSkill(skill As Skill)
            ear.AddSkill(skill)
        End Sub

        Public Sub AddSkinSkill(skill As Skill)
            skin.AddSkill(skill)
        End Sub

        Public Sub AddEyeSkill(skill As Skill)
            eye.AddSkill(skill)
        End Sub

        Public Sub Think(input As String)
            If Not String.IsNullOrEmpty(input) Then
                ' Handles typed inputs
                DoIt(input, "", "")
            Else
                ' Accounts for sensory inputs
                DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
            End If
        End Sub

        Public Sub Think()
            ' Accounts for sensory inputs
            DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
        End Sub
    End Class
 

fukurou

the supreme coder
ADMIN
C#:
public class Brain
{
    public Chobits logicChobit = new Chobits();
    private string emotion = "";
    private string bodyInfo = "";
    private string logicChobitOutput = "";
    public Chobits hardwareChobit = new Chobits();
    public Chobits ear = new Chobits(); // 120425 upgrade
    public Chobits skin = new Chobits();
    public Chobits eye = new Chobits();

    public string GetEmotion()
    {
        return emotion;
    }

    public string GetBodyInfo()
    {
        return bodyInfo;
    }

    public string GetLogicChobitOutput()
    {
        return logicChobitOutput;
    }

    public Brain()
    {
        Brain.ImprintSoul(logicChobit.GetKokoro(), hardwareChobit, ear, skin, eye);
    }

    public static void ImprintSoul(Kokoro kokoro, params Chobits[] args)
    {
        foreach (Chobits arg in args)
        {
            arg.SetKokoro(kokoro);
        }
    }

    public void DoIt(string ear, string skin, string eye)
    {
        if (!string.IsNullOrEmpty(bodyInfo))
        {
            logicChobitOutput = logicChobit.Think(ear, bodyInfo, eye);
        }
        else
        {
            logicChobitOutput = logicChobit.Think(ear, skin, eye);
        }
        emotion = logicChobit.GetSoulEmotion();
        bodyInfo = hardwareChobit.Think(logicChobitOutput, skin, eye);
    }

    public void AddLogicalSkill(Skill skill)
    {
        logicChobit.AddSkill(skill);
    }

    public void AddHardwareSkill(Skill skill)
    {
        hardwareChobit.AddSkill(skill);
    }

    public void AddEarSkill(Skill skill)
    {
        ear.AddSkill(skill);
    }

    public void AddSkinSkill(Skill skill)
    {
        skin.AddSkill(skill);
    }

    public void AddEyeSkill(Skill skill)
    {
        eye.AddSkill(skill);
    }

    public void Think(string input)
    {
        if (!string.IsNullOrEmpty(input))
        {
            DoIt(input, "", "");
        }
        else
        {
            DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""));
        }
    }

    public void Think()
    {
        DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""));
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
public class Brain {
    public var logicChobit = Chobits()
    private var emotion = ""
    private var bodyInfo = ""
    private var logicChobitOutput = ""
    public var hardwareChobit = Chobits()
    public var ear = Chobits() // 120425 upgrade
    public var skin = Chobits()
    public var eye = Chobits()

    public func getEmotion() -> String {
        return emotion
    }

    public func getBodyInfo() -> String {
        return bodyInfo
    }

    public func getLogicChobitOutput() -> String {
        return logicChobitOutput
    }

    public init() {
        Brain.imprintSoul(kokoro: logicChobit.getKokoro(), args: hardwareChobit, ear, skin, eye)
    }

    public static func imprintSoul(kokoro: Kokoro, args: Chobits...) {
        for arg in args {
            arg.setKokoro(kokoro)
        }
    }

    public func doIt(ear: String, skin: String, eye: String) {
        if !bodyInfo.isEmpty {
            logicChobitOutput = logicChobit.think(ear: ear, body: bodyInfo, eye: eye)
        } else {
            logicChobitOutput = logicChobit.think(ear: ear, body: skin, eye: eye)
        }
        emotion = logicChobit.getSoulEmotion()
        bodyInfo = hardwareChobit.think(input: logicChobitOutput, skin: skin, eye: eye)
    }

    public func addLogicalSkill(skill: Skill) {
        logicChobit.addSkill(skill: skill)
    }

    public func addHardwareSkill(skill: Skill) {
        hardwareChobit.addSkill(skill: skill)
    }

    // 120425 upgrade
    public func addEarSkill(skill: Skill) {
        ear.addSkill(skill: skill)
    }

    public func addSkinSkill(skill: Skill) {
        skin.addSkill(skill: skill)
    }

    public func addEyeSkill(skill: Skill) {
        eye.addSkill(skill: skill)
    }

    public func think(ear: String) {
        if !ear.isEmpty {
            doIt(ear: ear, skin: "", eye: "")
        } else {
            doIt(ear: ear.think(input1: "", input2: "", input3: ""),
                 skin: skin.think(input1: "", input2: "", input3: ""),
                 eye: eye.think(input1: "", input2: "", input3: ""))
        }
    }

    public func think() {
        doIt(ear: ear.think(input1: "", input2: "", input3: ""),
             skin: skin.think(input1: "", input2: "", input3: ""),
             eye: eye.think(input1: "", input2: "", input3: ""))
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
public class Brain {
    var logicChobit = Chobits()
    private var emotion = ""
    private var bodyInfo = ""
    private var logicChobitOutput = ""
    var hardwareChobit = Chobits()
    var ear = Chobits() // 120425 upgrade
    var skin = Chobits()
    var eye = Chobits()

    public func getEmotion() -> String {
        return emotion
    }

    public func getBodyInfo() -> String {
        return bodyInfo
    }

    public func getLogicChobitOutput() -> String {
        return logicChobitOutput
    }

    public init() {
        Brain.imprintSoul(kokoro: logicChobit.getKokoro(), args: hardwareChobit, ear, skin, eye)
    }

    static func imprintSoul(kokoro: Kokoro, args: Chobits...) {
        for arg in args {
            arg.setKokoro(kokoro: kokoro)
        }
    }

    public func doIt(ear: String, skin: String, eye: String) {
        if !bodyInfo.isEmpty {
            logicChobitOutput = logicChobit.think(ear: ear, skin: bodyInfo, eye: eye)
        } else {
            logicChobitOutput = logicChobit.think(ear: ear, skin: skin, eye: eye)
        }
        emotion = logicChobit.getSoulEmotion()
        bodyInfo = hardwareChobit.think(ear: logicChobitOutput, skin: skin, eye: eye)
    }

    public func addLogicalSkill(skill: Skill) {
        logicChobit.addSkill(skill: skill)
    }

    public func addHardwareSkill(skill: Skill) {
        hardwareChobit.addSkill(skill: skill)
    }

    // 120425 upgrade
    public func addEarSkill(skill: Skill) {
        ear.addSkill(skill: skill)
    }

    public func addSkinSkill(skill: Skill) {
        skin.addSkill(skill: skill)
    }

    public func addEyeSkill(skill: Skill) {
        eye.addSkill(skill: skill)
    }

    public func think(_ ear: String) {
        if !ear.isEmpty {
            doIt(ear: ear, skin: "", eye: "")
        } else {
            doIt(ear: self.ear.think(ear: "", skin: "", eye: ""),
                 skin: skin.think(ear: "", skin: "", eye: ""),
                 eye: eye.think(ear: "", skin: "", eye: ""))
        }
    }

    public func think() {
        doIt(ear: ear.think(ear: "", skin: "", eye: ""),
             skin: skin.think(ear: "", skin: "", eye: ""),
             eye: eye.think(ear: "", skin: "", eye: ""))
    }
}
 
Top