Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Rotate array
//Kotlin 1.1 fun main(args: Array<String>) { var array = arrayOf(1,2,3,4,5) var count = 3 while(count>0){ for((i,value) in array.withIndex()){ if(i==array.size-1) { } else { var temp = array[i] array[i] = array[i+1] array[i+1] = temp } // println(array[i]) } count-- } for(value in array.indices){ println(array[value]) } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Function Call, Arithmetic Operations, User Input and more in Kotlin
KotlinSessionVII#IS_OPERATOR
Result finder
iya
validation testing
Arun1
GenerateFibonacci47
My script1
Kotlin
degerliilkornek
Please log in to post a comment.