From 953197c1cbc87fb2c5fd1118420776bb5b8d844c Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:57:47 +0200 Subject: [PATCH 1/2] one sentence per line --- .../.docs/instructions.md | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/exercises/concept/annalyns-infiltration/.docs/instructions.md b/exercises/concept/annalyns-infiltration/.docs/instructions.md index 4ae00ea14..e0f5ec193 100644 --- a/exercises/concept/annalyns-infiltration/.docs/instructions.md +++ b/exercises/concept/annalyns-infiltration/.docs/instructions.md @@ -1,13 +1,18 @@ # Instructions -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. +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. -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. +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. Having found the kidnappers, Annalyn considers which of the following actions she can engage in: - 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. -- Spy: the group can be spied upon if at least one of them is awake. Otherwise, spying is a waste of time. +- Spy: the group can be spied upon if at least one of them is awake. + Otherwise, spying is a waste of time. - 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. - _Free prisoner_: Annalyn can try sneaking into the camp to free the prisoner. 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 ## 1. Check if a fast attack can be made -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`: +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`: ```java boolean knightIsAwake = true; @@ -30,7 +37,9 @@ AnnalynsInfiltration.canFastAttack(knightIsAwake); ## 2. Check if the group can be spied upon -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`: +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`: ```java boolean knightIsAwake = false; @@ -42,7 +51,9 @@ AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake); ## 3. Check if the prisoner can be signalled -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`: +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`: ```java boolean archerIsAwake = false; @@ -53,7 +64,11 @@ AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake); ## 4. Check if the prisoner can be freed -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`: +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`: ```java boolean knightIsAwake = false; From 4294315645f3062409b82d6bffe16d4f0f761b06 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 16 Nov 2024 22:15:58 +0200 Subject: [PATCH 2/2] grammar fixes --- .../.docs/instructions.md | 52 ++++++++++--------- .../.docs/introduction.md | 4 +- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/exercises/concept/annalyns-infiltration/.docs/instructions.md b/exercises/concept/annalyns-infiltration/.docs/instructions.md index e0f5ec193..f8e35fd96 100644 --- a/exercises/concept/annalyns-infiltration/.docs/instructions.md +++ b/exercises/concept/annalyns-infiltration/.docs/instructions.md @@ -1,33 +1,35 @@ # Instructions -In this exercise, you'll be implementing the quest logic for a new RPG game a friend is developing. +In this exercise, you'll implement the quest logic for a new RPG game that 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. +Unfortunately, disaster strikes: her best friend was kidnapped while searching for berries in the forest. +Annalyn will try to find and rescue her friend, optionally taking her dog along on the quest. -After some time spent following her best friend's trail, she finds the camp in which her best friend is imprisoned. +After some time spent following the trail, Annalyn discovers the camp where her friend is imprisoned. It turns out there are two kidnappers: a mighty knight and a cunning archer. Having found the kidnappers, Annalyn considers which of the following actions she can engage in: -- 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. +- Fast attack: a fast attack can be made if the knight is sleeping, as it takes time for him to put on his armor, leaving him vulnerable. - Spy: the group can be spied upon if at least one of them is awake. Otherwise, spying is a waste of time. -- 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. -- _Free prisoner_: Annalyn can try sneaking into the camp to free the prisoner. - This is a risky thing to do and can only succeed in one of two ways: - - If Annalyn has her pet dog with her she can rescue the prisoner if the archer is asleep. +- Signal prisoner: the prisoner can be signaled using bird sounds if the prisoner is awake and the archer is sleeping. + Archers are trained in bird signaling and could intercept the message if they are awake. +- _Free prisoner_: Annalyn can attempt to sneak into the camp to free the prisoner. + This is risky and can only succeed in one of two ways: + - If Annalyn has her pet dog, she can rescue the prisoner if the archer is asleep. The knight is scared of the dog and the archer will not have time to get ready before Annalyn and the prisoner can escape. - - If Annalyn does not have her dog then she and the prisoner must be very sneaky! - Annalyn can free the prisoner if the prisoner is awake and the knight and archer are both sleeping, but if the prisoner is sleeping they can't be rescued: the prisoner would be startled by Annalyn's sudden appearance and wake up the knight and archer. + - If Annalyn does not have her pet dog, then she and the prisoner must be very sneaky! + Annalyn can free the prisoner if the prisoner is awake and both the knight and archer are sleeping. + However, if the prisoner is sleeping, they can't be rescued, as the prisoner would be startled by Annalyn's sudden appearance and wake up the knight and archer. -You have four tasks: to implement the logic for determining if the above actions are available based on the state of the three characters found in the forest and whether Annalyn's pet dog is present or not. +You have four tasks: to implement the logic for determining if the above actions are available based on the state of the three characters in the forest and whether Annalyn's pet dog is present or not. ## 1. Check if a fast attack can be made -Implement the (_static_) `AnnalynsInfiltration.canFastAttack()` method that takes a boolean value that indicates if the knight is awake. +Implement the (_static_) `AnnalynsInfiltration.canFastAttack()` method, which takes a boolean value indicating whether 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`: +Otherwise, it returns `false`: ```java boolean knightIsAwake = true; @@ -37,9 +39,9 @@ AnnalynsInfiltration.canFastAttack(knightIsAwake); ## 2. Check if the group can be spied upon -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`: +Implement the (_static_) `AnnalynsInfiltration.canSpy()` method, which takes three boolean values indicating whether the knight, archer, and prisoner, respectively, are awake. +The method returns `true` if the group can be spied upon based on the state of the three characters. +Otherwise, it returns `false`: ```java boolean knightIsAwake = false; @@ -49,11 +51,11 @@ AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake); // => true ``` -## 3. Check if the prisoner can be signalled +## 3. Check if the prisoner can be signaled -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`: +Implement the (_static_) `AnnalynsInfiltration.canSignalPrisoner()` method, which takes two boolean values indicating whether the archer and the prisoner, respectively, are awake. +The method returns `true` if the prisoner can be signaled based on the state of the two characters. +Otherwise, it returns `false`: ```java boolean archerIsAwake = false; @@ -64,10 +66,10 @@ AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake); ## 4. Check if the prisoner can be freed -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. +Implement the (_static_) `AnnalynsInfiltration.canFreePrisoner()` method, which takes four boolean values. +The first three parameters indicate whether the knight, archer, and prisoner, respectively, are awake. +The last parameter indicates whether 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 the presence of Annalyn's pet dog. Otherwise, it returns `false`: ```java diff --git a/exercises/concept/annalyns-infiltration/.docs/introduction.md b/exercises/concept/annalyns-infiltration/.docs/introduction.md index 46597333e..6ff36c4db 100644 --- a/exercises/concept/annalyns-infiltration/.docs/introduction.md +++ b/exercises/concept/annalyns-infiltration/.docs/introduction.md @@ -7,8 +7,8 @@ Booleans in Java are represented by the `boolean` type, which values can be eith Java supports three boolean operators: - `!` (NOT): negates the boolean -- `&&` (AND): takes two booleans and results in true if they're both true -- `||` (OR): results in true if any of the two booleans is true +- `&&` (AND): takes two booleans and returns `true` if they're both `true` +- `||` (OR): returns `true` if any of the two booleans is `true` ### Examples