I would like to create a code that consists of 4 parts, each part consists of five letters or numbers ,for example :a9898-1G343-m1Y3R-77Eqc
I want this serial code to occur according to certain rules:
Rule 1: even number of digits counting the first character in each segment (a, 1, m, 7 2/4 are digits, 2 is an even number). [a9898-1G343-m1Y3R -77Eqc]
Rule 2: every segment has at least1 alphabet.[ a9898-1G343-m1Y3R -77Eqc]
Rule 3: sum of digits is (9+8+9+8+1+3+4+3+1+3+7+7) = 63 which is more than 40. [a9898-1G343-m1Y3R -77Eqc]
Rule 4: 7+7 = 14 which is less than 15. [a9898-1G343-m1Y3R -77Eqc]
Rule 5: 3rd, 12th character are digits and add up to 9 (8+1). [a9898-1G343-m1Y3R -77Eqc]
Rule 6: at least 3 caps and 2 lower case. [a9898-1G343-m1Y3R -77Eqc]
Rule 7: distance of 4 or more steps in the alphabet between consecutive characters: (a,g)=6, (g,m)= 6, (m,y) = 12, and so on, all of them being at least 4 characters away. [a9898-1G343-m1Y3R -77Eqc]
What I have tried:
I tried several methods but could not identify the 4 parts and then separate letters by letter and apply the rules Can someone enlighten my mind and explain me how to do this. It's the second week and I can't solve the code, thanks a lot