Skip to content

Instantly share code, notes, and snippets.

View kingreza's full-sized avatar
👋

Reza Shirazian kingreza

👋
View GitHub Profile
@kingreza
kingreza / PokerEngine.swift
Last active May 26, 2020 17:21
A simple poker engine that deals cards and detects various hands.
//
// main.swift
// PokerTest
//
// Created by Reza Shirazian on 11/8/19.
// Copyright © 2019 Reza Shirazian. All rights reserved.
//
import Foundation
@kingreza
kingreza / playground.swift
Created September 19, 2016 22:58
struct and class in Swift
public struct TestStruct {
var name: String
var lastName: String
}
let structTest = TestStruct(name: "Foo", lastName: "Bar")
print(structTest.name + " " + structTest.lastName)
@kingreza
kingreza / Sequences.swift
Last active July 4, 2016 22:33
SequenceType in Swift: Even numbers, Powers of two, Fibonacci and Prime numbers
//Sequence of positive even numbers
struct Even: SequenceType {
func generate() -> AnyGenerator<Int> {
var _first = 0
return AnyGenerator<Int> {
_first += 2
return _first
}
}