Search results

  1. fukurou

    port overlort python ->Swift assed edition!

    class TrgEveryNMinutes { private var _minutes: Int private var _timeStamp: String private var _trgTime = TrgTime() init(_ startTime: String, _ minutes: Int) { self._minutes = minutes self._timeStamp = startTime self._trgTime.setTime(startTime) }...
  2. fukurou

    port overlort python ->Swift assed edition!

    class TrgMinute { private var _hour1: Int = -1 private var _minute: Int init() { _minute = Int.random(in: 0...60) } func setMinute(_ minute: Int) { if (0..<61).contains(minute) { _minute = minute } } func trigger() -> Bool {...
  3. fukurou

    port overlort python ->Swift assed edition!

    class QuestionChecker { static let questionWords: Set<String> = [ "what", "who", "where", "when", "why", "how", "is", "are", "was", "were", "do", "does", "did", "can", "could", "would", "will", "shall", "should", "have", "has", "am", "may", "might" ]...
  4. fukurou

    port overlort python ->Swift assed edition!

    class KeyWords { private var hashSet: Set<String> = [] init(_ keywords: String...) { hashSet.formUnion(keywords) } func addKeyword(_ keyword: String) { hashSet.insert(keyword) } func extractor(_ str1: String) -> String { for keyword in hashSet {...
  5. fukurou

    port overlort python ->Swift assed edition!

    class TimeAccumulator { private var _timeGate: TimeGate private var _accumulator: Int = 0 init(_ tick: Int) { self._timeGate = TimeGate(tick) self._timeGate.openForPauseMinutes() } func setTick(_ tick: Int) { _timeGate.setPause(tick) } func...
  6. fukurou

    port overlort python ->Swift assed edition!

    class OnOffSwitch { private var _mode: Bool = false private var _timeGate = TimeGate(5) private var _on = Responder("on", "talk to me") private var _off = Responder("off", "stop", "shut up", "shut it", "whatever", "whateva") func setPause(_ minutes: Int) {...
  7. fukurou

    port overlort python ->Swift assed edition!

    class Cycler { private var limit: Int private var _cycler: Int init(_ limit: Int) { self.limit = limit self._cycler = limit } func cycleCount() -> Int { _cycler -= 1 if _cycler < 0 { _cycler = limit } return...
  8. fukurou

    port overlort python ->Swift assed edition!

    class AXStandBy { private var _tg: TimeGate init(_ pause: Int) { self._tg = TimeGate(pause) self._tg.openForPauseMinutes() } func standBy(_ ear: String) -> Bool { if !ear.isEmpty { _tg.openForPauseMinutes() return false }...
  9. fukurou

    port overlort python ->Swift assed edition!

    class Cron { private var _minutes: Int private var _timeStamp: String private var _initialTimeStamp: String private var _trgTime = TrgTime() private var _counter: Int = 0 private var _limit: Int init(_ startTime: String, _ minutes: Int, _ limit: Int) {...
  10. fukurou

    port overlort python ->Swift assed edition!

    class TrgTime { private var _t: String = "null" private var _alarm: Bool = true init() { // No super.init() needed unless subclassing } func setTime(_ v1: String) { var timeStr = v1 if timeStr.hasPrefix("0") { timeStr.removeFirst()...
  11. fukurou

    port overlort python ->Swift assed edition!

    class AXPassword { private var _isOpen: Bool = false private var _maxAttempts: Int = 3 private var _loginAttempts: Int = 3 private var _code: Int = 0 func codeUpdate(_ ear: String) -> Bool { guard _isOpen else { return false } if ear.contains("code") {...
  12. fukurou

    port overlort python ->Swift assed edition!

    class DrawRnd { private var strings = LGFIFO() private var _stringsSource: [String] = [] init(_ values: String...) { for value in values { strings.insert(value) _stringsSource.append(value) } } func addElement(_ element: String) {...
  13. fukurou

    port overlort python ->Swift assed edition!

    class LGTypeConverter { static func convertToInt(_ v1: String) -> Int { let temp = RegexUtil.extractEnumRegex(.integer, v1) return temp.isEmpty ? 0 : Int(temp) ?? 0 } static func convertToDouble(_ v1: String) -> Double { let temp =...
  14. fukurou

    port overlort python ->Swift assed edition!

    class AXInputWaiter { private var _trgTolerance: TrgTolerance init(_ tolerance: Int) { self._trgTolerance = TrgTolerance(tolerance) self._trgTolerance.reset() } func reset() { _trgTolerance.reset() } func wait(_ s1: String) -> Bool { //...
  15. fukurou

    port overlort python ->Swift assed edition!

    class AXContextCmd { var commands = UniqueItemSizeLimitedPriorityQueue(5) var contextCommands = UniqueItemSizeLimitedPriorityQueue(5) private var trgTolerance: Bool = false func engageCommand(_ s1: String) -> Bool { if s1.isEmpty { return false }...
  16. fukurou

    port overlort python ->Swift assed edition!

    class AXCmdBreaker { private var conjuration: String init(_ conjuration: String) { self.conjuration = conjuration } func extractCmdParam(_ s1: String) -> String { if s1.contains(conjuration) { return s1.replacingOccurrences(of: conjuration, with...
  17. fukurou

    port overlort python ->Swift assed edition!

    class TrgTolerance { private var _maxRepeats: Int private var _repeats: Int init(_ maxrepeats: Int) { self._maxRepeats = maxrepeats self._repeats = 0 } func setMaxRepeats(_ maxRepeats: Int) { self._maxRepeats = maxRepeats reset() }...
  18. fukurou

    port overlort python ->Swift assed edition!

    class AnnoyedQ { private var _q1: RefreshQ private var _q2: RefreshQ private var _stuffedQue: RefreshQ init(_ queLim: Int) { self._q1 = RefreshQ(queLim) self._q2 = RefreshQ(queLim) self._stuffedQue = RefreshQ(queLim) } func learn(_ ear: String) {...
  19. fukurou

    port overlort python ->Swift assed edition!

    class RefreshQ: UniqueItemSizeLimitedPriorityQueue { override init(_ limit: Int) { super.init(limit) } func removeItem(_ item: String) { if let index = queue.firstIndex(of: item) { queue.remove(at: index) } } override func insert(_ data...
  20. fukurou

    port overlort python ->Swift assed edition!

    class UniqueItemSizeLimitedPriorityQueue: UniqueItemsPriorityQue { private var _limit: Int init(_ limit: Int) { self._limit = limit super.init() } func getLimit() -> Int { return _limit } func setLimit(_ limit: Int) { self._limit = limit...
Top