Skip to content

Commit 8ff2409

Browse files
authored
Merge branch 'code-differently:main' into main
2 parents 1ba33e9 + 3d65265 commit 8ff2409

File tree

6 files changed

+155
-7
lines changed

6 files changed

+155
-7
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9-
9+
brooklynharden:
10+
- $2y$10$FMRsdjEhIG0anbZOIcVvSOy4e4eFTZGIYYyATChwc.QRMpWuomR5C
11+
- $2y$10$0AQW/94c4pPxp8xIhJUIs.qoLnUuQg/Hwe1vd4975K96EKGEPz.H6
12+
- $2y$10$ibNpd6ZjWh/yRXafaN8R5.vxbBw7KVZ7r4IsFv4Uy3naXqagr2B5W
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class BrooklynHardenQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'brooklynharden';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
BrooklynHardenQuiz.makeQuestion0(),
16+
BrooklynHardenQuiz.makeQuestion1(),
17+
BrooklynHardenQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
"What does 'git checkout -b (your-branch-name)' do?",
25+
new Map<AnswerChoice, string>([
26+
[
27+
AnswerChoice.A,
28+
'Deletes the current branch and switches to a new one',
29+
],
30+
[AnswerChoice.B, 'Creates a new branch and merges it immediately'],
31+
[
32+
AnswerChoice.C,
33+
'Creates a new branch, while also switching to that current branch just made',
34+
],
35+
[
36+
AnswerChoice.D,
37+
'Switches to an existing branch without creating a new one',
38+
],
39+
]),
40+
AnswerChoice.UNANSWERED,
41+
); // Replace `UNANSWERED` with the correct answer.
42+
}
43+
44+
private static makeQuestion1(): QuizQuestion {
45+
return new MultipleChoiceQuizQuestion(
46+
1,
47+
'Why Do We Branch?',
48+
new Map<AnswerChoice, string>([
49+
[
50+
AnswerChoice.A,
51+
'To delete unused features, to simplify project structure, and to consolidate all tasks',
52+
],
53+
[
54+
AnswerChoice.B,
55+
'To merge all features into one branch, to finalize changes permanently, and to streamline the main project',
56+
],
57+
[
58+
AnswerChoice.C,
59+
'To implement major updates directly, to skip testing, and to ignore project stability',
60+
],
61+
[
62+
AnswerChoice.D,
63+
'To work on features or fix without affecting others, to test or deploy changes safely, and to experiment without breaking the main project',
64+
],
65+
]),
66+
AnswerChoice.UNANSWERED,
67+
); // Replace `UNANSWERED` with the correct answer.
68+
}
69+
70+
private static makeQuestion2(): QuizQuestion {
71+
return new MultipleChoiceQuizQuestion(
72+
2,
73+
'A version control system(VCS) that helps keep track of changes made to files, directories, and folders. It helps you save versions, create branches to try new ideas, and its fast and great for teams',
74+
new Map<AnswerChoice, string>([
75+
[AnswerChoice.A, 'Git'],
76+
[AnswerChoice.B, 'VS Code'],
77+
[AnswerChoice.C, 'GitHub'],
78+
[AnswerChoice.D, 'XCODE'],
79+
]),
80+
AnswerChoice.UNANSWERED,
81+
); // Replace `UNANSWERED` with the correct answer.
82+
}
83+
}

lesson_03/quiz/src/quizzes/quizzes.module.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { BrooklynHardenQuiz } from './brooklyn_harden_quiz.js';
45
export const Quizzes = Symbol.for('Quizzes');
56

67
// Add your quiz provider here.
78

8-
const QUIZ_PROVIDERS = [
9-
AnthonyMaysQuiz,
10-
AnotherQuiz,
11-
12-
];
9+
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, BrooklynHardenQuiz];
1310

1411
@Module({
1512
providers: [

lesson_04/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,13 @@ Please review the following resources before lecture:
99

1010
## Homework
1111

12-
- TODO(anthonydmays): Add homework details.
12+
- [ ] Do [coding exercise](#writing-some-code).
13+
- [ ] Do pre-work for [lesson 05](/lesson_05/).
14+
15+
### Writing some code
16+
17+
For this assignment, you will need to write code that determines whether a number is a prime number. You will produce code in two different languages, then provide a 100+ word write up about the similarities and differences between the two implementations you made. An example is provided in the [anthonydmays/](./anthonydmays/) folder.
18+
19+
### Stretch
20+
21+
In addition to writing the code, you will need to also create working, runnable unit tests for your function.

lesson_04/anthonydmays/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Python implementation
2+
3+
```python
4+
def is_even(number):
5+
return number % 2 == 0
6+
7+
# Example usage:
8+
print(is_even(4)) # Output: True
9+
print(is_even(7)) # Output: False
10+
```
11+
12+
## JavaScript implementation
13+
14+
```javascript
15+
function isEven(number) {
16+
return number % 2 === 0;
17+
}
18+
19+
// Example usage:
20+
console.log(isEven(4)); // Output: true
21+
console.log(isEven(7)); // Output: false
22+
```
23+
24+
## Explanation
25+
26+
The Python implementation uses a function named `is_even` that takes a single argument `number`. It returns `True` if the number is even (i.e., when the remainder of the division of the number by 2 is zero), otherwise, it returns `False`.
27+
28+
The JavaScript implementation uses a function named `isEven` that also takes a single argument `number`. It returns `true` if the number is even (using the same logic as the Python function) and `false` otherwise.
29+
30+
### Differences
31+
32+
1. **Syntax**:
33+
- In Python, functions are defined using the `def` keyword, whereas in JavaScript, the `function` keyword is used.
34+
- Python uses `True` and `False` for boolean values, while JavaScript uses `true` and `false`.
35+
36+
2. **Type Coercion**:
37+
- JavaScript has type coercion, which can sometimes lead to unexpected results if the input is not properly handled. In contrast, Python is more strict with types.
38+
39+
3. **Function Calls**:
40+
- The syntax for calling functions and printing to the console/output is slightly different. Python uses `print()`, while JavaScript uses `console.log()`.

lesson_05/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Lesson 05: Software Development Life Cycle ([Slides](https://code-differently.github.io/code-society-25-2/slides/#/lesson_05))
2+
3+
## Pre-work
4+
5+
Please review the following resources before lecture:
6+
7+
### Required
8+
* [Software Development Life Cycle: Explained (Video)](https://www.youtube.com/watch?v=SaCYkPD4_K0)
9+
* [What is the "best way" to develop software applications? (Video)](https://www.youtube.com/watch?v=oNmcX6Gozg0)
10+
11+
### Recommended
12+
* [User stories with examples and a template](https://www.atlassian.com/agile/project-management/user-stories)
13+
14+
## Homework
15+
16+
- TODO(anthonydmays): Add moar detailz.

0 commit comments

Comments
 (0)