Menu app Lesson 5 Challnge

Has anyone done the challenge I want some explanation, please.
This is the text:

Challenge

Build a UI with a List and a Button below it.

Declare a property that contains an array of 5 strings. These can be any 5 words you want. (I did)

Each time the button is tapped, choose a random word from the array and put it in the list. (I programmed the button, but I couldn’t make it to choose from the array.

The number of items in the list should grow as you tap the button.

This is the code file contentView
struct ContentView: View {

 var arrayinlist: [arrayof5] = [arrayof5 (word1: "Apple", word2: "Bus", word3: "Car", word4: "Door", word5: "Elephant")]

var body: some View {
    

        
    List (arrayinlist) {word in
        Text(word.word1)
        Text(word.word2)
        Text(word.word3)
        Text(word.word4)
        Text(word.word5)
    }
    
    Button(action: {deal()}, label: {
        Image("button")
    })
    
        
        
        
        


        
    }

mutating func deal (){
var show = Int.random(in: 0...4)
arrayinlist = "word" + String(show)

}

file 2 arrayod5:
struct arrayof5: Identifiable {

var id :UUID = UUID()

var word1:String

var word2:String

var word3:String

var word4:String

var word5:String

}

The array of 5 words should be something like this:

let words = ["Alpha", "Bravo", "Charlie", "Delta", "Echo"]

The List should iterate over a separate array defined (which is an array of type String) to which you append a random item from the array above.

Hope that helps

Thank you for your help but I didn’t understand how to implement the idea. Could you please show me the part of the code?

This is one way to solve the challenge:

struct ContentView: View {

    var array = ["Alpha", "Bravo", "Charlie", "Delta", "Echo"]
    @State var items = [String]()

    var body: some View {

        VStack {
            List(items, id: \.self) { item in
                Text(item)
            }

            Button("Add to List") {
                let randIndex = Int.random (in: 0...array.count-1)
                items.append(array[randIndex])
            }
        }
    }
}


Thank you very much for your time. As I see Chris did not explain some of the code you provided.
This is why I couldn’t do it. I will study the code and try to write it.
Could you please look at the screenshot and tell me why I keep getting this error?

You cannot have code inside the body property of a View that does not result in a View of some kind.

In other words you cannot use a print statement in a View. The error is saying that the code provided does not conform to ‘View’

The declaration of the array should be just inside the struct definition and before the var body: some View {