aboutsummaryrefslogtreecommitdiff
path: root/challenge-053/duncan-c-white/README
blob: 1f9e9e20df641c86524f6e32c57b0444b40be0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Task 1: "Rotate Matrix

Write a script to rotate the followin matrix by given 90/180/270 degrees clockwise.

[ 1, 2, 3 ]
[ 4, 5, 6 ]
[ 7, 8, 9 ]

For example, if you rotate by 90 degrees then expected result should be like below

[ 7, 4, 1 ]
[ 8, 5, 2 ]
[ 9, 6, 3 ]
"

My notes: sounds pretty trivial.  Made slightly cuter by an inline package in order
to use classic Perl OO in order to get autostringification.


Task 2: "Vowel Strings

Write a script to accept an integer 1 <= N <= 5 that would print all
possible strings of size N formed by using only vowels (a, e, i, o, u).

The string should follow the following rules:

    'a' can only be followed by 'e' and 'i'.

    'e' can only be followed by 'i'.

    'i' can only be followed by 'a', 'e', 'o', and 'u'.

    'o' can only be followed by 'a' and 'u'.

    'u' can only be followed by 'o' and 'e'.

For example, if the given integer N = 2 then script should print the following strings:

ae
ai
ei
ia
io
iu
ie
oa
ou
uo
ue
"

My notes: reading "and" as "or" above, it sounds pretty simple as a generator.