最后老师说的概率,有人做了吗? 可以讲一下吗?
老师最后说的定义一个随机数包在外面,有人做到吗?可以给讲一下吗?
老师最后说的定义一个随机数包在外面,有人做到吗?可以给讲一下吗?
2015-12-27
//Kotlin语音写的 public fun startTurnTable(){ //"单反相机","IPad","恭喜发财","IPhone","服装一套","恭喜发财" var index = 0 var result:Int = (Math.random()*100).toInt() when(result){ in 0..10 -> index = 0 in 11..20 -> index = 1 in 21..30 -> index = 3 in 31..40 -> index = 4 in 41..70 -> index = 2 else -> index = 5 } startTurnTable(index) }
举报