File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
- // swift-tools-version:5.3
1
+ // swift-tools-version:5.5
2
2
// The swift-tools-version declares the minimum version of Swift required to build this package.
3
3
4
4
/*
@@ -30,7 +30,7 @@ let package = Package(
30
30
targets: [
31
31
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
32
32
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
33
- . target (
33
+ . executableTarget (
34
34
name: " dealer " ,
35
35
dependencies: [
36
36
. product( name: " DeckOfPlayingCards " ,
Original file line number Diff line number Diff line change 10
10
11
11
#if os(Linux)
12
12
import Glibc
13
- srandom ( UInt32 ( clock ( ) ) )
14
13
#endif
15
14
16
15
import Foundation
@@ -20,6 +19,7 @@ import ArgumentParser
20
19
var stdout = FileHandle . standardOutput
21
20
var stderr = FileHandle . standardError
22
21
22
+ @main
23
23
struct Deal : ParsableCommand {
24
24
static var configuration = CommandConfiguration (
25
25
abstract: " Shuffles a deck of playing cards and deals a number of cards. " ,
@@ -32,6 +32,10 @@ struct Deal: ParsableCommand {
32
32
var count : UInt = 10
33
33
34
34
mutating func run( ) throws {
35
+ #if os(Linux)
36
+ srandom ( UInt32 ( clock ( ) ) )
37
+ #endif
38
+
35
39
var deck = Deck . standard52CardDeck ( )
36
40
deck. shuffle ( )
37
41
@@ -45,5 +49,3 @@ struct Deal: ParsableCommand {
45
49
}
46
50
}
47
51
}
48
-
49
- Deal . main ( )
You can’t perform that action at this time.
0 commit comments