Skip to content

Instantly share code, notes, and snippets.

View cslowik's full-sized avatar

Chris Slowik cslowik

View GitHub Profile
@cslowik
cslowik / dubstep.swift
Created January 28, 2016 18:44
Bloc Weekly Code Puzzle - Dubstep
import Foundation
func songDecoder(remix: String) -> String {
return remix.stringByReplacingOccurrencesOfString("WUB", withString: " ").componentsSeparatedByCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).filter({!$0.isEmpty}).joinWithSeparator(" ")
}
print(songDecoder("WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB"))
@cslowik
cslowik / dreidelgame.swift
Created December 16, 2015 16:30
Bloc Weekly Code Puzzle - Dreidel Dreidel (12/14/15)
// 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