Variable used before being initialized in function

前端 未结 6 1579
孤城傲影
孤城傲影 2020-12-12 06:14

I\'m making a ro sham bo game. Functions in swift are different than what I have used before. I keep getting an error:

Variable used before being init

6条回答
  •  一整个雨季
    2020-12-12 06:55

    Try var returnval: Int = 0 (or another random number in case your if-else statements are exhaustive)

提交回复
热议问题