- Library, graveyard and exile zones are shared zones. "Your" library or graveyard is your "opponents" library and vice-versa.
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
Briscola Rules | |
Setup: | |
• Deck size | |
- 2, 4, or 5 players: Play all 40 cards | |
- 3 or 6 players: Remove all 2's (36 Cards) | |
• Dealer deals 3 cards to each player. | |
• The top card on the deck is placed face up on the bottom of the deck. This card's suit is the trump suit (see below) | |
Play: |
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
extension Float { | |
static func rand48() -> Float { | |
return Float(Double.rand48()) | |
} | |
static var tau: Float { | |
return .pi * 2 | |
} | |
} |
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
extension CMDeviceMotion { | |
func gaze(atOrientation orientation: UIInterfaceOrientation) -> SCNVector4 { | |
let attitude = self.attitude.quaternion | |
let aq = GLKQuaternionMake(Float(attitude.x), Float(attitude.y), Float(attitude.z), Float(attitude.w)) | |
let final: SCNVector4 | |
switch UIApplication.shared.statusBarOrientation { |
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
extension Array where Element : Comparable { | |
func sorted(after element: Element) -> [Element] { | |
return self.sorted { (a, b) -> Bool in | |
if a >= element && b < element { | |
return a > b | |
} | |
return a < b | |
} |
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
extension Array { | |
subscript (wrap index: Int) -> Element { | |
return self[index - Int(floor(Double(index) / Double(count))) * count] | |
} | |
} |