Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
初めてのターミナルプログラム
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Elvis Shi
March 09, 2018
Programming
2.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
初めてのターミナルプログラム
Elvis Shi
March 09, 2018
More Decks by Elvis Shi
See All by Elvis Shi
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
520
ゼロから始めるPreferenceの実装 / Let's implement Preferences from scratch
lovee
0
160
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
400
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
760
How did I build an Open-Source SwiftUI Toast Library
lovee
1
180
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
1.3k
SwiftUIで二重スクロール作ってみた / When I tried to make a dual-scroll-ish view in SwiftUI
lovee
1
390
Observation のあれこれ / A brief introduction about Observation
lovee
3
450
Other Decks in Programming
See All in Programming
「人を評価する AI」の設計と実装
ryoyanara
0
240
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
330
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
150
初めての模倣学習とVLA
natsutan
0
240
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
110
MySQLとPostgreSQLって何が違うの?
akagami
0
140
源内ハンズオン概要編
hideg
0
210
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
150
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
160
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
270
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
610
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
710
Crafting Experiences
bethany
1
260
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
The Curious Case for Waylosing
cassininazir
1
480
GraphQLとの向き合い方2022年版
quramy
50
15k
Building Adaptive Systems
keathley
44
3.2k
Ruling the World: When Life Gets Gamed
codingconduct
0
310
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
500
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Product Roadmaps are Hard
iamctodd
55
12k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
660
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Transcript
ॳΊͯͷ λʔϛφϧϓϩάϥϜ forUSZ4XJGU5PLZP"GUFSUBMLT
var employedBy = "YUMEMI Inc." var job = "iOS Developer"
var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ ΏΔΏΔΩϟϯϓ͘͘ձɺࢀՃऀืूத """ class Me: Developable, Talkable { }
༷ʑͳλʔϛφϧϓϩάϥϜ ▸ QJOH ▸ CSFX ▸ HJU ▸ LVSJ ▸
IBOBLP ▸ FSVUBTP 1kuri: https://github.com/bannzai/Kuri 2hanako: https://github.com/el-hoshino/hanako 3erutaso: https://github.com/sgymtic/sl
ࣗ࡞Ζ͏
·ͣੈքʹ ѫࡰ͠Α͏
9DPEF ʷ 4XJGU
None
import Foundation print("Hello, World!")
import Foundation print("Hello, World!")
import Foundation print("Hello, World!")
$ cd {path/to/project/dir} $ xcodebuild $ cp build/Release/{app_name} /usr/local/bin $
{app_name} hello, world! 今回は簡単なプログラムなので Xcode 使わずに `swiftc` で ビルドしてもいいけど まあいいや
Ͷɺ؆୯Ͱ ͠ΐʁ
$ cd {path/to/project/dir} $ xcodebuild $ cp build/Release/{app_name} /usr/local/bin $
{app_name} hello, world! コマンド引数って どうやって取るんだろ
import Foundation CommandLine.arguments: [String]
None
import Foundation let candidates = Array(CommandLine.arguments.dropFirst()) var outputs: [String] =
[] output: while let random = candidates.random { print(random) outputs.append(random) outputs.keepLast(candidates.count) if outputs == candidates { print(outputs.joined(separator: " ") .appending("!")) break output } }
import Foundation extension Array { var random: Element? { guard
self.isEmpty == false else { return nil } let randomIndex = arc4random_uniform(UInt32(self.count)) return self[Int(randomIndex)] } mutating func keepLast(_ n: Int = 1) { guard self.count > n else { return } let removingElementsCount = self.count - n self.removeFirst(removingElementsCount) } }
%&.0