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
// | |
// main.swift | |
// PokerTest | |
// | |
// Created by Reza Shirazian on 11/8/19. | |
// Copyright © 2019 Reza Shirazian. All rights reserved. | |
// | |
import Foundation |
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
public struct TestStruct { | |
var name: String | |
var lastName: String | |
} | |
let structTest = TestStruct(name: "Foo", lastName: "Bar") | |
print(structTest.name + " " + structTest.lastName) |
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
//Sequence of positive even numbers | |
struct Even: SequenceType { | |
func generate() -> AnyGenerator<Int> { | |
var _first = 0 | |
return AnyGenerator<Int> { | |
_first += 2 | |
return _first | |
} | |
} |