Search results

  1. fukurou

    ass shit creamed corn inside the ass

    from __future__ import annotations
  2. fukurou

    port overlort python ->Swift assed edition!

    /// Simulates a "Night Rider" LED display that moves position up and down in a bounce pattern. class AXNightRider { private var mode: Int = 0 private var position: Int = 0 private var lim: Int = 0 private var direction: Int = 1 init(limit: Int) { if limit > 0 {...
  3. fukurou

    port overlort python ->Swift assed edition!

    /// Provides tools for generating string permutations from multiple lists. class CombinatoricalUtils { private(set) var result: [String] = [] /// Internal recursive function to generate permutations. private func generatePermutationsHelper(_ lists: [[String]], _ result: inout...
  4. fukurou

    port overlort python ->Swift assed edition!

    /// A simple key-value pair representation class AXKeyValuePair { private var key: String private var value: String init(key: String = "", value: String = "") { self.key = key self.value = value } func getKey() -> String { return key } func...
  5. fukurou

    port overlort python ->Swift assed edition!

    // ╔════════════════════════════════════════════════════════════════════════╗ // ║ MISCELLANEOUS ║ // ╚════════════════════════════════════════════════════════════════════════╝
  6. fukurou

    port overlort python ->Swift assed edition!

    /// A limited-size dictionary used for short-term memory. /// Evicts oldest entries based on insertion order. class Catche { private var limit: Int private var keys: UniqueItemSizeLimitedPriorityQueue private var dict: [String: String] = [:] init(size: Int) { self.limit...
  7. fukurou

    port overlort python ->Swift assed edition!

    /// Stores a log of notes and allows cyclical access class Notes { private var log: [String] = [] private var index: Int = 0 /// Add a new note to the log func add(_ note: String) { log.append(note) } /// Clear all notes func clear() {...
  8. fukurou

    port overlort python ->Swift assed edition!

    /// Manages a pool of dynamic strategies drawn from a central responder class Strategy { private var allStrategies: UniqueResponder private var strategiesLim: Int private var activeStrategy: UniqueItemSizeLimitedPriorityQueue init(_ allStrategies: UniqueResponder, _...
  9. fukurou

    port overlort python ->Swift assed edition!

    /// Enables pattern-based event prediction and alert recognition class SpiderSense { private var spiderSense: Bool = false private var events: UniqueItemSizeLimitedPriorityQueue private var alerts: UniqueItemSizeLimitedPriorityQueue private var previous: String = "null"...
  10. fukurou

    port overlort python ->Swift assed edition!

    // ╔════════════════════════════════════════════════════════════════════════╗ // ║ LEARNABILITY ║ // ╚════════════════════════════════════════════════════════════════════════╝
  11. fukurou

    port overlort python ->Swift assed edition!

    /// Detects directional changes between two observed string tokens /// and returns a corresponding code. class ChangeDetector { private let A: String private let B: String private var prev: Int = -1 init(_ a: String, _ b: String) { self.A = a self.B = b }...
  12. fukurou

    port overlort python ->Swift assed edition!

    /// Tracks the difference between sampled power levels. class Differ { private var powerLevel: Int = 90 private var difference: Int = 0 /// Returns the last sampled power level. func getPowerLevel() -> Int { return powerLevel } /// Returns the most recent...
  13. fukurou

    port overlort python ->Swift assed edition!

    /// AXHandshake manages time-based shout-outs and user acknowledgment class AXHandshake { private var trgTime = TrgTime() private var trgTolerance = TrgTolerance(10) private var shoutout = AXShoutOut() private var userName: String = "" private var dripper = PercentDripper()...
  14. fukurou

    port overlort python ->Swift assed edition!

    /// Reacts to a contextual "shout out" once and disables itself after reply. class AXShoutOut { private var isActive: Bool = false var handshake: Responder = Responder() /// Enable the shout out system—must be called to activate engagement func activate() { isActive =...
  15. fukurou

    port overlort python ->Swift assed edition!

    /// Detects if a button was pressed (on edge change). /// Disables physical engagement while the button remains pressed. class ButtonEngager { private var prevState: Bool = false /// Returns true only once when button is newly pressed. func engage(_ btnState: Bool) -> Bool {...
  16. fukurou

    port overlort python ->Swift assed edition!

    /// Common code lines used in machine logic to declutter /// Also provides simplified extensions for dictionary actions class AXMachineCode { private var dic: [String: Int] = [:] /// Adds a key-value pair to the internal dictionary /// Returns self to allow builder-style chaining...
  17. fukurou

    port overlort python ->Swift assed edition!

    class AXPrompt { private var isActive: Bool = false private var index: Int = 0 private var prompts: [Prompt] = [] private var kv: AXKeyValuePair? = AXKeyValuePair() /// Add a prompt to the sequence func addPrompt(_ p: Prompt) { prompts.append(p) } ///...
  18. fukurou

    port overlort python ->Swift assed edition!

    class Prompt { private var kv = AXKeyValuePair() private var prompt: String = "" private var regex: String = "" init() { kv.key = "default" } func getPrompt() -> String { return prompt } func setPrompt(_ prompt: String) { self.prompt =...
  19. fukurou

    port overlort python ->Swift assed edition!

    // ╔════════════════════════════════════════════════════════════════════════╗ // ║ STATE MANAGEMENT ║ // ╚════════════════════════════════════════════════════════════════════════╝
  20. fukurou

    port overlort python ->Swift assed edition!

    /// Learns 1-word inputs and returns a recently learned word class Responder1Word { private var q = UniqueItemSizeLimitedPriorityQueue(limit: 5) init() { // Seed with some baby-babble classics q.insert("chi") q.insert("gaga") q.insert("gugu")...
Top