Skip to content

Commit 393d647

Browse files
committed
Porting to Swift Playgrounds v3.3
1 parent e698d3e commit 393d647

File tree

145 files changed

+6259
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+6259
-196
lines changed

PlaygroundBook.xcodeproj/project.pbxproj renamed to ArtOfAscii.xcodeproj/project.pbxproj

Lines changed: 441 additions & 46 deletions
Large diffs are not rendered by default.

ArtOfAscii.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1110"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "5EF2F9AA2054BBF300191409"
18+
BuildableName = "libBookCore.a"
19+
BlueprintName = "BookCore"
20+
ReferencedContainer = "container:ArtOfAscii.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
</LaunchAction>
44+
<ProfileAction
45+
buildConfiguration = "Release"
46+
shouldUseLaunchSchemeArgsEnv = "YES"
47+
savedToolIdentifier = ""
48+
useCustomWorkingDirectory = "NO"
49+
debugDocumentVersioning = "YES">
50+
<MacroExpansion>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "5EF2F9AA2054BBF300191409"
54+
BuildableName = "libBookCore.a"
55+
BlueprintName = "BookCore"
56+
ReferencedContainer = "container:ArtOfAscii.xcodeproj">
57+
</BuildableReference>
58+
</MacroExpansion>
59+
</ProfileAction>
60+
<AnalyzeAction
61+
buildConfiguration = "Debug">
62+
</AnalyzeAction>
63+
<ArchiveAction
64+
buildConfiguration = "Release"
65+
revealArchiveInOrganizer = "YES">
66+
</ArchiveAction>
67+
</Scheme>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1110"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "5EA2E3BC2056F35A00416A35"
18+
BuildableName = "LiveViewTestApp.app"
19+
BlueprintName = "LiveViewTestApp"
20+
ReferencedContainer = "container:ArtOfAscii.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "5EA2E3BC2056F35A00416A35"
48+
BuildableName = "LiveViewTestApp.app"
49+
BlueprintName = "LiveViewTestApp"
50+
ReferencedContainer = "container:ArtOfAscii.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "5EA2E3BC2056F35A00416A35"
65+
BuildableName = "LiveViewTestApp.app"
66+
BlueprintName = "LiveViewTestApp"
67+
ReferencedContainer = "container:ArtOfAscii.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Name</key>
6+
<string>Art of ASCII</string>
7+
<key>Pages</key>
8+
<array>
9+
<string>00-Welcome.cutscenepage</string>
10+
<string>01-Introduction.playgroundpage</string>
11+
<string>02-HowImagesComposed.playgroundpage</string>
12+
<string>03-GrayscaleHistogramEqualization.playgroundpage</string>
13+
<string>04-Asciification.playgroundpage</string>
14+
</array>
15+
</dict>
16+
</plist>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Name</key>
6+
<string>🙋‍♀️ Welcome</string>
7+
<key>CutsceneReference</key>
8+
<string>index.html</string>
9+
</dict>
10+
</plist>

ArtOfAscii/Chapters/01-ArtOfAscii.playgroundchapter/Pages/00-Welcome.cutscenepage/PrivateResources/assets/jquery-3.4.1.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Welcome</title>
7+
<style>
8+
* {
9+
padding: 0;
10+
margin: 0;
11+
}
12+
.background {
13+
width: 100%;
14+
height: 100vh;
15+
background: url("./assets/background-v2.png");
16+
display: flex;
17+
justify-content: center;
18+
align-items: center;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<div class="background">
24+
<img
25+
src="./assets/logo.png"
26+
alt="Art of ASCII"
27+
class="logo"
28+
hidden="true"
29+
/>
30+
</div>
31+
<script src="./assets/jquery-3.4.1.min.js"></script>
32+
<script>
33+
$(function() {
34+
$(".logo")
35+
.delay(600)
36+
.fadeIn(1500);
37+
});
38+
</script>
39+
</body>
40+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright © 2020 Bunny Wong
3+
// Created on 2019/12/19.
4+
//
5+
6+
import UIKit
7+
import PlaygroundSupport
8+
import BookCore
9+
10+
PlaygroundPage.current.liveView = instantiateLiveView(identifier: .introduction)

PlaygroundBook/Chapters/Chapter1.playgroundchapter/Pages/PlaygroundPage.playgroundpage/Manifest.plist renamed to ArtOfAscii/Chapters/01-ArtOfAscii.playgroundchapter/Pages/01-Introduction.playgroundpage/Manifest.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>Name</key>
6-
<string>ChapterOnePageOneName</string>
6+
<string>📚 Introduction</string>
77
<key>LiveViewEdgeToEdge</key>
88
<true/>
99
<key>LiveViewMode</key>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//#-hidden-code
2+
//
3+
// Copyright © 2020 Bunny Wong
4+
// Created on 2019/12/18.
5+
//
6+
7+
import UIKit
8+
import PlaygroundSupport
9+
10+
PlaygroundPage.current.needsIndefiniteExecution = true
11+
12+
let assessmentHelper = AssessmentHelper()
13+
assessmentHelper.assessmentShowOnce({ true }, pass: nil)
14+
15+
//#-end-hidden-code
16+
/*:
17+
# Art of ASCII — Introduction to Digital Image Processing
18+
19+
## What is an ASCII Art?
20+
21+
**ASCII (American Standard Code for Information Interchange)** is a standard for electronic communication, which
22+
contains 128 characters.
23+
24+
**ASCII arts** are artworks created with ASCII characters, which can be seen in many places where only textual data can
25+
be transmitted, for example, within a terminal.
26+
27+
* Experiment:
28+
Head to the panel beside, and *tap the **run** button*, have fun experiencing the ASCII effects I've created.
29+
30+
## What We'll Learn by Generating ASCII Arts?
31+
32+
Examining how to generate ASCII Arts is a great way to explore the world of image processing. You'll be introduced with
33+
**the RGB color model**, **histograms and equalization techniques** with piratical experiments, which can be a fun and
34+
delightful.
35+
36+
[Let's get started! 🏃‍♂️](@next)
37+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright © 2020 Bunny Wong
3+
// Created on 2019/12/19.
4+
//
5+
6+
import UIKit
7+
import PlaygroundSupport
8+
import BookCore
9+
10+
PlaygroundPage.current.liveView = instantiateLiveView(identifier: .howImagesComposed)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Name</key>
6+
<string>🏞 How Images Composed</string>
7+
<key>LiveViewEdgeToEdge</key>
8+
<true/>
9+
<key>LiveViewMode</key>
10+
<string>VisibleByDefault</string>
11+
</dict>
12+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If you're not familiar with *linear algebra*, the following figure explains how this **transform matrix** works.
2+
3+
![How Transform Matrix Works](transform-matrix.jpg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Hints</key>
6+
<array>
7+
<dict>
8+
<key>FileReference</key>
9+
<string>Hint.md</string>
10+
</dict>
11+
</array>
12+
</dict>
13+
</plist>

0 commit comments

Comments
 (0)