You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/concept/annalyns-infiltration/.docs/instructions.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,18 @@
1
1
# Instructions
2
2
3
-
In this exercise, you'll be implementing the quest logic for a new RPG game a friend is developing. The game's main character is Annalyn, a brave girl with a fierce and loyal pet dog. Unfortunately, disaster strikes, as her best friend was kidnapped while searching for berries in the forest. Annalyn will try to find and free her best friend, optionally taking her dog with her on this quest.
3
+
In this exercise, you'll be implementing the quest logic for a new RPG game a friend is developing.
4
+
The game's main character is Annalyn, a brave girl with a fierce and loyal pet dog.
5
+
Unfortunately, disaster strikes, as her best friend was kidnapped while searching for berries in the forest.
6
+
Annalyn will try to find and free her best friend, optionally taking her dog with her on this quest.
4
7
5
-
After some time spent following her best friend's trail, she finds the camp in which her best friend is imprisoned. It turns out there are two kidnappers: a mighty knight and a cunning archer.
8
+
After some time spent following her best friend's trail, she finds the camp in which her best friend is imprisoned.
9
+
It turns out there are two kidnappers: a mighty knight and a cunning archer.
6
10
7
11
Having found the kidnappers, Annalyn considers which of the following actions she can engage in:
8
12
9
13
- Fast attack: a fast attack can be made if the knight is sleeping, as it takes time for him to get his armor on, so he will be vulnerable.
10
-
- Spy: the group can be spied upon if at least one of them is awake. Otherwise, spying is a waste of time.
14
+
- Spy: the group can be spied upon if at least one of them is awake.
15
+
Otherwise, spying is a waste of time.
11
16
- Signal prisoner: the prisoner can be signalled using bird sounds if the prisoner is awake and the archer is sleeping, as archers are trained in bird signaling, so they could intercept the message.
12
17
-_Free prisoner_: Annalyn can try sneaking into the camp to free the prisoner.
13
18
This is a risky thing to do and can only succeed in one of two ways:
@@ -20,7 +25,9 @@ You have four tasks: to implement the logic for determining if the above actions
20
25
21
26
## 1. Check if a fast attack can be made
22
27
23
-
Implement the (_static_) `AnnalynsInfiltration.canFastAttack()` method that takes a boolean value that indicates if the knight is awake. This method returns `true` if a fast attack can be made based on the state of the knight. Otherwise, returns `false`:
28
+
Implement the (_static_) `AnnalynsInfiltration.canFastAttack()` method that takes a boolean value that indicates if the knight is awake.
29
+
This method returns `true` if a fast attack can be made based on the state of the knight.
Implement the (_static_) `AnnalynsInfiltration.canSpy()` method that takes three boolean values, indicating if the knight, archer and the prisoner, respectively, are awake. The method returns `true` if the group can be spied upon, based on the state of the three characters. Otherwise, returns `false`:
40
+
Implement the (_static_) `AnnalynsInfiltration.canSpy()` method that takes three boolean values, indicating if the knight, archer and the prisoner, respectively, are awake.
41
+
The method returns `true` if the group can be spied upon, based on the state of the three characters.
Implement the (_static_) `AnnalynsInfiltration.canSignalPrisoner()` method that takes two boolean values, indicating if the archer and the prisoner, respectively, are awake. The method returns `true` if the prisoner can be signalled, based on the state of the two characters. Otherwise, returns `false`:
54
+
Implement the (_static_) `AnnalynsInfiltration.canSignalPrisoner()` method that takes two boolean values, indicating if the archer and the prisoner, respectively, are awake.
55
+
The method returns `true` if the prisoner can be signalled, based on the state of the two characters.
Implement the (_static_) `AnnalynsInfiltration.canFreePrisoner()` method that takes four boolean values. The first three parameters indicate if the knight, archer and the prisoner, respectively, are awake. The last parameter indicates if Annalyn's pet dog is present. The method returns `true` if the prisoner can be freed based on the state of the three characters and Annalyn's pet dog's presence. Otherwise, it returns `false`:
67
+
Implement the (_static_) `AnnalynsInfiltration.canFreePrisoner()` method that takes four boolean values.
68
+
The first three parameters indicate if the knight, archer and the prisoner, respectively, are awake.
69
+
The last parameter indicates if Annalyn's pet dog is present.
70
+
The method returns `true` if the prisoner can be freed based on the state of the three characters and Annalyn's pet dog's presence.
0 commit comments