Learn Courses My Dashboard

Chapter 12 Challenge

I was able to write a program that started with a text string of int 0 and the increase and the decrease buttons which worked, but only for one specific interval. The random expressions I tried didn’t work. I first tried using the @State private var definitions at the top like for lesson 11 but started having doubts about it.

so which one was it was it a string or was it an int?

it would be post to post a screenshot of your problem or your code

The issue is below:
ld: entry point (_main) undefined. for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing All Errors Only

Entry point (_main) undefined. for architecture x86_64

One way to think about the challenge is that you’re either increasing or decreasing, forever, until you pass the upper or lower limit. When you reach or exceed the limit, change your direction, forever, until you pass the other limit.

@State var isIncreasing: Bool = true

The random adjustment could be provided by Int.random(in: 1…10)

func increase() { val += Int.random(in: 1...10) }