diff --git a/docs/exercises/match_the_following.md b/docs/exercises/match_the_following.md index 67c941c..d81c479 100644 --- a/docs/exercises/match_the_following.md +++ b/docs/exercises/match_the_following.md @@ -7,28 +7,28 @@ title: Match The Following You are given two files. Each file contains different parts of the same string. The aim of this exercise is to match pairs of strings. For every string in the first file, there is a string in the second file whose first four characters are the same as the last four characters of the first. Sample of File 1: -
+```text 79oklw 381jstc 453usja 535bdxv -+``` Sample of File 2: -
+```text jstc331 oklw737 bdxv211 usja514 -+``` Sample output: -
+```text 79oklw737 381jstc331 453usja514 535bdxv211 -+``` In the above samples, `oklw`, `jstc`, `usja` and `bdxv` form the endings of the strings in File 1. They also form the beginnings of the string in File 2. diff --git a/docs/exercises/patterns.md b/docs/exercises/patterns.md index f8d0bda..9b69e70 100644 --- a/docs/exercises/patterns.md +++ b/docs/exercises/patterns.md @@ -7,7 +7,7 @@ _Do not reinvent unnecessary wheels_ **1. Filled Rectangle** Generate a filled rectangle of MxN dimension. Additionally the user should be able to specify the character used to fill the rectangle. -
+```text // 1 x 1, * * @@ -30,7 +30,7 @@ AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA -+``` ---- @@ -38,7 +38,7 @@ AAAAAAAAAAAAAAAAAAAA Generate a hollow rectangle of MxN dimension. Additionally the user should be able to specify the character that outlines the rectangle. -
+```text // 1 x 1, * * @@ -66,14 +66,14 @@ Generate a hollow rectangle of MxN dimension. Additionally the user should be ab + + + + ++++++++++++++++++++ -+``` ---- **3. Cyclical Lines** Generate N lines of length M. The text used to generate the line should be cycled through a list of characters -
+```text // 3 x 1,+,- + - @@ -101,14 +101,14 @@ Generate N lines of length M. The text used to generate the line should be cycle + + -+``` ---- **4. Left Aligned Triangle** Generate a left-aligned right angled triangle of size N as follows: -
+```text // 2,- - -- @@ -126,13 +126,13 @@ Generate a left-aligned right angled triangle of size N as follows: ***** ****** -+``` ---- **5. Right Aligned Triangle** Generate a right-aligned right angled triangle of size N as follows: -
+```text // 2,-(the empty line below is simply to differentiate. Your output should not contain it) - @@ -153,14 +153,14 @@ Generate a right-aligned right angled triangle of size N as follows: ***** ****** -+``` ---- **6. Left Aligned Hollow Triangle** Generate a left-aligned right angled hollow triangle of size N as follows: -
+```text // 2,- - -- @@ -184,13 +184,13 @@ Generate a left-aligned right angled hollow triangle of size N as follows: * * ****** -+``` ---- **7. Right Aligned Hollow Triangle** Generate a right-aligned right angled hollow triangle of size N as follows: -
+```text // 2,-(the empty line below is simply to differentiate. Your output should not contain it) - @@ -218,13 +218,13 @@ Generate a right-aligned right angled hollow triangle of size N as follows: * * ****** -+``` ---- **8. Diamond** Generate a diamond of size N and the specified character. N specifies the widest part of the diamond(the middle line). N needs to be odd. If an even number is supplied, round it *up* to the nearest odd. -
+```text // 3,+ + +++ @@ -244,13 +244,13 @@ Generate a diamond of size N and the specified character. N specifies the widest *** * -+``` ---- **9. Hollow Diamond** Generate a hollow diamond of size N and the specified character. N specifies the widest part of the diamond(the middle line). N needs to be odd. If an even number is supplied, round it *up* to the nearest odd. -
+```text // 3,+ + + + @@ -270,13 +270,13 @@ Generate a hollow diamond of size N and the specified character. N specifies the * * * -+``` ---- **10. Angled Hollow Diamond** Generate a hollow diamond whose edges are sloped. Unlike the previous diamond examples, this diamond only uses the character specified on the tips of the diamond. -
+```text // 3,- - - - @@ -298,5 +298,5 @@ Generate a hollow diamond whose edges are sloped. Unlike the previous diamond ex \ / * -+``` ----