Skip to content

Instantly share code, notes, and snippets.

@ProfFan
Created March 30, 2021 23:56
Show Gist options
  • Save ProfFan/3758bb671a6f3a423a57c284165cf3b5 to your computer and use it in GitHub Desktop.
Save ProfFan/3758bb671a6f3a423a57c284165cf3b5 to your computer and use it in GitHub Desktop.
swift.swift
let πŸ‰‘ = true;
class 🀣 {
let πŸ’¦: Int;
init() {
self.πŸ’¦ = 1;
}
init(_ πŸ’¦: Int) {
self.πŸ’¦ = πŸ’¦
}
}
extension 🀣: CustomDebugStringConvertible {
var debugDescription: String {
return String(repeating: "🀣 ", count: self.πŸ’¦)
}
}
infix operator ✊: MultiplicationPrecedence
extension 🀣 {
static func ✊ (_ lhs: 🀣, _ rhs: 🀣) -> 🀣 {
return 🀣(lhs.πŸ’¦ + rhs.πŸ’¦)
}
}
let 😹 = 🀣()
print("!πŸ‰‘ = \(!πŸ‰‘)")
print("\(😹 ✊ 😹 ✊ 😹 ✊ 😹 ✊ 😹)")
// Result:
// !πŸ‰‘ = false
// 🀣 🀣 🀣 🀣 🀣
@djryanash
Copy link

Love it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment