Sha256: 559b3eb311b564a675f43abe7d5cd4116de1a4e6814ba936721d8ec35535afeb
Contents?: true
Size: 538 Bytes
Versions: 44
Compression:
Stored size: 538 Bytes
Contents
import Foundation extension Array where Element == String { func recite() -> String { var saying = "" if let firstPiece = self.first { for (position, piece) in self.enumerated() { if position != self.count - 1 { let nextPiece = self[position + 1] saying.append("For want of a \(piece) the \(nextPiece) was lost.\n") } else { saying.append("And all for the want of a \(firstPiece).") } } } return saying } }
Version data entries
44 entries across 44 versions & 1 rubygems