Skip to content

Commit 745df19

Browse files
move from booleans to annalyns-infiltration slug (exercism#1899)
* move from booleans to annalyns-infiltration slug * add exercise name Co-authored-by: Eric Balawejder <eric.balawejder@protonmail.com>
1 parent 6830b2f commit 745df19

11 files changed

Lines changed: 47 additions & 46 deletions

File tree

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"status": "wip"
4343
},
4444
{
45-
"slug": "booleans",
45+
"slug": "annalyns-infiltration",
46+
"name": "Annalyn's Infiltration",
4647
"uuid": "aaf69953-eac8-4016-984e-13b0917fcf01",
4748
"concepts": [
4849
"booleans"
File renamed without changes.

exercises/concept/booleans/.docs/instructions.md renamed to exercises/concept/annalyns-infiltration/.docs/instructions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,46 @@ You have four tasks: to implement the logic for determining if the above actions
1717

1818
## 1. Check if a fast attack can be made
1919

20-
Implement the (_static_) `QuestLogic.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`:
20+
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`:
2121

2222
```java
2323
boolean knightIsAwake = true;
24-
QuestLogic.canFastAttack(knightIsAwake);
24+
AnnalynsInfiltration.canFastAttack(knightIsAwake);
2525
// => false
2626
```
2727

2828
## 2. Check if the group can be spied upon
2929

30-
Implement the (_static_) `QuestLogic.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`:
30+
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`:
3131

3232
```java
3333
boolean knightIsAwake = false;
3434
boolean archerIsAwake = true;
3535
boolean prisonerIsAwake = false;
36-
QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake);
36+
AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake);
3737
// => true
3838
```
3939

4040
## 3. Check if the prisoner can be signalled
4141

42-
Implement the (_static_) `QuestLogic.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`:
42+
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`:
4343

4444
```java
4545
boolean archerIsAwake = false;
4646
boolean prisonerIsAwake = true;
47-
QuestLogic.canSignalPrisoner(archerIsAwake, prisonerIsAwake);
47+
AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake);
4848
// => true
4949
```
5050

5151
## 4. Check if the prisoner can be freed
5252

53-
Implement the (_static_) `QuestLogic.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 presence. Otherwise, it returns `false`:
53+
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 presence. Otherwise, it returns `false`:
5454

5555
```java
5656
boolean knightIsAwake = false;
5757
boolean archerIsAwake = true;
5858
boolean prisonerIsAwake = false;
5959
boolean petDogIsPresent = false;
60-
QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake, prisonerIsAwake, petDogIsPresent);
60+
AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake, prisonerIsAwake, petDogIsPresent);
6161
// => false
6262
```

exercises/concept/booleans/.docs/introduction.md renamed to exercises/concept/annalyns-infiltration/.docs/introduction.md

File renamed without changes.

exercises/concept/booleans/.meta/config.json renamed to exercises/concept/annalyns-infiltration/.meta/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
],
99
"files": {
1010
"solution": [
11-
"src/main/java/QuestLogic.java"
11+
"src/main/java/AnnalynsInfiltration.java"
1212
],
1313
"test": [
14-
"src/test/java/QuestLogicTest.java"
14+
"src/test/java/AnnalynsInfiltrationTest.java"
1515
],
1616
"exemplar": [
17-
".meta/src/reference/java/QuestLogic.java"
17+
".meta/src/reference/java/AnnalynsInfiltration.java"
1818
]
1919
},
2020
"forked_from": [
File renamed without changes.

exercises/concept/booleans/.meta/src/reference/java/QuestLogic.java renamed to exercises/concept/annalyns-infiltration/.meta/src/reference/java/AnnalynsInfiltration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class QuestLogic {
1+
class AnnalynsInfiltration {
22
public static boolean canFastAttack(boolean knightIsAwake) {
33
return !knightIsAwake;
44
}
File renamed without changes.

exercises/concept/booleans/src/main/java/QuestLogic.java renamed to exercises/concept/annalyns-infiltration/src/main/java/AnnalynsInfiltration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class QuestLogic {
1+
class AnnalynsInfiltration {
22
public static boolean canFastAttack(boolean knightIsAwake) {
33
throw new UnsupportedOperationException("Please implement the (static) QuestLogic.canFastAttack() method");
44
}

exercises/concept/booleans/src/test/java/QuestLogicTest.java renamed to exercises/concept/annalyns-infiltration/src/test/java/AnnalynsInfiltrationTest.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
import org.junit.Test;
33
import static org.assertj.core.api.Assertions.assertThat;
44

5-
public class QuestLogicTest {
5+
public class AnnalynsInfiltrationTest {
66
@Test
77
public void cannot_execute_fast_attack_if_knight_is_awake() {
88
boolean knightIsAwake = true;
9-
assertThat(QuestLogic.canFastAttack(knightIsAwake)).isFalse();
9+
assertThat(AnnalynsInfiltration.canFastAttack(knightIsAwake)).isFalse();
1010
}
1111

1212
@Test
1313
@Ignore
1414
public void can_execute_fast_attack_if_knight_is_sleeping() {
1515
boolean knightIsAwake = false;
16-
assertThat(QuestLogic.canFastAttack(knightIsAwake)).isTrue();
16+
assertThat(AnnalynsInfiltration.canFastAttack(knightIsAwake)).isTrue();
1717
}
1818

1919
@Test
@@ -22,7 +22,7 @@ public void cannot_spy_if_everyone_is_sleeping() {
2222
boolean knightIsAwake = false;
2323
boolean archerIsAwake = false;
2424
boolean prisonerIsAwake = false;
25-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isFalse();
25+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isFalse();
2626
}
2727

2828
@Test
@@ -31,7 +31,7 @@ public void can_spy_if_everyone_but_knight_is_sleeping() {
3131
boolean knightIsAwake = true;
3232
boolean archerIsAwake = false;
3333
boolean prisonerIsAwake = false;
34-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
34+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
3535
}
3636

3737
@Test
@@ -40,7 +40,7 @@ public void can_spy_if_everyone_but_archer_is_sleeping() {
4040
boolean knightIsAwake = false;
4141
boolean archerIsAwake = true;
4242
boolean prisonerIsAwake = false;
43-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
43+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
4444
}
4545

4646
@Test
@@ -49,7 +49,7 @@ public void can_spy_if_everyone_but_prisoner_is_sleeping() {
4949
boolean knightIsAwake = false;
5050
boolean archerIsAwake = false;
5151
boolean prisonerIsAwake = true;
52-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
52+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
5353
}
5454

5555
@Test
@@ -58,7 +58,7 @@ public void can_spy_if_only_knight_is_sleeping() {
5858
boolean knightIsAwake = false;
5959
boolean archerIsAwake = true;
6060
boolean prisonerIsAwake = true;
61-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
61+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
6262
}
6363

6464
@Test
@@ -67,7 +67,7 @@ public void can_spy_if_only_archer_is_sleeping() {
6767
boolean knightIsAwake = true;
6868
boolean archerIsAwake = false;
6969
boolean prisonerIsAwake = true;
70-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
70+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
7171
}
7272

7373
@Test
@@ -76,7 +76,7 @@ public void can_spy_if_only_prisoner_is_sleeping() {
7676
boolean knightIsAwake = true;
7777
boolean archerIsAwake = true;
7878
boolean prisonerIsAwake = false;
79-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
79+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
8080
}
8181

8282
@Test
@@ -85,39 +85,39 @@ public void can_spy_if_everyone_is_awake() {
8585
boolean knightIsAwake = true;
8686
boolean archerIsAwake = true;
8787
boolean prisonerIsAwake = true;
88-
assertThat(QuestLogic.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
88+
assertThat(AnnalynsInfiltration.canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake)).isTrue();
8989
}
9090

9191
@Test
9292
@Ignore
9393
public void can_signal_prisoner_ifarcher_is_sleeping_and_prisoner_is_awake() {
9494
boolean archerIsAwake = false;
9595
boolean prisonerIsAwake = true;
96-
assertThat(QuestLogic.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isTrue();
96+
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isTrue();
9797
}
9898

9999
@Test
100100
@Ignore
101101
public void cannot_signal_prisoner_ifarcher_is_awake_and_prisoner_is_sleeping() {
102102
boolean archerIsAwake = true;
103103
boolean prisonerIsAwake = false;
104-
assertThat(QuestLogic.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
104+
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
105105
}
106106

107107
@Test
108108
@Ignore
109109
public void cannot_signal_prisoner_ifarcher_and_prisoner_are_both_sleeping() {
110110
boolean archerIsAwake = false;
111111
boolean prisonerIsAwake = false;
112-
assertThat(QuestLogic.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
112+
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
113113
}
114114

115115
@Test
116116
@Ignore
117117
public void cannot_signal_prisoner_ifarcher_and_prisoner_are_both_awake() {
118118
boolean archerIsAwake = true;
119119
boolean prisonerIsAwake = true;
120-
assertThat(QuestLogic.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
120+
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
121121
}
122122

123123
@Test
@@ -127,7 +127,7 @@ public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_present(
127127
boolean archerIsAwake = true;
128128
boolean prisonerIsAwake = true;
129129
boolean petDogIsPresent = true;
130-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
130+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
131131
prisonerIsAwake, petDogIsPresent)).isFalse();
132132
}
133133

@@ -138,7 +138,7 @@ public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_absent()
138138
boolean archerIsAwake = true;
139139
boolean prisonerIsAwake = true;
140140
boolean petDogIsPresent = false;
141-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
141+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
142142
prisonerIsAwake, petDogIsPresent)).isFalse();
143143
}
144144

@@ -149,7 +149,7 @@ public void can_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_present()
149149
boolean archerIsAwake = false;
150150
boolean prisonerIsAwake = false;
151151
boolean petDogIsPresent = true;
152-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
152+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
153153
prisonerIsAwake, petDogIsPresent)).isTrue();
154154
}
155155

@@ -160,7 +160,7 @@ public void cannot_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_absent(
160160
boolean archerIsAwake = false;
161161
boolean prisonerIsAwake = false;
162162
boolean petDogIsPresent = false;
163-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
163+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
164164
prisonerIsAwake, petDogIsPresent)).isFalse();
165165
}
166166

@@ -171,7 +171,7 @@ public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_presen
171171
boolean archerIsAwake = false;
172172
boolean prisonerIsAwake = true;
173173
boolean petDogIsPresent = true;
174-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
174+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
175175
prisonerIsAwake, petDogIsPresent)).isTrue();
176176
}
177177

@@ -182,7 +182,7 @@ public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_absent
182182
boolean archerIsAwake = false;
183183
boolean prisonerIsAwake = true;
184184
boolean petDogIsPresent = false;
185-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
185+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
186186
prisonerIsAwake, petDogIsPresent)).isTrue();
187187
}
188188

@@ -193,7 +193,7 @@ public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_prese
193193
boolean archerIsAwake = true;
194194
boolean prisonerIsAwake = false;
195195
boolean petDogIsPresent = true;
196-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
196+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
197197
prisonerIsAwake, petDogIsPresent)).isFalse();
198198
}
199199

@@ -204,7 +204,7 @@ public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_absen
204204
boolean archerIsAwake = true;
205205
boolean prisonerIsAwake = false;
206206
boolean petDogIsPresent = false;
207-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
207+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
208208
prisonerIsAwake, petDogIsPresent)).isFalse();
209209
}
210210

@@ -215,7 +215,7 @@ public void can_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_present(
215215
boolean archerIsAwake = false;
216216
boolean prisonerIsAwake = false;
217217
boolean petDogIsPresent = true;
218-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
218+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
219219
prisonerIsAwake, petDogIsPresent)).isTrue();
220220
}
221221

@@ -226,7 +226,7 @@ public void cannot_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_absen
226226
boolean archerIsAwake = false;
227227
boolean prisonerIsAwake = false;
228228
boolean petDogIsPresent = false;
229-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
229+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
230230
prisonerIsAwake, petDogIsPresent)).isFalse();
231231
}
232232

@@ -237,7 +237,7 @@ public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_pres
237237
boolean archerIsAwake = true;
238238
boolean prisonerIsAwake = true;
239239
boolean petDogIsPresent = true;
240-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
240+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
241241
prisonerIsAwake, petDogIsPresent)).isFalse();
242242
}
243243

@@ -248,7 +248,7 @@ public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_abse
248248
boolean archerIsAwake = true;
249249
boolean prisonerIsAwake = true;
250250
boolean petDogIsPresent = false;
251-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
251+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
252252
prisonerIsAwake, petDogIsPresent)).isFalse();
253253
}
254254

@@ -259,7 +259,7 @@ public void can_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_present
259259
boolean archerIsAwake = false;
260260
boolean prisonerIsAwake = true;
261261
boolean petDogIsPresent = true;
262-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
262+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
263263
prisonerIsAwake, petDogIsPresent)).isTrue();
264264
}
265265

@@ -270,7 +270,7 @@ public void cannot_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_abse
270270
boolean archerIsAwake = false;
271271
boolean prisonerIsAwake = true;
272272
boolean petDogIsPresent = false;
273-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
273+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
274274
prisonerIsAwake, petDogIsPresent)).isFalse();
275275
}
276276

@@ -281,7 +281,7 @@ public void cannot_release_prisoner_if_only_prisoner_is_asleep_and_pet_dog_is_pr
281281
boolean archerIsAwake = true;
282282
boolean prisonerIsAwake = false;
283283
boolean petDogIsPresent = true;
284-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
284+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
285285
prisonerIsAwake, petDogIsPresent)).isFalse();
286286
}
287287

@@ -292,7 +292,7 @@ public void cannot_release_prisoner_if_only_prisoner_is_asleep_and_pet_dog_is_ab
292292
boolean archerIsAwake = true;
293293
boolean prisonerIsAwake = false;
294294
boolean petDogIsPresent = false;
295-
assertThat(QuestLogic.canFreePrisoner(knightIsAwake, archerIsAwake,
295+
assertThat(AnnalynsInfiltration.canFreePrisoner(knightIsAwake, archerIsAwake,
296296
prisonerIsAwake, petDogIsPresent)).isFalse();
297297
}
298298
}

0 commit comments

Comments
 (0)