Skip to content

Instantly share code, notes, and snippets.

@ha1f
Last active July 11, 2018 15:05
Show Gist options
  • Save ha1f/7b9cff7b35cc7973af459af0c2293ae9 to your computer and use it in GitHub Desktop.
Save ha1f/7b9cff7b35cc7973af459af0c2293ae9 to your computer and use it in GitHub Desktop.
import Foundation
// import EthereumKit
// import Play
final class Lets {
private let nyanWallet = Wallet("💰")
private let nyan = Haruna("🐈")
func go(to place: String) {
nyan.move(to: place)
}
func to(get item: String) {
let waterMelon = 🍉(price: 1980, to: "0xf2A4f4e6302fbD5E1D312C341557c63247E039c8")
do {
try nyanWallet.buy(waterMelon)
} catch {
fatalError("🍉 is out of stock 😭")
}
}
func andHaveFun(at place: String) {
let subStrings = ["g", "n", "i", "m", "o", "c", "s", "i", "r", "e", "m", "m", "u", "s"]
var body: String = ""
for substring in subStrings.reversed() {
body = body + substring
}
print("Yay let's go to \(place) \(body)😎")
}
func isFakeRight🤔() -> Bool {
return true
}
}
// Hidden part
struct 🍉 {
let price: Int
let to: String
}
struct Wallet {
let rawValue: String
init(_ string: String) {
self.rawValue = string
}
func buy(_ item: 🍉) throws {
// FIXME
}
}
struct Haruna {
let rawValue: String
init(_ string: String) {
self.rawValue = string
}
func move(to place: String) {
// FIXME
}
}
// comments
//
// EthereumKitはこれ?
// https://github.com/D-Technologies/EthereumKit
// Walletのinitializerはあってないのでとりあえず放置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment