當前位置:
首頁 >
Swift Playgrounds Learn to Code 2 final project Pyramid
發布時間:2025/3/20
30
豆豆
生活随笔
收集整理的這篇文章主要介紹了
Swift Playgrounds Learn to Code 2 final project Pyramid
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Swift Playgrounds 基于笛卡爾坐標的立體金字塔
The most difficult thing in life is to?know yourself.?
- Thales
var coords: [Int] = [] var increse = 9 for i in 1 ... 4 {for j in i ... i + increse {coords.append(j)}let insideSquare = world.coordinates(inColumns: coords, intersectingRows: coords)for coordinate in insideSquare {for i in 1 ... 2 {world.place(Block(), at: coordinate)}}increse -= 2coords.removeAll() } let squareLock = PlatformLock(color: .green) coords = [5, 6] let insideSquare = world.coordinates(inColumns: coords, intersectingRows: coords) for coordinate in insideSquare {world.place(Platform(onLevel: 6, controlledBy: squareLock), at: coordinate)world.place(Block(), at: coordinate) }world.place(Character(name: .blu), facing: .north, at: Coordinate(column: 6, row: 6))?
?
總結
以上是生活随笔為你收集整理的Swift Playgrounds Learn to Code 2 final project Pyramid的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 简易计算器 (C语言)作业
- 下一篇: 希望今年能看懂和写出这样的Swift代码