Skip to content

Instantly share code, notes, and snippets.

View iscrz's full-sized avatar

Isaac Ruiz iscrz

View GitHub Profile
@iscrz
iscrz / ravtower.md
Created September 11, 2021 03:56
RAV Tower

RAV Tower

Wizard Tower Guildlines

Zones

  • Library, graveyard and exile zones are shared zones. "Your" library or graveyard is your "opponents" library and vice-versa.

Setup

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:
extension Float {
static func rand48() -> Float {
return Float(Double.rand48())
}
static var tau: Float {
return .pi * 2
}
}
@iscrz
iscrz / CMDeviceMotion.swift
Last active July 26, 2017 18:49 — forked from travisnewby/CMDeviceMotion.swift
Determine the direction of "gaze" of the device in any orientation. (Swift 3.2)
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 {
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
}
@iscrz
iscrz / Array+Wrap.swift
Created December 12, 2016 00:53
Swift 3 Array Wrap
extension Array {
subscript (wrap index: Int) -> Element {
return self[index - Int(floor(Double(index) / Double(count))) * count]
}
}