Search results

  1. fukurou

    F# core

    the F stands 4 fuck module AbsDictionaryDB open System.Collections.Generic type DictionaryDB(saveFunc, loadFunc) = let db = Dictionary<string, string>() member _.Save key value = saveFunc db key value member _.Load key = loadFunc db key // Example save/load logic let defaultSave...
  2. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    module AbsDictionaryDB open System.Collections.Generic type DictionaryDB(saveFunc, loadFunc) = let db = Dictionary<string, string>() member _.Save key value = saveFunc db key value member _.Load key = loadFunc db key // Example save/load logic let defaultSave (db...
  3. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    module AbsDictionaryDB type SaveFunction = string -> string -> unit type LoadFunction = string -> string let createDictionaryDB (saveFunc: SaveFunction) (loadFunc: LoadFunction) = { new obj() with member _.Save = saveFunc member _.Load = loadFunc } // Example usage...
  4. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Skill { protected var kokoro: Kokoro? = nil // Consciousness, shallow ref class to enable interskill communications protected var outAlg: Algorithm? = nil // Skills output protected var outpAlgPriority: Int = -1 // DEFCON levels 1->5 init() { super.init() }...
  5. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm { private var algParts: [Mutatable] = [] init(algParts: [Mutatable]) { self.algParts = algParts } init(_ algParts: Mutatable...) { self.algParts = algParts } func getAlgParts() -> [Mutatable] { return algParts } func...
  6. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class APVerbatim: Mutatable { private var sentences: [String] = [] init(sentences: String...) { self.sentences.append(contentsOf: sentences) } init(list1: [String]) { self.sentences = list1 } override func action(ear: String, skin: String, eye: String)...
  7. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    public void algPartsFusion(int priority, Mutatable... algParts) { this.outAlg = new Algorithm(algParts); this.outpAlgPriority = priority; // 1->5, 1 is the highest algorithm priority }
  8. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Skill: def __init__(self) -> None: # Initialize protected attributes self.kokoro: Optional['Kokoro'] = None # Shallow reference for interskill communication self.outAlg: Optional['Algorithm'] = None # Skill's output self.outpAlgPriority: int = -1 #...
  9. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    skill original class Skill: def __init__(self): # The variables start with an underscore (_) because they are protected self._kokoro = None # consciousness, shallow ref class to enable interskill communications self._outAlg: Algorithm # skills output...
  10. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm: def __init__(self, algParts: list[Mutatable]) -> None: super().__init__() self.algParts: list[Mutatable] = algParts @classmethod def from_varargs(cls, *algParts: Mutatable) -> 'Algorithm': # Create an instance from varargs return...
  11. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm: def __init__(self, *args: Mutatable) -> None: super().__init__() if len(args) == 1 and isinstance(args[0], list): # Check if input is a list self.algParts: list[Mutatable] = args[0] # Assign the list directly else: # Handle varargs case...
  12. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    prechange py: class Algorithm: def __init__(self, algParts: list[Mutatable]): # list of Mutatable super().__init__() self.algParts: list[Mutatable] = algParts # *constract with string and goal @property def getAlgParts(self) -> list[Mutatable]: return...
  13. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm: def __init__(self, *algParts): # Handle both a list input and variable arguments if len(algParts) == 1 and isinstance(algParts[0], list): self.algParts = list(algParts[0]) # Initialize with the given list else: self.algParts =...
  14. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm: def __init__(self, *algParts): # Handle both a list input and variable arguments if len(algParts) == 1 and isinstance(algParts[0], list): self.algParts = list(algParts[0]) # Initialize with the given list else: self.algParts =...
  15. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm: def __init__(self, *algParts): # Check if a single argument is a list, otherwise use variable arguments if len(algParts) == 1 and isinstance(algParts[0], list): self.algParts = list(algParts[0]) # Initialize with the given list else...
  16. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class APVerbatim: def __init__(self, *sentences): # Initialize with either a list of sentences or a variable number of arguments if len(sentences) == 1 and isinstance(sentences[0], list): self.sentences = list(sentences[0]) # Initialize with a copy of the list...
  17. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Skill { constructor() { this.kokoro = null; // Consciousness, shallow ref class for interskill communications this.outAlg = null; // Skill's output this.outpAlgPriority = -1; // DEFCON levels 1->5 } // Skill triggers and algorithmic logic input(ear...
  18. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class Algorithm { constructor(algParts) { // Handle both Array input and variable arguments (rest parameters) this.algParts = Array.isArray(algParts) ? [...algParts] : [...arguments]; } getAlgParts() { return this.algParts; } getSize() {...
  19. fukurou

    πŸ‘¨β€πŸ’» dev core diet

    class APVerbatim extends Mutatable { constructor(...sentences) { super(); this.sentences = Array.isArray(sentences[0]) ? [...sentences[0]] : [...sentences]; } action(ear, skin, eye) { // Return the next sentence and remove it from the list if...
Top