I tried to make password generator ( only string ) using Kotlin for-loop when I run the code it's shows me outputs like this
OHDPETGDIKPCIQPHBHKWSQKXB
PJQBCSNRWDSHJJXFISDMBVAGT
XSEVXCONRMXQGHXDADQFNLJYK
its too long password so I tried to use some Kotlin functions (Size,Length) and didn't work with me maybe I just don't know the right way to do it , example I just want Password length size is from 5 to 15 chars please forget the numbers variable and x variable
Kotlin Code:
class passwordMaker {
private val password = ('a'..'Z') + ('A'..'Z')
private val numbers = arrayOf(1,3,4,5,2,0,4,6,7,'@','#','_','/')
fun passwordMaker(){
var x = numbers
var xy = password.subList(0,25)
for (i in xy){
print(xy.random())
xy.size-3
print((x.random()))
x.size-4
}
}
}