Skip to content

Commit 0a2b5ef

Browse files
authored
Tweaks to sprint 3 exercises (#42)
* Remove the Debug exercise, and the time refactor exercise as they were already moved to sprint 2. * Remove the vowel refactor exercise. It's not clear what its goals are, or what it's looking for. We can re-add something here if we think it's valuable. * Make clear the implement exercises should use Jest - that's what the entire sprint was about. * Make previously "stretch" exercises be not stretch, because we've removed several pieces. * A bunch of copy edits where things were unclear or contained typos.
1 parent 6b4a30c commit 0a2b5ef

File tree

7 files changed

+12
-110
lines changed

7 files changed

+12
-110
lines changed

Sprint-3/debug/format-as-12-hours.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

Sprint-3/implement/get-card-value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// Acceptance criteria:
88

9-
// Given a card string in the format "A♠" (representing a card in blackjack),
9+
// Given a card string in the format "A♠" (representing a card in blackjack - the last character will always be an emoji for a suit, and all characters before will be a number 2-10, or one letter of J, Q, K, A),
1010
// When the function getCardValue is called with this card string as input,
1111
// Then it should return the numerical card value
1212

Sprint-3/implement/is-valid-triangle.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// STRETCH Implement a function isValidTriangle
1+
// Implement a function isValidTriangle
22
// Terms
33
// the Triangle Inequality says: the sum of any two sides is always greater than the third side.
44
// practical examples:
@@ -11,15 +11,11 @@
1111
// It's also true that b + c > a
1212
// It's also true that a + c > b
1313

14-
// In our function isValidTriangle, we need to invalidate any triangle where the sum of any two sides is less than or equal to the length of the third side.
14+
// In our function isValidTriangle which takes as parameters the lengths of three sides, we need to invalidate any triangle where the sum of any two sides is less than or equal to the length of the third side.
1515
// and we need to validate any triangle where the sum of any two sides is greater than the length of the third side.
1616

1717
// Acceptance criteria:
1818

19-
// Given the lengths of three sides of a triangle (a, b, c),
20-
// When the function isValidTriangle is called with these side lengths as input,
21-
// Then it should:
22-
2319
// scenario: invalid triangle
2420
// Given the side lengths a, b, and c,
2521
// When the sum of any two side lengths is less than or equal to the length of the third side (i.e., a + b <= c, a + c <= b, b + c <= a),

Sprint-3/implement/rotate-char.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88

99
// Acceptance criteria:
1010

11-
// Given a character (char) and a shift value (shift),
11+
// Given a character and a shift value,
1212
// When the function rotateCharacter is called with these inputs,
1313
// Then it should:
1414

1515
// Scenario: Rotate Lowercase Letters:
16-
// Given a lowercase letter character (char) and a positive integer shift,
16+
// Given a lowercase letter character and a positive integer shift,
1717
// When the function is called with these inputs,
1818
// Then it should rotate the lowercase letter by shift positions within the lowercase alphabet, wrapping around if necessary, and return the rotated lowercase letter as a string.
1919
console.log(rotateCharacter("a", 3)); // Output: "d"
20-
console.log(rotateCharacter("f", 1)); // Output: "f"
20+
console.log(rotateCharacter("f", 1)); // Output: "g"
2121

2222
// Scenario: Rotate Uppercase Letters:
23-
// Given an uppercase letter character (char) and a positive integer shift,
23+
// Given an uppercase letter character and a positive integer shift,
2424
// When the function is called with these inputs,
2525
// Then it should rotate the uppercase letter by shift positions within the uppercase alphabet, wrapping around if necessary, and return the rotated uppercase letter as a string.
2626
console.log(rotateCharacter("A", 3)); // Output: "D"
2727
console.log(rotateCharacter("F", 1)); // Output: "G"
2828

2929
// Scenario: Leave Non-Letter Characters Unchanged:
30-
// Given a character (char) that is not a letter (neither uppercase nor lowercase) and any positive or negative shift value,
30+
// Given a character that is not a letter (neither uppercase nor lowercase) and any positive or negative shift value,
3131
// When the function is called with these inputs,
3232
// Then it should return the character unchanged.
3333
// This specification outlines the behavior of the rotateCharacter function for different input scenarios, including valid and invalid characters, and defines the expected output or action for each case.
@@ -39,4 +39,5 @@ console.log(rotateCharacter("7", 5)); // Output: "7" (unchanged, not a letter)
3939
// When the rotateCharacter function is called with char and shift as inputs,
4040
// Then it should correctly rotate the character by shift positions within the alphabet while handling the wraparound,
4141
// And the function should return the rotated character as a string (e.g., 'z' rotated by 3 should become 'c', 'Z' rotated by 3 should become 'C').
42-
console.log(rotateCharacter("z", 1)); // Output: "a" (unchanged, not a letter)
42+
console.log(rotateCharacter("z", 1)); // Output: "a" (preserves case, but wraps around)
43+
console.log(rotateCharacter("Y", 2)); // Output: "A" (preserves case, but wraps around)

Sprint-3/readme.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
# 🧭 Guide to week 3 exercises
22

3-
## 🐛 Debug
4-
5-
First off, `format-as-12-hours.js` has a 🐛.
6-
7-
a) Write an assertion to check the output of `formatAs12HourClock` when it is called with an input `"17:42"`
8-
b) Check the assertion output and try to explain what the bug is
9-
10-
You'll need to go back and look at some of the functions you implemented in week 2 - write down some assertions to check the functions:
11-
12-
- Write some assertions down for the function
13-
14-
## 🧹 Refactor
15-
16-
In these problems, you'll be _given_ an implementation and then asked to change it. Once you've updated the implementations you'll need to double check that they are still working!
17-
183
## 🔧 Implement
194

205
In the `implement` directory you've got a number of functions you'll need to implement.
216
For each function, you also have a number of different cases you'll need to check for your function.
227

23-
Use the acceptance criteria as an aid to **_write assertions_** for the different cases using `console.assert`. Use your assertions to check the functionality you're building as you go along.
8+
Use the acceptance criteria as an aid to **_write tests_** for the different cases using Jest. Use your assertions to check the functionality you're building as you go along. Make sure you cover all edge-cases.
249

2510
Here is a recommended order:
2611

2712
1. `get-angle-type.js`
2813
1. `is-proper-fraction.js`
2914
1. `get-card-value.js`
3015
1. `is-valid-triangle.js`
31-
32-
## 💪 Stretch
33-
34-
Implement `rotateChar` as defined in `implement/rotate-char`
16+
1. `implement/rotate-char`

Sprint-3/refactor/format-as-12-hours.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

Sprint-3/refactor/is-vowel.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)