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
* 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.
Copy file name to clipboardExpand all lines: Sprint-3/implement/get-card-value.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
// Acceptance criteria:
8
8
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),
10
10
// When the function getCardValue is called with this card string as input,
Copy file name to clipboardExpand all lines: Sprint-3/implement/is-valid-triangle.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
// STRETCH Implement a function isValidTriangle
1
+
// Implement a function isValidTriangle
2
2
// Terms
3
3
// the Triangle Inequality says: the sum of any two sides is always greater than the third side.
4
4
// practical examples:
@@ -11,15 +11,11 @@
11
11
// It's also true that b + c > a
12
12
// It's also true that a + c > b
13
13
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.
15
15
// and we need to validate any triangle where the sum of any two sides is greater than the length of the third side.
16
16
17
17
// Acceptance criteria:
18
18
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
-
23
19
// scenario: invalid triangle
24
20
// Given the side lengths a, b, and c,
25
21
// 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),
Copy file name to clipboardExpand all lines: Sprint-3/implement/rotate-char.js
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,26 @@
8
8
9
9
// Acceptance criteria:
10
10
11
-
// Given a character (char) and a shift value (shift),
11
+
// Given a character and a shift value,
12
12
// When the function rotateCharacter is called with these inputs,
13
13
// Then it should:
14
14
15
15
// 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,
17
17
// When the function is called with these inputs,
18
18
// 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.
// Given an uppercase letter character (char) and a positive integer shift,
23
+
// Given an uppercase letter character and a positive integer shift,
24
24
// When the function is called with these inputs,
25
25
// 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.
// 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,
31
31
// When the function is called with these inputs,
32
32
// Then it should return the character unchanged.
33
33
// 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)
39
39
// When the rotateCharacter function is called with char and shift as inputs,
40
40
// Then it should correctly rotate the character by shift positions within the alphabet while handling the wraparound,
41
41
// 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)
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
-
18
3
## 🔧 Implement
19
4
20
5
In the `implement` directory you've got a number of functions you'll need to implement.
21
6
For each function, you also have a number of different cases you'll need to check for your function.
22
7
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.
24
9
25
10
Here is a recommended order:
26
11
27
12
1.`get-angle-type.js`
28
13
1.`is-proper-fraction.js`
29
14
1.`get-card-value.js`
30
15
1.`is-valid-triangle.js`
31
-
32
-
## 💪 Stretch
33
-
34
-
Implement `rotateChar` as defined in `implement/rotate-char`
0 commit comments