diff --git a/Turtle.playground/Sources/Secret Turtle Stuff/TurtleView.swift b/Turtle.playground/Sources/Secret Turtle Stuff/TurtleView.swift index 9414da9..92081aa 100644 --- a/Turtle.playground/Sources/Secret Turtle Stuff/TurtleView.swift +++ b/Turtle.playground/Sources/Secret Turtle Stuff/TurtleView.swift @@ -13,7 +13,7 @@ public class TurtleView: UIView { self.backgroundColor = backgroundColor addSubview(avatarView) } - required public init(coder aDecoder: NSCoder) { + required public init?(coder aDecoder: NSCoder) { super.init(coder:aDecoder) } diff --git a/Turtle.playground/Sources/Your Turtle Routines/UserFunctions.swift b/Turtle.playground/Sources/Your Turtle Routines/UserFunctions.swift index eac0409..59b6693 100644 --- a/Turtle.playground/Sources/Your Turtle Routines/UserFunctions.swift +++ b/Turtle.playground/Sources/Your Turtle Routines/UserFunctions.swift @@ -2,4 +2,11 @@ import Foundation -// put your functions here \ No newline at end of file +// put your functions here + +public func hexagon(length: Int) { + for _ in 1 ... 6 { + forward(length) + right(60) + } +} \ No newline at end of file diff --git a/Turtle.playground/Sources/Your Turtle Routines/WhichTurtle.swift b/Turtle.playground/Sources/Your Turtle Routines/WhichTurtle.swift index 4cb9d41..7e6c4b0 100644 --- a/Turtle.playground/Sources/Your Turtle Routines/WhichTurtle.swift +++ b/Turtle.playground/Sources/Your Turtle Routines/WhichTurtle.swift @@ -1 +1 @@ -public var turtle = Turtle() +public var turtle = Turtle(turtleType: TurtleType.ColorsOnWhite) diff --git a/Turtle.playground/contents.swift b/Turtle.playground/contents.swift index 2e0b384..ae2b26d 100644 --- a/Turtle.playground/contents.swift +++ b/Turtle.playground/contents.swift @@ -1 +1,10 @@ -turtle +//for i in 1 ... 30 { +// hexagon(120) +// nextColor() +// right(12) +//} + +forward() +forward() + +turtle \ No newline at end of file