...

/

Solution: Write Code with a Generator Pattern

Solution: Write Code with a Generator Pattern

Check the solution of the challenge to use the generator pattern.

Problem breakdown

Let’s walk through the solution step by step so we can write code that uses a generator pattern. To do this, we’ll create a struct to store and print the values.

Press + to interact
type struct_name struct {
val int
message string
}

Let’s create a generator function. The generator function will return a ...