Skip to content

Commit bf50026

Browse files
committed
Add Cryptic Letter playground assignment
1 parent 06b9d2e commit bf50026

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Загадъчно писмо :secret:
2+
3+
Това мистериозно послание в код пристигна по пощата една сутрин. Разбираш ли нещо?
4+
5+
```java
6+
public class LetterDecoder {
7+
8+
/**
9+
* Ava J. sent you a letter for your secret annual meeting.
10+
* You must decode it to understand when the meeting will take place.
11+
* Ava never makes mistakes when writing her letters. If you ever see one, consider that a clue.
12+
* <p>
13+
* The first 3 letters of Ava's letters always represents the *month*. Be sure of that.
14+
* <p>
15+
* Decode the exact *hour* of the meeting by counting the number of hidden paragraphs.
16+
* If you see a punctuation mistake that would mean the end of a hidden paragraph. *1*
17+
* If you count more that 24 hours, something is not quite right.
18+
* <p>
19+
* Decode the exact *minutes* of the meeting by counting the number of misplaced symbols.
20+
* For every misplaced symbol add 5 minutes. *2*
21+
* If you count more than 60 minutes, something is not quite right.
22+
* <p>
23+
* Decode the exact *day* of the month Ava wants you to meet her by counting the length
24+
* of the hidden paragraph which starts with the word "The" (including a period at the end). *3,4*
25+
* <p>
26+
* *1* - Ava would never make punctuation mistakes.
27+
* Normally every sentence in her letters ends with one occurrence of a period, no more no less.
28+
* *2* - Ava would never replace letters from the alphabet with symbols.
29+
* Normally she writes S instead of $.
30+
* *3* - Ava would never start a hidden paragraph with the word "The".
31+
* *4* - Ava would never leave a lot of unnecessary space between the hidden paragraphs.
32+
* Either at the start, or the end.
33+
*
34+
* @param message The coded message that Ava sent you.
35+
* @return decoded Message in the format [*day* *month* at *hour*:*minutes*], e.g. "17th October at 9:00".
36+
* Print "Maybe another *time*" if you feel something is not right.
37+
* (Replace *time* with the reason you think the meeting might not happen,
38+
* е.g. "Maybe another day" or "Maybe another minute").
39+
* If the message is empty, print "Maybe another day".
40+
*/
41+
public String decodeMessage(final String message) {
42+
// TBD: replace with your solution
43+
return null;
44+
}
45+
46+
}
47+
```
48+
49+
Напомня ми за една случка от *A Series of Unfortunate Events*.

playground/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
| 01 | [Stock Exchange](https://github.com/fmi/java-course/tree/master/playground/01-stock-exchange) | масиви, цикли, алгоритми |
88
| 02 | [DNA Analyzer](https://github.com/fmi/java-course/tree/master/playground/02-dna-analyzer) | низове, цикли, алгоритми |
99
| 03 | [Dungeons](https://github.com/fmi/java-course/tree/master/playground/03-dungeons) | ООП, низове, цикли |
10+
| 04 | [Cryptic Letter](https://github.com/fmi/java-course/tree/master/playground/04-cryptic-letter) | низове, цикли |

0 commit comments

Comments
 (0)