Pesquisar na Comunidade
Mostrando resultados para as tags ''iphone''.
Encontrado 1 registro
-
/* * ----------Valid PassWord---------- * PassWord must contain: * At least SIX characters * At least ONE character Caps lock * At least ONE character lowerCase * At least ONE number * And Can not contain SPACE */ let password = "Doctor_Who_98" var contain_space = 0 var contain_latters_lowerCase = 0 var contain_latters_capsLock = 0 var contain_number = 0 var number_character = 0 // up all the counters zeroed let latters_lowerCase = "abcdefghijklmnopqrstyvxzy" let latters_capsLock = "ABCDEFGHIJKLMNOPQRSTUVXZY" let numbers = "0123456789" for check_password in password { //will scroll through all the characters of the password number_character += 1 //Count the amount of character if check_password == " " { contain_space += 1 //check if there is any space } for check_latters_lowerCase in latters_lowerCase { if check_password == check_latters_lowerCase { contain_latters_lowerCase += 1 //Count the lowercase letters } } for check_latters_capsLock in latters_capsLock { if check_password == check_latters_capsLock { contain_latters_capsLock += 1 //Count the capslock letters } } for check_numbers in numbers { if check_password == check_numbers { contain_number += 1 //Count the number of numbers } } } if contain_space == 0 && contain_number > 0 && contain_latters_lowerCase > 0 && contain_latters_capsLock > 0 && number_character >= 6{ print("Password OK") } else { print("Invalid Password") } // Twitter: @thiagoandreqi // Instagram: alfacexburger