回答編集履歴

2

後半修正

2020/07/07 14:15

投稿

fuzzball
fuzzball

スコア16733

test CHANGED
@@ -44,17 +44,19 @@
44
44
 
45
45
  struct Food {
46
46
 
47
- private let values: [String]
47
+ var group, foodNumber, listNumber, tagnames: String
48
48
 
49
- init(_ values: [String]) { self.values = values }
49
+ init(_ values: [String]) {
50
50
 
51
- var group: String { values[0] }
51
+ group = values[0]
52
52
 
53
- var foodNumber: String { values[1] }
53
+ foodNumber = values[1]
54
54
 
55
- var listNumber: String { values[2] }
55
+ listNumber = values[2]
56
56
 
57
- var tagnames: String { values[3] }
57
+ tagnames = values[3]
58
+
59
+ }
58
60
 
59
61
  }
60
62
 

1

let

2020/07/07 14:15

投稿

fuzzball
fuzzball

スコア16733

test CHANGED
@@ -44,7 +44,7 @@
44
44
 
45
45
  struct Food {
46
46
 
47
- private var values: [String]
47
+ private let values: [String]
48
48
 
49
49
  init(_ values: [String]) { self.values = values }
50
50