mirror of
https://git.tonybark.com/tonytins/swiftlyfox.git
synced 2026-02-10 16:24:48 -05:00
Initial source commit 🎉
This commit is contained in:
commit
8f83d25989
8 changed files with 114 additions and 0 deletions
28
.gitignore
vendored
Normal file
28
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
### SwiftPM ##
|
||||||
|
.DS_Store
|
||||||
|
/.build
|
||||||
|
/Packages
|
||||||
|
xcuserdata/
|
||||||
|
DerivedData/
|
||||||
|
.swiftpm/configuration/registries.json
|
||||||
|
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||||
|
.netrc
|
||||||
|
|
||||||
|
### VisualStudioCode ###
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
|
### VisualStudioCode Patch ###
|
||||||
|
# Ignore all local history of files
|
||||||
|
.history
|
||||||
|
.ionide
|
||||||
22
LICENSE
Normal file
22
LICENSE
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
|
||||||
|
this software, either in source code form or as a compiled binary, for any
|
||||||
|
purpose, commercial or non-commercial, and by any means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||||
|
software dedicate any and all copyright interest in the software to the public
|
||||||
|
domain. We make this dedication for the benefit of the public at large and
|
||||||
|
to the detriment of our heirs and
|
||||||
|
|
||||||
|
successors. We intend this dedication to be an overt act of relinquishment
|
||||||
|
in perpetuity of all present and future rights to this software under copyright
|
||||||
|
law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||||
|
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||||
|
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
|
||||||
|
please refer to <https://unlicense.org/>
|
||||||
15
Package.swift
Normal file
15
Package.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// swift-tools-version: 6.2
|
||||||
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "swiftyfox",
|
||||||
|
targets: [
|
||||||
|
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
||||||
|
// Targets can depend on other targets in this package and products from dependencies.
|
||||||
|
.executableTarget(
|
||||||
|
name: "swiftyfox"
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
7
README.md
Normal file
7
README.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# SwiftlyFox
|
||||||
|
|
||||||
|
SwiftlyFox is a simple sandbox project for continuously learning Swift. While this also includes Swift Playgrounds from which this was originally derived from, I hope to move that all to the [Playgrounds macro](https://youtu.be/3wzUNua-JKg&t=288) coming to other platforms.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
I hereby waive this project under the public domain - see [LICENSE](LICENSE) for details.
|
||||||
11
Sources/swiftyfox/swiftyfox.swift
Normal file
11
Sources/swiftyfox/swiftyfox.swift
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
// The Swift Programming Language
|
||||||
|
// https://docs.swift.org/swift-book
|
||||||
|
|
||||||
|
@main
|
||||||
|
struct swiftyfox {
|
||||||
|
static func main() {
|
||||||
|
print("Hello, world!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
22
SwiftyFox.playground/Contents.swift
Normal file
22
SwiftyFox.playground/Contents.swift
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
let interestingNumbers = [
|
||||||
|
"Prime": [2, 3, 5, 7, 11, 13],
|
||||||
|
"Fibonacci": [1, 1, 2, 3, 5, 8],
|
||||||
|
"Square": [1, 4, 9, 16, 25],
|
||||||
|
];
|
||||||
|
|
||||||
|
var largest = 0
|
||||||
|
|
||||||
|
for (_, numbers) in interestingNumbers {
|
||||||
|
for number in numbers {
|
||||||
|
if number > largest {
|
||||||
|
largest = number // 25
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var total = 0
|
||||||
|
for i in 0..<4 {
|
||||||
|
total += i // 6
|
||||||
|
}
|
||||||
2
SwiftyFox.playground/contents.xcplayground
Normal file
2
SwiftyFox.playground/contents.xcplayground
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<playground version='7.0' target-platform='macos' swift-version='6' buildActiveScheme='true' executeOnSourceChanges='true' importAppTypes='true'/>
|
||||||
7
SwiftyFox.playground/playground.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
SwiftyFox.playground/playground.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue