This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import FoundationModels | |
struct ContentView: View { | |
@State private var name:String = "クラフトワーク" | |
@State private var birthday:String = "1976-03-09" | |
@State private var bloodType:String = "A" | |
@State var respondContent: String = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import SwiftData | |
@main | |
struct SwiftDataTest2App: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
.modelContainer(for:[Model.self]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
enum Stone:String{ | |
case black,white,none | |
static var colored:Set<Self> = [.black,.white] | |
func opposite()->Stone{ | |
switch self{ | |
case .black: | |
return .white | |
case .white: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
「任意の自然数の各桁を、一桁になるまで掛け算する回数の最大回数とその数を示せ。」 | |
例:77 | |
7*7 = 49 | |
4*9 = 36 | |
3*6 = 18 | |
1*8 = 8 | |
答え:4回 | |
*/ | |
import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
「任意の自然数の各桁を、一桁になるまで掛け算する回数の最大回数とその数を示せ。」 | |
例:77 | |
7*7 = 49 | |
4*9 = 36 | |
3*6 = 18 | |
1*8 = 8 | |
答え:4回 | |
*/ | |
//自分の練習も兼ねているので見にくいかもです。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
「任意の自然数の各桁を、一桁になるまで掛け算する回数の最大回数とその数を示せ。」 | |
例:77 | |
7*7 = 49 | |
4*9 = 36 | |
3*6 = 18 | |
1*8 = 8 | |
答え:4回 | |
*/ | |
//自分の練習も兼ねているので見にくいかもです。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
class Balls:ObservableObject{ | |
@Published var x:[CGFloat] // X座標 | |
@Published var y:[CGFloat] // Y座標 | |
@Published var g:[CGFloat] // 加速度 | |
@Published var r:[CGFloat] // 半径 | |
@Published var v:[CGFloat] // 速度 | |
var c:Int = 150 // 円の数 | |
init(){ |