Skip to content

Commit 895af6b

Browse files
committed
Fixes for Swift 3 final version (Xcode 8)
1 parent 290bb3d commit 895af6b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Sources/Backtrack.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public func backtrackingSearch<V, D>(csp: CSP<V, D>, assignment: Dictionary<V, D
6262

6363
if (result != False) return result; */
6464
} else {
65-
if let result = backtrackingSearch(csp: csp, assignment: localAssignment, mrv: mrv, mac3: mac3, lcv: lcv) {
65+
if let result = backtrackingSearch(csp: csp, assignment: localAssignment, mrv: mrv, lcv: lcv, mac3: mac3) {
6666
return result
6767
}
6868
}

SwiftCSP/.DS_Store

0 Bytes
Binary file not shown.

SwiftCSP/SwiftCSP/CircuitBoard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Cocoa
2929
class CircuitBoard: NSObject { //get hashable for free and dynamic access
3030
var height: Int = 1
3131
var width: Int = 1
32-
var color: NSColor = NSColor.red()
32+
var color: NSColor = NSColor.red
3333
var location: (Int, Int)?
3434

3535
//generate the domain as a list of tuples of bottom left corners

SwiftCSP/SwiftCSP/LayoutView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class LayoutView: NSView {
5858
bPath.line(to: NSMakePoint(CGFloat(width), CGFloat((height/boxDimension) * i)))
5959
}
6060

61-
NSColor.black().set()
61+
NSColor.black.set()
6262
bPath.stroke()
6363

6464
}

SwiftCSP/SwiftCSPTests/SendMoreMoneyTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class SendMoreMoneyConstraint: ListConstraint <String, Int> {
4242

4343
// if all variables have been assigned, check if it adds up correctly
4444
if assignment.count == variables.count {
45-
if let s = assignment["S"], e = assignment["E"], n = assignment["N"], d = assignment["D"], m = assignment["M"], o = assignment["O"], r = assignment["R"], y = assignment["Y"] {
45+
if let s = assignment["S"], let e = assignment["E"], let n = assignment["N"], let d = assignment["D"], let m = assignment["M"], let o = assignment["O"], let r = assignment["R"], let y = assignment["Y"] {
4646
let send: Int = s * 1000 + e * 100 + n * 10 + d
4747
let more: Int = m * 1000 + o * 100 + r * 10 + e
4848
let money: Int = m * 10000 + o * 1000 + n * 100 + e * 10 + y
@@ -92,7 +92,7 @@ class SendMoreMoneyTest: XCTestCase {
9292
if let solution = backtrackingSearch(csp: cs, mrv: true) {
9393
print(solution, terminator: "")
9494

95-
if let s = solution["S"], e = solution["E"], n = solution["N"], d = solution["D"], m = solution["M"], o = solution["O"], r = solution["R"], y = solution["Y"] {
95+
if let s = solution["S"], let e = solution["E"], let n = solution["N"], let d = solution["D"], let m = solution["M"], let o = solution["O"], let r = solution["R"], let y = solution["Y"] {
9696
let send: Int = s * 1000 + e * 100 + n * 10 + d
9797
let more: Int = m * 1000 + o * 100 + r * 10 + e
9898
let money: Int = m * 10000 + o * 1000 + n * 100 + e * 10 + y

0 commit comments

Comments
 (0)