From 74cff1433f7989959cc8b1421ac8fb26812d77a4 Mon Sep 17 00:00:00 2001 From: ray16897188 Date: Mon, 29 Jun 2015 19:38:02 +0800 Subject: [PATCH] patterns_19:37_06/29/2015 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了print函数的缩进格式 --- source/chapter3/07_Patterns.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/chapter3/07_Patterns.md b/source/chapter3/07_Patterns.md index 4e9e8660..6fd48bf8 100755 --- a/source/chapter3/07_Patterns.md +++ b/source/chapter3/07_Patterns.md @@ -75,7 +75,7 @@ let point = (3, 2) switch point { // Bind x and y to the elements of point. case let (x, y): -print("The point is at (\(x), \(y)).") + print("The point is at (\(x), \(y)).") } // prints "The point is at (3, 2).” ``` @@ -190,11 +190,11 @@ for case let number? in arrayOfOptinalInts { let point = (1, 2) switch point { case (0, 0): -print("(0, 0) is at the origin.") + print("(0, 0) is at the origin.") case (-2...2, -2...2): -print("(\(point.0), \(point.1)) is near the origin.") + print("(\(point.0), \(point.1)) is near the origin.") default: -print("The point is at (\(point.0), \(point.1)).") + print("The point is at (\(point.0), \(point.1)).") } // prints "(1, 2) is near the origin.” ``` @@ -208,11 +208,11 @@ return pattern == "\(value)" } switch point { case ("0", "0"): -print("(0, 0) is at the origin.") + print("(0, 0) is at the origin.") case ("-2...2", "-2...2"): -print("(\(point.0), \(point.1)) is near the origin.") + print("(\(point.0), \(point.1)) is near the origin.") default: -print("The point is at (\(point.0), \(point.1)).") + print("The point is at (\(point.0), \(point.1)).") } // prints "(1, 2) is near the origin.” ```