Group Group Group Group Group Group Group Group Group

Lesson help swift

#1

2d

having a issue. I did everything as it says and its having trouble compiling. That being said I then opened the final product made by you guys. It had the same issue “Type ‘Int’ has no member ‘random’”

count = 0

var roll: Int = 0

repeat {

roll = Int.random(in: 1…6)

count += 1

// if count > 5 {

// break

// }

print(“After (count) roll(s), roll is (roll)”)

} while roll != 6 && count < 5

Reply

shogunkaramazovmoderator

2d

@lac_ekim What Xcode version are you using?

Reply

lac_ekim

2d

@shogunkaramazov Version 10.1 (10B61)

#2

@lac_ekim Do you still have issues with this? It’s working fine for me.

#3

yes, it differs from the lesson

#4

roll = Int.random(in: 1…6) Type ‘Int’ has no member ‘random’

#5

to be even more specific “Int.random(in: 1…6)”

#6

understand this is directly from PS_2-03_End Playground

#7

@shogunkaramazov figured it out, TY