READY/IN DEVELOPMENT/HOLD
YES | NO
A few sentences describing the overall goals of the pull request's commits.
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
func partition(v: Int[], left: Int, right: Int) -> Int { | |
var i = left | |
for j in (left + 1)..(right + 1) { | |
if v[j] < v[left] { | |
i += 1 | |
(v[i], v[j]) = (v[j], v[i]) | |
} | |
} |
enum ComparisonOrdering: Int { | |
case Ascending = 1 | |
case Descending = -1 | |
case Same = 0 | |
} | |
infix operator <=> { precedence 130 } | |
protocol CombinedComparable: Comparable, Equatable { | |
func <=>(lhs: Self, rhs: Self) -> ComparisonOrdering | |
} |
// An Example of a bubble sort algorithm in Swift | |
// | |
// Essentialy this algorithm will loop through the values up to | |
// the index where we last did a sort (everything above is already in order/sorted) | |
// comparing a one value to the value before it. If the value before it is higher, | |
// swap them, and note the highest swap index. On the next iteration of the loop we | |
// only need to go as high as the previous swap. | |
import Foundation |
let spriteKitScene = SKScene(size: CGSize(width: 1276.0 / 2.0, height: 712.0 / 2.0)) | |
var videoSpriteKitNode:SKVideoNode? | |
let videoNode = SCNNode() | |
videoNode.geometry = SCNPlane(width: videoNodeWidth, height: videoNodeHeight) | |
// using SpriteKit scene with videonode inside | |
// | |
spriteKitScene.scaleMode = .AspectFit | |
///Returns the input value clamped to the lower and upper limits. | |
func clamp<T: Comparable>(value: T, lower: T, upper: T) -> T { | |
return min(max(value, lower), upper) | |
} | |
//----------------------------------------------- | |
// Example usage | |
let proposedIndex = 6 |
import SpriteKit | |
class GameScene: SKScene { | |
private var mainCircle: SKSpriteNode! | |
override func didMoveToView(view: SKView) { | |
physicsBody = SKPhysicsBody(edgeLoopFromRect: self.frame) | |
import Cocoa | |
enum CoroutineState { | |
case Fresh, Running, Blocked, Canceled, Done | |
} | |
struct CoroutineCancellation: ErrorType {} | |
class CoroutineImpl<InputType, YieldType> { | |
let body: (yield: YieldType throws -> InputType) throws -> Void |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.