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 Foundation | |
func songDecoder(remix: String) -> String { | |
return remix.stringByReplacingOccurrencesOfString("WUB", withString: " ").componentsSeparatedByCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).filter({!$0.isEmpty}).joinWithSeparator(" ") | |
} | |
print(songDecoder("WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB")) |
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
// DREIDEL | |
// Chris Slowik | |
// 12/15/15 | |
// | |
// (0) Nun - nothing happens | |
// (1) Gimel - you take the pot! | |
// (2) Hei - you take half the pot | |
// (3) Shin - you put a piece into the pot | |
// | |
// Create a function that given an array of dreidel rolls ordered |