Skip to content

Instantly share code, notes, and snippets.

@tkgshn
Last active September 30, 2020 09:58
Show Gist options
  • Save tkgshn/09ab9afe2409e47cf7c5799d75e8c827 to your computer and use it in GitHub Desktop.
Save tkgshn/09ab9afe2409e47cf7c5799d75e8c827 to your computer and use it in GitHub Desktop.
// MARK: - やりたいこと
//japanese(日本語)を3つほどランダムで表示する
// MARK: - Code
////フレーズという辞書を定義する
let phrases = [
["japanese": "私", "english": "I", "phraseAudioName" : "人称"],
["japanese": "私とあなた", "english": "I and You", "phraseAudioName" : "国と言語"],
["japanese": "私たち", "english": "both of us", "phraseAudioName" : "人称"],
["japanese": "彼", "english": "he", "phraseAudioName" : "国と言語"],
["japanese": "彼と彼女", "english": "he and she", "phraseAudioName" : "人称"],
["japanese": "彼ら", "english": "they both", "phraseAudioName" : "国と言語"],
]
// まずは全ての数字を出す
let phrases_count = phrases.count
// 最初から最後までループさせる
for n in 0..<phrases_count {
print(phrases[n]["japanese"]!)
}
@tkgshn
Copy link
Author

tkgshn commented Sep 30, 2020

とりあえず公開

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment