Lily Playground Books
概要
Lily Playgroundは、iPadとMacで利用できるSwiftプログラミング入門Bookです。 プログラミングにはじめて触れる方や、CGプログラミングに興味のある方に向けて、図形や絵を描くことを通じ、 Swiftプログラミングの楽しさに触れてもらえるよう工夫しています。進めていくと以下のような模様や効果を表現できるようになります。



動作環境
Swift Playgrounds App 4.4以降が動作するデバイス
- iPad - iPadOS 16.0以降
- Mac - macOS 13.0(ventura)以降
コードと結果のサンプル
次のような1行のコードで、すぐに図形を描くことができます。
func design( screen:PGScreen ) {
PGRectangle()
}
>

色についてコードを1つ増やせば、色を変えられます。大きさや位置の変更も、同じように簡単です。
func design( screen:PGScreen ) {
PGRectangle()
.color( .red )
}
>

Bookを進めていくと、豊かな表現ができるようになります。
func design( screen:PGScreen ) {
for _ in 0 ..< 100 {
PGRectangle()
.color( .random )
.position( screen.randomPoint )
.scale( square: (100.0).randomize )
.angle( .random )
.alpha( .random )
}
}
>

導入
ご利用になる環境を選んでください。
Booksのテキスト紹介
当社運営の情報サイト「Terminus」で、Booksのテキストをご覧になれます。