Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Johurt(ES.^, Edgar).
- Date: 24-02-2013.
- */
- stock IsCorrectPassword(pass[])
- {
- new len = strlen(pass);
- if(len < 6) return false;
- for(new l; l < len; l++)
- {
- if(!(pass[l] >= 'A' && pass[l] <= 'Z' || pass[l] >= 'a' && pass[l] <= 'z' || pass[l] >= '0' && pass[l] <= '9' || pass[l] == '.' || pass[l] == '-' || pass[l] == '_')) return false;
- }
- return true;
- }
- /* Example */
- main()
- {
- print("\n\n\n");
- printf("Pass abc123.-_: %s", IsCorrectPassword("abc123.-_") ? ("Correct") : ("Incorrect"));
- printf("Pass 'as!: %s", IsCorrectPassword("'as!") ? ("Correct") : ("Incorrect"));
- print("\n\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement