Funny Words Generator
Sofia works as a sales manager in the net of retailers.
Now the company is going to launch several brand-new items to their shops. The only trouble is that the name for new brands is yet to be choosen.
Sofia is ordered to invent these names. However, many good words are already used (like
she asked you to write a program which can generate a collection of funny words. She then will be able to read the
list leisurely and pick some for brand names.
Let us work by following algorithm:
5, ...) should be consonant, while letters ad even positions (
6, ...) - like
fanero- since such words are guaranteed to be easy to pronounce.
bcdfghjklmnprstvwxzand vowels are
A = 445, C = 700001, M = 2097152- and initial value
X0for sequence (i.e. seed) would be given to you as input data.
Nletters, generate the same amount of next random numbers with this generator, for example with
X0 = 0and
N = 4you'll get numbers
19for consonants or
5for vowels and selecting the letter from the strings above (see step
2) simply by index.
For example, if
X0 = 0 and we are to generate the word of
4 letters, we have the following calculations:
Random Value Letter Index Letter 700001 700001 % 19 = 3 F 1821950 1821950 % 5 = 0 A 1967079 1967079 % 19 = 9 M 1537772 1537772 % 5 = 2 I
So resulting word is
Surely, we can generate many words without reseting our random generator, since this generator has a period of about
2 million values.
Input data will contain number of words to generate at first line and seed value
X0 for random generator.
Next line will contain lengths of words which should be generated, separated with spaces.
Answer should contain the words you generated, also separated by space.
input data: 3 0 4 5 6 answer: fami wovaw kelasi
input data: 4 2014 9 9 9 9 answer: foravanad zibecefeb wagabenip wedivonow