Last active
March 15, 2021 02:39
-
-
Save jasdev/a2d84f06c43fd8892f0faa2815952b34 to your computer and use it in GitHub Desktop.
8×8 Party Parrot wave square in Swift (that avoids intermediary copies). h/t @khanlou
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Algorithms | |
let parrotEmojis = (1...8).map { ":wave\($0)parrot:" } | |
parrotEmojis.indices | |
.map { | |
parrotEmojis | |
.cycled() | |
.dropFirst($0) | |
.prefix(parrotEmojis.count) | |
.joined() | |
} | |
.joined(separator: "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment