Compare commits

...

149 Commits

Author SHA1 Message Date
sagarishere 3072fab667
Merge 4e896384c8 into 2f7977a95a 2024-09-18 16:39:24 +03:00
Oumaima Fisaoui 2f7977a95a Chore(AI): Fix sp500 subject and audit 2024-09-09 09:58:11 +01:00
Oumaima Fisaoui 1d34ea0a71 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 75472c0ed6 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui cccab05477 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui aa54ab1e66 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 62486ed720 Chore(DPxAI): Fix the accuracy on test set 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 659074232f Chore(AI): Fix emotions detector 2024-09-06 11:18:31 +01:00
oumaimafisaoui 9c9adb1c88 Fix(Pipeline): Fix irradiat attribute values 2024-09-05 14:49:00 +01:00
oumaimafisaoui 00813d29e9 Fix(Pipeline): fix formatting 2024-09-05 14:49:00 +01:00
oumaimafisaoui fe5f82edcf Fix(Pipeline): fix datafile data info and example do not match 2024-09-05 14:49:00 +01:00
Harry f26da6368e
feat(template): question / potential-issue 2024-09-04 19:53:01 +01:00
Harry 4a8287754d
chore(template): change bug emoji 2024-09-04 19:36:24 +01:00
Abdelhak ELYakoubi b0d041741d
CON-2931 Resolve missing assets for `stealth-boom` project (#2705)
* CON-2931 <Refined Stealth-boom subject and audit, and provided a file that contains assets>

* CON-2931 <Prettier formatting applied>

* CON-2931 chore(stealth-boom) removed uppercase characters from link

* CON-2931 docs(stealth-boom) added scenario and added image

* CON-2931 fix(stealth-boom) added review suggestions and rephrased some poorly written sentences

* CON-2931 fix(stealth-boom) added more review changes and refactored some sentences for clarity

* CON-2931 fix(stealth-boom) removed extra '#' from all headers in audit
2024-09-04 16:32:22 +01:00
Oumaima Fisaoui 6003e18e50 Chore(DPxAI): format 2024-09-04 10:56:11 +01:00
Oumaima Fisaoui 718dabf423 Chore(DPxAI): change prompt engineering 2024-09-04 10:56:11 +01:00
Oumaimafisaoui 2b8dd0028b Chore(DPxAI): Make all AI powered learning sections unified 2024-09-04 10:56:11 +01:00
Oumaima Fisaoui c93a142538 Chore(DPxAI): Fix format 2024-09-04 09:23:50 +01:00
Oumaima Fisaoui bb5d83fa41 Chore(DPxAI): Fix format 2024-09-04 09:23:50 +01:00
Oumaima Fisaoui 2a52ae33f4 Chore(DPxAI): fix format 2024-09-04 09:23:50 +01:00
Oumaima Fisaoui 2b2c86b17b Chore(DPxAI): Fix format 2024-09-04 09:23:50 +01:00
Oumaimafisaoui c5a9980f52 Chore(DPxAI): Add play with variables 2024-09-04 09:23:50 +01:00
oumaimafisaoui 9afa861f7a Fix(DPxAI): Fix fromatting 2024-09-04 09:23:50 +01:00
oumaimafisaoui 37495c5749 Chore(DPxAI): Applied suggested changes on text formats 2024-09-04 09:23:50 +01:00
oumaimafisaoui 17c3fc112b Chore(Quest01/Ex02): formatting 2024-09-04 09:23:50 +01:00
oumaimafisaoui 63f9f4aed5 Chore(Quest01/Ex02): unify text 2024-09-04 09:23:50 +01:00
oumaimafisaoui 6c1fa67d5a Chore(Quest01/Ex02): add challenge mode and fix power variable 2024-09-04 09:23:50 +01:00
oumaimafisaoui fbb83dc02a Chore(DPxAI): add solution for play with variables 2024-09-04 09:23:50 +01:00
dependabot[bot] 3c6e198cda Chore(deps): Bump flask-cors
Bumps [flask-cors](https://github.com/corydolphin/flask-cors) from 4.0.1 to 5.0.0.
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/main/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/4.0.1...5.0.0)

---
updated-dependencies:
- dependency-name: flask-cors
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 17:53:05 +01:00
Oumaimafisaoui 24f188ae79 Chore(DPxAI): Fix typo 2024-09-03 13:34:37 +01:00
Oumaimafisaoui a53b9b2654 Test(glance-on-power): changed Hello There ! to Hello There 2024-09-03 13:34:37 +01:00
oumaimafisaoui 411220450c Docs(DPxAI): Fix project instructions 2024-09-02 15:07:19 +01:00
Oumaima Fisaoui 63ae88eafd Chore(DPxAI): Add audit file 2024-09-02 10:46:10 +01:00
Oumaima Fisaoui ec6f121a16 Chore(DPxAI): Add video link 2024-09-02 09:48:06 +01:00
Oumaima Fisaoui a0c81a10c3 Chore(DPxAI): fix all instructions for the subject, still lacking video 2024-09-02 09:48:06 +01:00
Toussaint Louis bd83c52042 Fix(DPxAI): Add subject instructions to submit 2024-09-02 09:48:06 +01:00
oumaimafisaoui 8a9c12dbe0 Chore(AI): Fix subjects issues 2024-09-02 09:48:06 +01:00
oumaimafisaoui 81d71a3c9e Chore(AI): Fix subjects issues 2024-09-02 09:48:06 +01:00
oumaimafisaoui ee0a5e0c20 Fix(DPxAI): Add subject instructions 2024-09-02 09:48:06 +01:00
oumaimafisaoui 0a37843a07 Fix(DPxAI): Add subject instructions 2024-09-02 09:48:06 +01:00
oumaimafisaoui 4887abc7b4 Fix(DPxAI): Add subject instructions 2024-09-02 09:48:06 +01:00
oumaimafisaoui 93c7605b47 Fix(DPxAI): Add subject instructions 2024-09-02 09:48:06 +01:00
oumaimafisaoui e9849dd4d2 Fix(DPxAI): Add subject for robots harmony 2024-09-02 09:48:06 +01:00
oumaimafisaoui 48e8c227b2 Fix(DPxAI): Fix sections order 2024-08-30 16:02:25 +01:00
Toussaint Louis 33a8403283 Chore(DPxAI): Add expected output video 2024-08-30 16:02:25 +01:00
oumaimafisaoui 956bfad603 Chore(DPxAI): Fix issue 2024-08-30 16:02:25 +01:00
oumaimafisaoui f8e1ea8fcb Chore(DPxAI): Modify subject 2024-08-30 16:02:25 +01:00
oumaimafisaoui 503fa1c3f3 Docs(DPxAI): Add subject for colorful arms 2024-08-30 16:02:25 +01:00
Toussaint Louis ed71296b4e Chore(DPxAI): Add expected output video 2024-08-30 16:02:04 +01:00
Oumaima Fisaoui a4824989b2 Chore(DPxAI): Fix issue 2024-08-30 16:02:04 +01:00
Oumaima Fisaoui e04dc7ed10 Chore(DPxAI): Modify the subject 2024-08-30 16:02:04 +01:00
oumaimafisaoui 447f621015 Docs(DPxAI): add subject for colorful-legs 2024-08-30 16:02:04 +01:00
oumaimafisaoui 88e5054db1 Fix(DPxAI): Fix sections order 2024-08-30 16:01:37 +01:00
Toussaint Louis 80d17b2438 Chore(DPxAI): Add expected output video 2024-08-30 16:01:37 +01:00
oumaimafisaoui ea64109446 Chore(DPxAI): Fix issues in subject and add the prompt example part 2024-08-30 16:01:37 +01:00
oumaimafisaoui 8ce131785b Chore(DPxAI): Fix issues in subject and add the prompt example part 2024-08-30 16:01:37 +01:00
oumaimafisaoui 7753fdf999 Docs(DPxAI): Add subject for first-hello 2024-08-30 16:01:37 +01:00
Oumaima Fisaoui 31e181635d Chore(DPxAI): add teh smooth operator 2024-08-30 15:57:10 +01:00
Toussaint Louis 70ff5b2e41 Chore(DPxAI): Add expected output video 2024-08-30 15:34:53 +01:00
oumaimafisaoui 3e0ca8cc7a Chore(DPxAI): Fix format 2024-08-30 15:34:53 +01:00
oumaimafisaoui f6aaddc546 Chore(DPxAI): Remove second subject 2024-08-30 15:34:53 +01:00
oumaimafisaoui 2d3bc61233 Chore(DPxAI): Fix formatting for first wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui 53832cff9d Chore(DPxAI): Fix formatting for first wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui 8332f2c136 Chore(DPxAI): Fix instructions for first wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui 03c1c6506b Docs(DPxAI): Modify subject for first-wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui e985d3fbce Docs(DPxAI): Modify subject for first-wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui 38895e7b8f Doc(DPxAI): Modify subject for first-wink 2024-08-30 15:34:53 +01:00
oumaimafisaoui 46b5506344 Doce(DPxAI): Add subject for first-wink 2024-08-30 15:34:53 +01:00
Oumaima Fisaoui e14fa73a97 Docs(DPxAI): Modify formatting 2024-08-30 15:01:24 +01:00
Oumaima Fisaoui cc984cbd2c Docs(DPxAI): Modify formatting 2024-08-30 15:01:24 +01:00
oumaimafisaoui ac6e5e9cc0 Docs(DPxAI): Add subject for transform objects 2024-08-30 15:01:24 +01:00
Oumaima Fisaoui 4ed216e04c Chore(DPxAI): Fix format 2024-08-30 15:00:40 +01:00
Oumaima Fisaoui 45a203aab2 Docs(DPxAI): Fixed formatting issues 2024-08-30 15:00:40 +01:00
oumaimafisaoui 7beb8e54e7 Docs(DPxAI): Add subject for listed 2024-08-30 15:00:40 +01:00
Louis TOUSSAINT 9a849f359c Tests(DPxAI): upload test for quest02 first-hello 2024-08-30 14:50:29 +01:00
Louis TOUSSAINT 1aa9c5272c Tests(DPxAI): update test for quest02 colorful-legs 2024-08-30 14:49:59 +01:00
Louis TOUSSAINT 25533f14ee Tests(DPxAI): upload test for quest02 colorful-legs 2024-08-30 14:49:59 +01:00
Louis TOUSSAINT 0b6294560b Tests(DPxAI): upload test for quest02 first-wink 2024-08-30 14:49:19 +01:00
Louis TOUSSAINT b64a14f9aa Tests(DPxAI): update test for quest01 i-win-arguments 2024-08-30 14:48:07 +01:00
Louis TOUSSAINT 1ab6d55fdb Tests(DPxAI): upload test for quest01 i-win-arguments 2024-08-30 14:48:07 +01:00
Louis TOUSSAINT 7d7229c950 Tests(DPxAI): upload test for quest01 first-function 2024-08-30 14:44:49 +01:00
Louis TOUSSAINT 361c6fdd9e Tests(DPxAI): upload test for quest02 colorful-arms 2024-08-30 14:07:09 +01:00
Louis TOUSSAINT 009290fc91 Tests(DPxAI): upload test for quest01 star-forge 2024-08-30 14:06:37 +01:00
Louis TOUSSAINT 79eaa3f5ea Tests(DPxAI): upload test for quest01 only-if 2024-08-30 14:05:42 +01:00
Louis TOUSSAINT 96b04464c2 Tests(DPxAI): upload test for quest01 good-recipe 2024-08-30 14:05:26 +01:00
Louis TOUSSAINT 671a96746b Tests(DPxAI): Upload test for quest01 listed 2024-08-30 14:04:59 +01:00
Louis TOUSSAINT dbeaeaaf67 Tests(DPxAI): Upload test for quest01 transform-objects 2024-08-30 14:04:37 +01:00
Louis TOUSSAINT 52dc2a61dc Tests(DPxAI): update test for quest01 objects-around 2024-08-30 14:04:07 +01:00
Louis TOUSSAINT 6ad51aa66e Tests(DPxAI): WIP Upload test for quest01 objects-around 2024-08-30 14:04:07 +01:00
Louis TOUSSAINT a7b2fc47ad Tests(DPxAI): Update test for Quest01 play-with-variables 2024-08-30 14:03:40 +01:00
Toussaint Louis 326acc6ab1 Tests(DPxAI): Update play-with-variables.json 2024-08-30 14:03:40 +01:00
Toussaint Louis 75c8c6be67 Tests(DPxAI): Rename play-with-variables_test.json to play-with-variables.json 2024-08-30 14:03:40 +01:00
Louis TOUSSAINT df995dbdcb Tests(DPxAI): Add test for Quest01 play-with-variables 2024-08-30 14:03:40 +01:00
Louis TOUSSAINT 36dbea717d Tests(DPxAI): Update test for Quest01 ex 03 2024-08-30 14:02:13 +01:00
Toussaint Louis a3d6fc4141 Tests(DPxAI): Rename the-smooth-operator_test.json to the-smooth-operator.json 2024-08-30 14:02:13 +01:00
Louis TOUSSAINT b330c72195 Tests(DPxAI): Add test for Quest01 the-smooth-operator 2024-08-30 14:02:13 +01:00
Toussaint Louis 4df4de9469 Tests(DPxAI): Rename declare-everything_test.json to declare-everything.json 2024-08-30 14:01:34 +01:00
Louis TOUSSAINT e61be9ae6a Tests(DPxAI): Add test for Quest01 declare-everything 2024-08-30 14:01:34 +01:00
Oumaima Fisaoui 96f2467189 Docs(DPxAI): fix issues with formatting and change 2024-08-29 18:54:17 +01:00
Oumaima Fisaoui d35b2015d3 Chore(Quest01/objects-around): Modified case" 2024-08-29 18:54:17 +01:00
oumaimafisaoui 5ac6fc8b4e Chore(Quest01/objects-around): Changed in the first task the name of the object from robot to MyRobot 2024-08-29 18:54:17 +01:00
oumaimafisaoui 3e1cd3f7a8 Docs(Quest01/Ex04): Add subject for objects around 2024-08-29 18:54:17 +01:00
oumaimafisaoui f7cda6c219 Chore(DPxAI): fixed formatting 2024-08-29 18:48:38 +01:00
oumaimafisaoui 73cb5552e9 Chore(DPxAI): fixed formatting 2024-08-29 18:48:38 +01:00
oumaimafisaoui 09e24ff227 Chore(Quest01/good-recipe): Fix Formatting 2024-08-29 18:48:38 +01:00
oumaimafisaoui 8fbe99162b Chore(Quest01/good-recipe): Formatting 2024-08-29 18:48:38 +01:00
oumaimafisaoui 9d8167f452 Chore(Quest01/good-recipe): Added Subject 2024-08-29 18:48:38 +01:00
oumaimafisaoui 365596523f Chore(Quest01/good-recipe): Added Subject 2024-08-29 18:48:38 +01:00
oumaimafisaoui 264b4868fd Docs(only-if): Add the subject for only-if 2024-08-29 18:43:38 +01:00
oumaimafisaoui 5d2bb26e22 Docs(only-if): Add the subject for only-if 2024-08-29 18:43:38 +01:00
oumaimafisaoui 9447087e19 Docs(only-if): Add subject for only-if 2024-08-29 18:43:38 +01:00
oumaimafisaoui 5eb483d646 Chore(DPxAI): Fix errors and make the instructions clear 2024-08-29 18:42:06 +01:00
Oumaima Fisaoui b9340a40a1 chore(DPxAI): fix link 2024-08-29 18:42:06 +01:00
Oumaima Fisaoui 88cedccadd Chore(DPxAI): Add video ressource 2024-08-29 18:42:06 +01:00
oumaimafisaoui 9f888365f5 Docs(DPxAI): add subject 2024-08-29 18:42:06 +01:00
oumaimafisaoui fa9b7b792e Chore(DPxAI): Fix errors and make the instructions clear 2024-08-29 18:41:34 +01:00
oumaimafisaoui a5eba0ed24 Chore(DPxAI): add subject for in win agruments 2024-08-29 18:41:34 +01:00
oumaimafisaoui 04eb4c3d24 Fix(DPxAI): Fix subject 2024-08-29 02:21:04 +01:00
oumaimafisaoui 87ad4b552a Chore(DPxAI): fixed typo 2024-08-29 02:21:04 +01:00
oumaimafisaoui 8ae7304d34 Docs(star-forge): changed task to the subject, and fixed typos and formatting 2024-08-29 02:21:04 +01:00
oumaimafisaoui ab5cec0078 Docs(star-forge): Added a task to the subject, and fixed typos and formatting 2024-08-29 02:21:04 +01:00
oumaimafisaoui 7367388da8 Docs(star-forge): Added a task to the subject, and fixed typos 2024-08-29 02:21:04 +01:00
oumaimafisaoui c6df288e18 Chore(Quest01/EX00): Add challenge mode 2024-08-29 02:21:04 +01:00
oumaimafisaoui 7a45f6b689 Chore(Quest01): Formatting subject 2024-08-29 02:21:04 +01:00
oumaimafisaoui b6704e6717 Chore(Quest01): Formatting subject 2024-08-29 02:21:04 +01:00
oumaimafisaoui ead7dcadfc Chore(DPxAI): add solution for star forge 2024-08-29 02:21:04 +01:00
oumaimafisaoui 48f09725c8 Fix(DPxAI): Fix format 2024-08-27 14:23:10 +01:00
oumaimafisaoui ca4528a113 Fix(DPxAI): Fix format 2024-08-27 14:23:10 +01:00
oumaimafisaoui 8b30886680 Fix(DPxAI): Fix format 2024-08-27 14:23:10 +01:00
oumaimafisaoui c3c20faf63 Fix(DPxAI): Problem in subject 2024-08-27 14:23:10 +01:00
oumaimafisaoui f98b491d31 Docs(declare-everything): Prettier format for subject 2024-08-27 12:33:37 +01:00
oumaimafisaoui bdc26dd43f Chore(DPxAI): Fixed prompt section format 2024-08-27 12:33:37 +01:00
oumaimafisaoui 9f91947dea Chore(Quest00/Ex01): Added challenge mode and unified format 2024-08-27 12:33:37 +01:00
oumaimafisaoui 81d4af893a Chore(Quest01): Formatting subject 2024-08-27 12:33:37 +01:00
oumaimafisaoui a035c55c10 Chore(Quest01): Formatting subject 2024-08-27 12:33:37 +01:00
oumaimafisaoui c57b618208 Docs(Quest01): Added subject for declare everything 2024-08-27 12:33:37 +01:00
Zouhair AMAZZAL 65d3eeec08 CON-3103 docs(pentest-kit) improve the subject quality 2024-08-26 15:16:22 +03:00
Zouhair AMAZZAL d3b5db8460 CON-3103 feat(pentest-kit) add cyber security project 2024-08-26 15:16:22 +03:00
Zouhair AMAZZAL a02164e78d CON-3040 docs: fix languages issues 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 4a9f3ab4de CON-3040 recover the passive folder 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 71ebebb2d3 CON-3040 fmt(osint-master) improve the subject and audit 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL a67dfb7870 CON-3040 fmt(osint-master) improve the subject and audit 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 83e7c14b9a CON-3040 fmt(osint-master) improve the subject and audit 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 9d830bd3f8 CON-3040 style:(osint-master) improve format 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL d184ab95e8 CON-3040 feat:(osint-master) add audit for the project 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 09723f5ff8 CON-3040 feat(osint-master) free-lang choice 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 7cb086f365 CON-3040 feat(osint-master) improve language 2024-08-17 14:21:08 +03:00
Zouhair AMAZZAL 94dc18d7c7 CON-3040 feat(osint-master) remake the passive project subject 2024-08-17 14:21:08 +03:00
sagarishere 4e896384c8
add strings to forbidden
every exercise can currently be solved by using strings for example

` strings bin | grep "modified"` 

to give the message required to complete the exercise.

However, that technique will teach us nothing about binary inspection, reverse engineering or binary manipulation.
2024-02-29 17:12:34 +02:00
53 changed files with 3469 additions and 171 deletions

View File

@ -1,8 +1,8 @@
---
name: 🐛 Bug report
name: 🐞 Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: "🐛 bug"
labels: "🐞 bug"
assignees: ""
---

View File

@ -0,0 +1,26 @@
---
name: 🙋 Question / Potential Issue
about: Ask a question or report a potential issue that isn't clearly a bug or a feature request
title: "[QUESTION] "
labels: "🙋 question"
assignees: ""
---
**Describe your question or potential issue**
A clear and concise description of your question or the potential issue you have encountered.
**Context & Use Case**
Provide the context or the scenario in which this question or issue arises. Explain why this is important to understand or address.
**Steps taken**
List any steps you have taken to try and resolve the issue or answer the question:
1. Checked the documentation/readme...
2. Tried to reproduce the issue...
3. Searched for similar questions...
**Attachments**
If applicable, add any screenshots, logs, or additional information that could help explain your question or potential issue.
**Additional context**
Add any other details or context that might be relevant, including links to related issues or documentation.

52
dom/colorful-arms_test.js Normal file
View File

@ -0,0 +1,52 @@
export const tests = []
tests.push(async ({ eq, page }) => {
// Check if the button with id 'arm-color' exists
const buttonExists = await page.$('button#arm-color')
eq(!!buttonExists, true)
})
tests.push(async ({ eq, page }) => {
// Check if the left and right arms exist
const leftArmExists = await page.$('#arm-left')
const rightArmExists = await page.$('#arm-right')
eq(!!leftArmExists && !!rightArmExists, true)
})
tests.push(async ({ eq, page }) => {
// Get the initial background colors of the arms
const initialLeftArmColor = await page.$eval('#arm-left', node => getComputedStyle(node).backgroundColor)
const initialRightArmColor = await page.$eval('#arm-right', node => getComputedStyle(node).backgroundColor)
// Click the 'arm-color' button
const button = await page.$('button#arm-color')
await button.click()
// Get the new background colors of the arms after clicking the button
const newLeftArmColor = await page.$eval('#arm-left', node => getComputedStyle(node).backgroundColor)
const newRightArmColor = await page.$eval('#arm-right', node => getComputedStyle(node).backgroundColor)
// Check if the colors have changed and are now different from the initial colors
eq(initialLeftArmColor !== newLeftArmColor, true)
eq(initialRightArmColor !== newRightArmColor, true)
eq(newLeftArmColor, newRightArmColor) // Check if both arms have the same color
})
tests.push(async ({ eq, page }) => {
// Click the 'arm-color' button multiple times to ensure the colors keep changing
const button = await page.$('button#arm-color')
const armColors = []
for (let i = 0; i < 3; i++) {
await button.click()
const leftArmColor = await page.$eval('#arm-left', node => getComputedStyle(node).backgroundColor)
const rightArmColor = await page.$eval('#arm-right', node => getComputedStyle(node).backgroundColor)
armColors.push({ leftArmColor, rightArmColor })
}
// Check if the colors are different in each click
eq(new Set(armColors.map(c => c.leftArmColor)).size, armColors.length)
eq(new Set(armColors.map(c => c.rightArmColor)).size, armColors.length)
// Check if the arms always have the same color after each click
armColors.forEach(colorPair => eq(colorPair.leftArmColor, colorPair.rightArmColor))
})

34
dom/colorful-legs_test.js Normal file
View File

@ -0,0 +1,34 @@
export const tests = []
tests.push(async ({ eq, page }) => {
// Click on the button to change the robot's leg colors
const button = await page.$('button#leg-color')
await button.click()
// Get the new colors of both legs
const legLeftColor = await page.$eval('#leg-left', (node) => getComputedStyle(node).backgroundColor)
const legRightColor = await page.$eval('#leg-right', (node) => getComputedStyle(node).backgroundColor)
// Check if both legs have been assigned the same new color
eq(legLeftColor, legRightColor)
})
tests.push(async ({ eq, page }) => {
// Get the initial colors of the legs before clicking the button
const initialLegLeftColor = await page.$eval('#leg-left', (node) => getComputedStyle(node).backgroundColor)
const initialLegRightColor = await page.$eval('#leg-right', (node) => getComputedStyle(node).backgroundColor)
// Click on the button to change the robot's leg colors
const button = await page.$('button#leg-color')
await button.click()
// Get the new colors of both legs
const newLegLeftColor = await page.$eval('#leg-left', (node) => getComputedStyle(node).backgroundColor)
const newLegRightColor = await page.$eval('#leg-right', (node) => getComputedStyle(node).backgroundColor)
// Check if both legs have been assigned the same new color
eq(newLegLeftColor, newLegRightColor)
// Ensure the new color is different from the initial color
eq(newLegLeftColor !== initialLegLeftColor, true, 'The color of the legs should be different from the initial color')
})

56
dom/first-hello_test.js Normal file
View File

@ -0,0 +1,56 @@
export const tests = []
tests.push(async ({ eq, page }) => {
// Check if the class 'words' has been added in the CSS
await eq.css('.words', { textAlign: 'center', fontFamily: 'sans-serif' })
})
tests.push(async ({ eq, page }) => {
// Check if the torso element is initially empty
const isEmpty = await page.$eval('#torso', (node) => !node.children.length)
eq(isEmpty, true)
})
tests.push(async ({ eq, page }) => {
// Click on the button
const button = await page.$('button#speak-button')
await button.click()
// Check if a new text element is added in the torso
const torsoChildren = await page.$eval('#torso', (node) =>
[...node.children].map((child) => ({
tag: child.tagName,
text: child.textContent,
class: child.className,
})),
)
eq(torsoChildren, [textNode])
})
tests.push(async ({ eq, page }) => {
// Click a second time on the button
const button = await page.$('button#speak-button')
await button.click()
// Check if the text element is removed from the torso
const isEmpty = await page.$eval('#torso', (node) => !node.children.length)
eq(isEmpty, true)
})
tests.push(async ({ eq, page }) => {
// Click the button once more to ensure the text is added again
const button = await page.$('button#speak-button')
await button.click()
// Check if a new text element is added in the torso
const torsoChildren = await page.$eval('#torso', (node) =>
[...node.children].map((child) => ({
tag: child.tagName,
text: child.textContent,
class: child.className,
})),
)
eq(torsoChildren, [textNode])
})
const textNode = { tag: 'DIV', text: 'Hello World', class: 'words' }

45
dom/first-wink_test.js Normal file
View File

@ -0,0 +1,45 @@
export const tests = []
tests.push(async ({ eq, page }) => {
// check the initial class name of the eye left
const eyeLeft = await page.$eval('#eye-left', (node) => node.className)
eq(eyeLeft, 'eye')
// check that the text of the button says 'close'
const buttonText = await page.$eval('button', (node) => node.textContent)
eq(buttonText, 'Click to close the left eye')
})
tests.push(async ({ eq, page }) => {
// click the button to close the left eye
const button = await page.$('button')
button.click()
// check that the class has been added
await page.waitForSelector('#eye-left.eye.eye-closed', { timeout: 150 })
// check the background color has changed
await eq.$('#eye-left.eye.eye-closed', {
style: { backgroundColor: 'black' },
})
// check that the text of the button changed to 'open'
await eq.$('button', { textContent: 'Click to open the left eye' })
})
tests.push(async ({ eq, page }) => {
// click the button a second time to open the left eye
const button = await page.$('button')
button.click()
// check that the class has been removed
await page.waitForSelector('#eye-left.eye:not(.eye-closed)', { timeout: 150 })
// check the background color has changed
await eq.$('#eye-left.eye:not(.eye-closed)', {
style: { backgroundColor: 'red' },
})
// check that the text of the button changed to 'close'
await eq.$('button', { textContent: 'Click to close the left eye' })
})

View File

@ -0,0 +1,14 @@
[
{
"description": "As a number, seven value is 7",
"code": "equal(Number(seven), 7)"
},
{
"description": "As a number, seventySeven value is 77",
"code": "equal(Number(seventySeven), 77)"
},
{
"description": "Somehow, the type of seven and seventySeven value must be strings",
"code": "equal(typeof seven, 'string')\nequal(typeof seventySeven, 'string')"
}
]

View File

@ -0,0 +1,22 @@
[
{
"description": "ask is defined and is a function",
"code": "equal(typeof ask, 'function')"
},
{
"description": "reply is defined and is a function",
"code": "equal(typeof reply, 'function')"
},
{
"description": "ask works and is called",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args[0], ['What is my purpose ?'])"
},
{
"description": "reply works and is called too",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args, [['What is my purpose ?'], ['You pass butter.']])"
},
{
"description": "calling reply and ask again relog the text.",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args[1], ['You pass butter.'])"
}
]

View File

@ -12,7 +12,7 @@
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nconst typeOfLoggedValues = args.flat().map((v) => typeof v)\nif (!typeOfLoggedValues.includes('string')) {\n throw Error('you must log a string')\n}"
},
{
"description": "Log the string Hello There ! in the console",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nconst loggedValues = args.flat().join(' ')\nif (!loggedValues.includes('Hello There !')) {\n throw Error('you must log the text Hello There !')\n}"
"description": "Log the string Hello There! in the console",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nconst loggedValues = args.flat().join(' ')\nif (!loggedValues.includes('Hello There!')) {\n throw Error('you must log the text Hello There!')\n}"
}
]

50
js/tests/good-recipe.json Normal file
View File

@ -0,0 +1,50 @@
[
{
"description": "Should work on mixed case",
"code": "let message = 'YoU cAn CaLl Me YoUr MaJeStY!'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\n\n// Your code\n\nequal(noCaps, 'you can call me your majesty!')\nequal(allCaps, 'YOU CAN CALL ME YOUR MAJESTY!')"
},
{
"description": "Should work on mixed case",
"code": "let message = `DoN'T tAlK aBoUt My MoMs, Yo`\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\n\n// Your code\n\nequal(noCaps, `don't talk about my moms, yo`)\nequal(allCaps, `DON'T TALK ABOUT MY MOMS, YO`)"
},
{
"description": "oldestAge is a number",
"code": "let kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(typeof oldestAge, 'number')"
},
{
"description": "oldestAge is the maximum value of the age property (martin)",
"code": "let kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(oldestAge, 32)"
},
{
"description": "oldestAge is still the maximum value of the age property (kevin)",
"code": "let kevin = { age: 67 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(oldestAge, 67)"
},
{
"description": "oldestAge is still the maximum value of the age property (stephanie)",
"code": "let kevin = { age: 29 }\nlet stephanie = { age: 45 }\nlet martin = { age: 32 }\nlet alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(oldestAge, 45)"
},
{
"description": "cutFirst from the latin alphabet",
"code": "let alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutFirst, 'klmnopqrstuvwxyz')"
},
{
"description": "cutFirst from the georgian alphabet",
"code": "let alphabet = 'აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰ'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutFirst, 'ლმნოპჟრსტუფქღყშჩცძწჭხჯჰ')"
},
{
"description": "cutLast from the latin alphabet",
"code": "let alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutLast, 'abcdefghijklmnopqrstuvw')"
},
{
"description": "cutLast from the greek alphabet",
"code": "let alphabet = 'αβγδεζηθικλμνξοπρστυφχψω'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutLast, 'αβγδεζηθικλμνξοπρστυφ')"
},
{
"description": "cutFirstLast from the latin alphabet",
"code": "let alphabet = 'abcdefghijklmnopqrstuvwxyz'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutFirstLast, 'fghijklmnopqrst')"
},
{
"description": "cutFirstLast from the armenian alphabet",
"code": "let alphabet = 'աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆուև'\nlet kevin = { age: 14 }\nlet stephanie = { age: 25 }\nlet martin = { age: 32 }\nlet message = 'YoU cAn CaLl Me YoUr MaJeStY!'\n\n// Your code\n\nequal(cutFirstLast, 'զէըթժիլխծկհձղճմյնշոչպջռսվտրցւփ')"
}
]

View File

@ -0,0 +1,66 @@
[
{
"description": "battleCry is defined and is a function",
"code": "equal(typeof battleCry, 'function')"
},
{
"description": "secretOrders is defined and is a function",
"code": "equal(typeof secretOrders, 'function')"
},
{
"description": "battleCry has one and only one argument",
"code": "equal(battleCry.length, 1)"
},
{
"description": "secretOrders has one and only one argument",
"code": "equal(secretOrders.length, 1)"
},
{
"description": "battleCry shouts properly",
"code": "const args = saveArguments(console, 'log')\n// Your code\n\nbattleCry('attack')\nbattleCry('you shall not pass!')\n\nequal(args.flat(), ['ATTACK', 'YOU SHALL NOT PASS!'])"
},
{
"description": "secretOrders whispers properly",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nsecretOrders('ExEcutE Order 66')\nsecretOrders('SILENCE')\n\nequal(args.flat(), ['execute order 66', 'silence'])"
},
{
"description": "We can call both functions",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nsecretOrders('This Is The WAY')\nbattleCry('for the horde !')\n\nequal(args.flat(), ['this is the way', 'FOR THE HORDE !'])"
},
{
"description": "duos is defined and is a function",
"code": "equal(typeof duos, 'function')"
},
{
"description": "duos takes two arguments",
"code": "equal(duos.length, 2)"
},
{
"description": "duos logs the expected result",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nduos('Batman', 'Robin')\nduos('Pinky', 'The Brain')\nduos('Bonnie', 'Clyde')\nduos('Mr.', 'Mrs.Smith')\n\nequal(\n args.map((arg) => arg.join(' ')),\n [\n 'Batman and Robin!',\n 'Pinky and The Brain!',\n 'Bonnie and Clyde!',\n 'Mr. and Mrs.Smith!',\n ],\n)"
},
{
"description": "duosWork is defined and is a function",
"code": "equal(typeof duosWork, 'function')"
},
{
"description": "duosWork takes three arguments",
"code": "equal(duosWork.length, 3)"
},
{
"description": "duosWork logs the expected result",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nduosWork('Batman', 'Robin', 'protect Gotham')\nduosWork('Pinky', 'The Brain', 'want to conquer the world')\nduosWork('Bonnie', 'Clyde', 'escape the Police')\nduosWork('Mr.', 'Mrs.Smith', 'are the greatest spy couple')\n\nequal(\n args.map((arg) => arg.join(' ')),\n [\n 'Batman and Robin protect Gotham!',\n 'Pinky and The Brain want to conquer the world!',\n 'Bonnie and Clyde escape the Police!',\n 'Mr. and Mrs.Smith are the greatest spy couple!',\n ],\n)"
},
{
"description": "passButter is defined and is a function",
"code": "equal(typeof passButter, 'function')"
},
{
"description": "passButter returns The butter properly",
"code": "equal(passButter(), 'The butter')"
},
{
"description": "calling passButter mulitple time should always return the butter",
"code": "equal(\n [passButter(), passButter(), passButter()],\n ['The butter', 'The butter', 'The butter'],\n)"
}
]

58
js/tests/listed.json Normal file
View File

@ -0,0 +1,58 @@
[
{
"description": "components variable must be an Array",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n\n// Your code\nif (!Array.isArray(components)) {\n throw Error('Season must be an Array')\n}"
},
{
"description": "components first element must be motor",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n// Your code\nequal(components[0].toLowerCase(), 'motor')\n"
},
{
"description": "components second element sensor",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n// Your code\nequal(components[1].toLowerCase(), 'sensor')\n"
},
{
"description": "components third element battery",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n// Your code\nequal(components[2].toLowerCase(), 'battery')\n"
},
{
"description": "components fourth element camera",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n// Your code\nequal(components[3].toLowerCase(), 'camera')\n"
},
{
"description": "components we must not have a fifth element",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet swapComponents = ['motor', 'battery']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\n// Your code\nequal(components[4], undefined)\n"
},
{
"description": "firstPart is the value of the first element",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'battery',\n 'camera',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(firstPart, 'motor')\n"
},
{
"description": "firstPart is the value of the first element even if we change the list",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'sensor',\n 'motor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(firstPart, 'sensor')\n"
},
{
"description": "lastPart is the value of the last element",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'battery',\n 'camera',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(lastPart, 'camera')\n"
},
{
"description": "lastPart is the value of the last element even if we change the list",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'sensor',\n 'motor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(lastPart, 'battery')\n"
},
{
"description": "comboParts is an array of lastPart and firstPart",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'battery',\n 'camera',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(comboParts, ['camera', 'motor'])\n"
},
{
"description": "comboParts is an array of lastPart and firstPart even if we change the list",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'sensor',\n 'motor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(comboParts, ['battery', 'sensor'])\n"
},
{
"description": "replaceComponents third element is 'enhanced'",
"code": "\n\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\nconst swapComponents = ['sensor', 'battery', 'motor']\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\n\n// Your code\n\nequal(replaceComponents, ['sensor', 'battery', 'enhanced', 'brain'])\n"
},
{
"description": "1st and 2nd elements of swapComponents are swapped pif,paf,pom",
"code": "\n\nconst replaceComponents = ['sensor', 'battery', 'motor', 'brain']\nlet robotParts = [\n 'motor',\n 'sensor',\n 'camera',\n 'battery',\n // 'memory', ??\n]\nlet swapComponents = ['sensor', 'battery', 'motor']\n\n// Your code\n\nequal(swapComponents, ['battery', 'sensor', 'motor'])\n"
}
]

View File

@ -0,0 +1,26 @@
[
{
"description": "variable myRobot is declared and of type object",
"code": "let robot = {\n name: 'Freddy',\n age: 27,\n hasEnergy: false,\n}\n\n// Your code\n\nequal(typeof myRobot, 'object')"
},
{
"description": "property name from myRobot is of type string",
"code": "let robot = {\n name: 'Freddy',\n age: 27,\n hasEnergy: false,\n}\n\n// Your code\n\nequal(typeof myRobot.name, 'string')"
},
{
"description": "property age from myRobot is of type number",
"code": "let robot = {\n name: 'Freddy',\n age: 27,\n hasEnergy: false,\n}\n\n// Your code\n\nequal(typeof myRobot.age, 'number')"
},
{
"description": "property hasEnergy from myRobot is of type boolean",
"code": "let robot = {\n name: 'Freddy',\n age: 27,\n hasEnergy: false,\n}\n\n// Your code\n\nequal(typeof myRobot.hasEnergy, 'boolean')"
},
{
"description": "all 3 variable should be defined and have the right values",
"code": "let robot = {\n name: 'Freddy',\n age: 27,\n hasEnergy: false,\n}\n\n// Your code\n\nequal({ name, age, hasEnergy }, robot)"
},
{
"description": "value should also work for Jean-Pierre",
"code": "let robot = {\n name: 'Jean-Pierre',\n age: 65,\n hasEnergy: true,\n}\n\n// Your code\n\nequal({ name, age, hasEnergy }, robot)"
}
]

82
js/tests/only-if.json Normal file
View File

@ -0,0 +1,82 @@
[
{
"description": "Test with the falsy value 0",
"code": "const args = saveArguments(console, 'log')\nlet truth = 0\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the falsy value NaN",
"code": "const args = saveArguments(console, 'log')\nlet truth = NaN\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the falsy value undefined",
"code": "const args = saveArguments(console, 'log')\nlet truth = undefined\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the falsy value null",
"code": "const args = saveArguments(console, 'log')\nlet truth = null\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the falsy value ''",
"code": "const args = saveArguments(console, 'log')\nlet truth = ''\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the falsy value false",
"code": "const args = saveArguments(console, 'log')\nlet truth = false\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'Lies !!!!')"
},
{
"description": "Test with the truthy value 'Sure'",
"code": "const args = saveArguments(console, 'log')\nlet truth = 'Sure'\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'The truth was spoken.')"
},
{
"description": "Test with the truthy value []",
"code": "const args = saveArguments(console, 'log')\nlet truth = []\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'The truth was spoken.')"
},
{
"description": "Test with the truthy value {}",
"code": "const args = saveArguments(console, 'log')\nlet truth = {}\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'The truth was spoken.')"
},
{
"description": "Test with the truthy value true",
"code": "const args = saveArguments(console, 'log')\nlet truth = true\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'The truth was spoken.')"
},
{
"description": "Test with the truthy value -0.1",
"code": "const args = saveArguments(console, 'log')\nlet truth = -0.1\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(args[0]?.[0], 'The truth was spoken.')"
},
{
"description": "Test with a user that can have the promotion",
"code": "const args = saveArguments(console, 'log')\nlet truth = 1\nlet user = { activeMembership: true, age: 22 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You cannot benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(ticket, 'You can benefit from our special promotion')"
},
{
"description": "Test with a user that is too old",
"code": "const args = saveArguments(console, 'log')\nlet truth = 1\nlet user = { activeMembership: true, age: 33 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You can benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(ticket, 'You cannot benefit from our special promotion')"
},
{
"description": "Test with a user that is too young",
"code": "const args = saveArguments(console, 'log')\nlet truth = 1\nlet user = { activeMembership: true, age: 12 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You can benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(ticket, 'You cannot benefit from our special promotion')"
},
{
"description": "Test with a user that doesn't have an active membership",
"code": "const args = saveArguments(console, 'log')\nlet truth = 1\nlet user = { activeMembership: false, age: 21 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You can benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(ticket, 'You cannot benefit from our special promotion')"
},
{
"description": "Test with a user that can have the promotion but is just at the limit",
"code": "const args = saveArguments(console, 'log')\nlet truth = 1\nlet user = { activeMembership: true, age: 25 }\nlet customer = { cash: 20, hasVoucher: false }\nlet ticket = 'You can benefit from our special promotion'\nlet ticketSold = 3\n\n// Your code\n\nequal(ticket, 'You can benefit from our special promotion')"
},
{
"description": "Test with a customer that has enough cash",
"code": "let truth = 0\nlet ticketSold = 8\nlet customer = { cash: 20, hasVoucher: false }\nlet user = { activeMembership: true, age: 22 }\nlet ticket = 'You cannot benefit from our special promotion'\n\n// Your code\n\nequal(ticketSold, 9)"
},
{
"description": "Test with a customer that has a voucher",
"code": "let truth = 0\nlet ticketSold = 5\nlet customer = { cash: 0, hasVoucher: true }\nlet user = { activeMembership: true, age: 22 }\nlet ticket = 'You cannot benefit from our special promotion'\n\n// Your code\n\nequal(ticketSold, 6)"
},
{
"description": "Test with a customer that has a voucher and cash",
"code": "let truth = 0\nlet ticketSold = 6\nlet customer = { cash: 42, hasVoucher: true }\nlet user = { activeMembership: true, age: 22 }\nlet ticket = 'You cannot benefit from our special promotion'\n\n// Your code\n\nequal(ticketSold, 7)"
},
{
"description": "Test with a customer that can not afford the ticket",
"code": "let truth = 0\nlet ticketSold = 3\nlet customer = { cash: 3, hasVoucher: false }\nlet user = { activeMembership: true, age: 22 }\nlet ticket = 'You cannot benefit from our special promotion'\n\n// Your code\n\nequal(ticketSold, 3)"
}
]

View File

@ -0,0 +1,22 @@
[
{
"description": "escapeFromDelimiters is declared and includes a double-quote",
"code": "let power = 'under 9000'\n\n// Your code\nif (typeof escapeFromDelimiters === 'undefined') {\n throw Error(\n `You didn't even define the variable... we've been through this already !`,\n )\n}\n\nif (!escapeFromDelimiters.includes('\"')) {\n throw Error('escapeFromDelimiters must include a double-quote\"')\n}"
},
{
"description": "escapeFromDelimiters includes a single-quote",
"code": "let power = 'under 9000'\n\n// Your code\nif (!escapeFromDelimiters.includes(\"'\")) {\n throw Error(\"escapeFromDelimiters must include a single-quote'\")\n}"
},
{
"description": "escapeFromDelimiters includes a backtick",
"code": "let power = 'under 9000'\n\n// Your code\nif (!escapeFromDelimiters.includes('`')) {\n throw Error('escapeFromDelimiters must include a backtick `')\n}"
},
{
"description": "escapeTheEscape includes a backslash",
"code": "let power = 'under 9000'\n\n// Your code\nif (!new TextEncoder().encode(escapeTheEscape).includes(92)) {\n throw Error('escapeTheEscape must includes a backslash')\n}"
},
{
"description": "The value of power must have changed",
"code": "let power = 'under 9000'\n\n// Your code\n\nequal(power, 'levelMax')"
}
]

6
js/tests/star-forge.json Normal file
View File

@ -0,0 +1,6 @@
[
{
"description": "Star-Forge",
"code": "// Your code\n\nequal(ready, 'Yes')"
}
]

View File

@ -0,0 +1,26 @@
[
{
"description": "values of the variable are a result of the operations on the variable smooth ( 10 )",
"code": "let name = 'blank'\nlet age = 0\nlet smooth = 10\n\n// Your code\n\nequal(lessSmooth, 9)\nequal(semiSmooth, 5)\nequal(plus11, 21)"
},
{
"description": "values of the variable are a result of the operations on the variable smooth ( 27 )",
"code": "let name = 'blank'\nlet age = 0\nlet smooth = 27\n\n// Your code\nequal(lessSmooth, 26)\nequal(semiSmooth, 13.5)\nequal(plus11, 38)"
},
{
"description": "ultraSmooth should be the square of the value of smooth ( 10 )",
"code": "let name = 'blank'\nlet age = 0\nlet smooth = 10\n\n// Your code\n\nequal(ultraSmooth, 100)"
},
{
"description": "ultraSmooth should be the square of the value of smooth ( 27 )",
"code": "let name = 'blank'\nlet age = 0\nlet smooth = 27\n\n// Your code\n\nequal(ultraSmooth, 729)"
},
{
"description": "presentation value includes age and name .",
"code": "let name = 'Patrick'\nlet age = 48\nlet smooth = 0\n\n// Your code\nequal(presentation, `Hello, my name is Patrick and I'm 48 years old`)"
},
{
"description": "presentation value still includes age and name .",
"code": "let smooth = 0\nlet name = 'Jeremy'\nlet age = 27\n\n// Your code\nequal(presentation, `Hello, my name is Jeremy and I'm 27 years old`)"
}
]

View File

@ -0,0 +1,22 @@
[
{
"description": "duplicate value should repeat 'I told you so'",
"code": "let robot = {}\nlet sentence = 'I told you so'\n// Your code\nequal(duplicate, 'I told you so, I told you so!')"
},
{
"description": "duplicate value should repeat 'Not again'",
"code": "let robot = {}\nlet sentence = 'Not again'\n// Your code\nequal(duplicate, 'Not again, Not again!')"
},
{
"description": "duplicate value should repeat 'I knew it'",
"code": "let robot = {}\nlet sentence = 'I knew it'\n// Your code\nequal(duplicate, 'I knew it, I knew it!')"
},
{
"description": "Altered object must match the expected result Nova",
"code": "let sentence = ''\nlet robot = {\n brand: 'Nova',\n batteryLevel: 247,\n}\n\n// Your code\n\nequal(robot, {\n brand: 'Nova',\n model: 'RX-78',\n batteryLevel: 257,\n fullName: 'Nova RX-78',\n})"
},
{
"description": "Altered object must match the expected result Ignite",
"code": "let sentence = ''\nlet robot = {\n brand: 'Ignite',\n batteryLevel: 123,\n}\n\n// Your code\n\nequal(robot, {\n brand: 'Ignite',\n model: 'RX-78',\n batteryLevel: 133,\n fullName: 'Ignite RX-78',\n})"
}
]

View File

@ -0,0 +1,94 @@
## Colorful arms
> JSPowered Mode
### Context
Your robot is already impressive, but you can make it even more eye-catching! Or at least, make it show off its colorful arms to the world!
> Follow the instructions, ask your peers if you are stuck and stay motivated because you are close to the goal!
> Follow every hint you have in the subject!
> Continue on the code from last exercise, and change the file names!
### Instructions
After finishing these tasks, you will be able make your robot's arms change to beautiful colors!
#### Task 1:
Let's put a third button in the top right corner of the page with an id `arm-color`, that will change the arms color. Add it in the HTML structure:
```html
<button id="arm-color">Change robot's arm colors</button>
```
Add the button style in the CSS file:
```css
#arm-color {
position: fixed;
top: 170px;
right: 30px;
padding: 10px;
z-index: 2;
}
```
Also replace the ``button` element styles with this block:
```css
button {
border-radius: 50px;
padding: 10px;
z-index: 1;
position: fixed;
top: 30px;
right: 30px;
}
```
Do you see how prettier the buttons turned to be?
#### Task 2:
In the JS file, like in the previous exercise, get the following elements:
- The button with the ID `arm-color`.
- The left and right arm elements with the IDs `arm-left` and `arm-right`.
#### Task 3:
We provide you with the variable `randomColor`, that stores a random color in each different time we use it.
- Apply the random color to both arms by changing their `backgroundColor`.
### Code Example:
```js
// Select the button with id 'arm-color'
//...Here
// Select the left and right arm elements
//...Here
// Your function that gets triggered when clicking the new button
const handleChangeArmColor = (event) => {
// Generate a random color
const randomColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
// Apply the random color to both arms
//...Here
};
// Attach the handleChangeArmColor function to the 'arm-color' button
armColorButton.addEventListener("click", handleChangeArmColor);
```
### Expected result
You can see an example of the expected result [here](https://youtu.be/KjTBuAmUnk4)
**`Prompt Example:`**
- "How do I change the background color of multiple elements in JavaScript?"

View File

@ -0,0 +1,54 @@
## Colorful legs
> JSPowered Mode
### Context
Your robot is cool! But you can make it even more striking! Or at least, make it show off its colorful legs to everyone!
> Follow the instructions, ask your peers if you are stuck and stay motivated because you are close to the goal!
> Follow every hint you have in the subject!
> Continue on the code from last exercise, and change the file names!
### Instructions
Just like you turned your robot's arms special in the last exercise, you will do the same now with the legs!
Follow the same
#### Task 1:
Let's put another button in the top right corner of the page with an id `leg-color`, that will change the legs color. Add it in the HTML structure:
```html
<button id="leg-color">robot's leg colors</button>
```
Add the button style in the CSS file:
```css
#leg-color {
position: fixed;
top: 240px;
right: 30px;
padding: 10px;
margin-bottom: 20px;
z-index: 2;
}
```
#### Task 2:
In the JS file, like in the previous exercise, get the following elements:
- The button with the ID `leg-color`.
- The left and right leg elements with the IDs `leg-left` and `leg-right`.
- Apply the random color to both legs by changing their `backgroundColor`.
### Expected result
You can see an example of the expected result [here](https://youtu.be/QQ0GKGuXgBw)
**`Prompt Example:`**
- "What mistakes should I prevent while changing the background color of multiple elements in JavaScript?"

View File

@ -0,0 +1,114 @@
## Declare Everything
> Mindful AI mode
### Context
In this second quest of our adventure, you are going to power up with JavaScript. And in this exercise you'll use variables to control and manage robots in various scenarios. Let's dive in and get started with the basics of variables in JavaScript!
> Don't worry if you are learning many new concepts, just go with the flow!
### AI-Powered Learning Techniques
**Exploratory Questions Technique:**
This type of prompt encourages the AI to provide various explanations and examples, helping you explore different aspects of a concept.
> Find the examples across the subject ;)
### Directions
Values need a way to be identified, that's why we use variables. They add meaning to a value by pointing to it. It's like a **label**, a way to name things.
If we say `20`, it doesn't carry much meaning, _`20` what?_
Imagine we are talking about robots. You have 20 robot parts.
_Now that's a lot of parts!_
> We defined _what_ we have (robot parts) and its _value_ (20).
## Concepts
An `identifier` is used to define what it is, using this syntax:
```js
let robotParts = 20;
```
> 😱 Woa, what's all this?!
Let's explain each part:
### Keyword: `let`
Firstly, a keyword, `let`.
A keyword is a special word that JS knows about. It is used to tell the computer to perform a specific action.
`let` indicates that the script is defining a new variable.
### Identifier
After that, it needs a valid identifier.
In this case, it's `robotParts`. We choose something meaningful here.
A few rules to apply to make sure an identifier is valid:
- No space allowed (`robot parts` would be 3 distinct identifiers)
- Not starting with a number (that's reserved for number values)
- Not being a reserved keyword (for example, using `let`)
- No special characters
As such, we use what's called `camelCase`.
Note that in JS, it is a convention to not uppercase the first letter as this is reserved for special declarations. We won't go into details now.
```js
let robot parts = 20 // invalid because of spaces
let robotParts = 20 // Just right
```
#### **`Prompt example`**:
> "Explain how to use `let` to declare variables in JavaScript."
### Operator: `=`
The special character `=` is an **operator**, like in math, they are used to define specific operations. In this case, `=` defines the `assignment` operation. It means assigning a value to our variable. This is what **links** the chosen `identifier` with our `value`.
#### **`Prompt example`**:
"Why do we use camelCase for variable names in JavaScript?"
### Value
Lastly, a value, like the one you already know: `string`, `number`, and `boolean`.Full example with descriptive comments:
```js
// ↙ keyword ↙ assignation operator
let comicBookTitle = "Tintin in Tibet";
// ↖ identifier ↖ the value (here a string)
```
#### **`Prompt example`**:
"As a beginner, what types of values can I assign to a variable in JavaScript?"
### Instructions
Declare two variables:
- Use the identifier `seven` with the value being a string of the number 7
- Use the identifier `seventySeven` with the value being a string of the number 77
```js
let seven = "7";
let seventySeven = "77";
```
---
> "When we first begin fighting for our dreams, we have no experience and make many mistakes. The secret of life, though, is to fall seven times and get up eight times."
> ― Paulo Coelho

View File

@ -0,0 +1,87 @@
## First Function
> Mindful AI mode
### Context
Your robot will need to start executing custom tasks, and to do that, you'll need to program its `functions`. Functions are like commands that tell robot exactly what to do.
You can create your own functions to give your robot unique abilities and make it more efficient!
### AI-Powered Learning Techniques
**Reflective Practice Technique:**
This type of prompt encourages you to reflect on the concepts youve just learned, reinforcing your understanding by applying the concepts in different contexts or scenarios.
Find the examples across the subject ;)
### Concepts
Remember this example of function call ?
```js
// ↙ identifier, like variables
console.log("Hello There !"); // <- function call happening here
// ↖ open paren + argument + close paren
```
There, we saw how to call and use "built-in" functions.
Here, now, we are going to learn how to declare our owns. This will gives us even more freedom to build our own logic.
### Declaring a function
Here, well learn how to declare a function in a `variable`. This gives your robot more freedom to perform custom tasks.
We'll use the `ArrowFunctionExpression` syntax to declare a function:
```js
// ↙ normal variable ↙ beginning of the scope of the function
let myFirstFunction = () => {
// ↖ parens () for arguments and the arrow => for syntax
}; // <-end of the scope of the function
```
### Calling a Function
Once declared, you can call the function using the parentheses `()`:
```js
myFirstFunction(); // This will call the function, but nothing happens yet
```
### Adding Instructions
Very much like an if statement a function has a scope. The scope in between the curly braces `{}` is where the action happens. Let's add something to the scope of our function:
```js
let myFirstFunction = () => {
console.log("Robot is now active!");
};
```
Now, when you call `myFirstFunction()`, Robot will log a message in the console:
```js
myFirstFunction(); // Output: "Robot is now active!"
```
> We actually declared, then called the function and gave it this single instruction, `console.log('Robot is now active!')`.
#### **`Prompt Example`**:
- "How do you call a function in JavaScript, and what happens if the function contains no instructions?"
#### **`Video Resource`**:
- [Functions in depth.](https://www.youtube.com/watch?v=0lp0d-Uxy4o)
### Instructions
#### Task 1:
You are a robot made by a scientist called Rick and you want to know your purpose.
- Declare a function named `ask` that `log` 'What is my purpose ?' in the console
- Declare a function named `reply` that `log` 'You pass butter.' in the console
Then first `call the ask` then `the reply` once, in that order.

View File

@ -0,0 +1,93 @@
## First hello
> JSPowered Mode
### Context
Your robot winked, but you can make it talk too! Or at least, make it say his first hello to the world!
> Follow the instructions, ask your peers if you are stuck and stay motivated because you are close to your goal!
> Follow every hint you have in the subject!
> Continue on the code from last exercise, and change the file names!
### Instructions
Now that you know how to make your creation move, what about making it communicate its first words to the world?
After finishing these tasks, you will be able to display and hide `Hello World` in the `torso` of your robot by clicking on a second button.
#### Task 1:
Let's put a second button in the top right corner of the page, that will add some text when clicked. Add it in the HTML structure:
```html
<button id="speak-button">Click me to speak</button>
```
Add the button style in the CSS file:
```css
button#speak-button {
top: 100px;
}
```
Also add this class to style the text we will add:
```css
.words {
text-align: center;
font-family: sans-serif;
}
```
#### Task 2:
In the JS file, like in the previous exercise, get the HTML `button` element with id `speak-button` and add an `event listener` on `click event`, triggering a `function` that will:
- Select the torso element with id="torso".
- Check if a div with the class words already exists inside the torso element.
- If it exists, remove the existing div.
- Otherwise:
- Create a new HTML element of type div.
- Set its text content to "Hello World".
- Set its class name to words, as defined in the CSS.
- Use the append method to add the new div inside the torso element.
### Code Example:
```js
// Select the button with id 'speak-button'
//...Here
//Your function that gets triggered when clicking the new button
const handleSpeakClick = (event) => {
// Select the torso element where the text will be added or removed
const body = document.querySelector("#torso");
// Check if a div with the class 'words' already exists inside the torso
const existingDiv = document.querySelector("#torso .words");
if (existingDiv) {
// If the "Hello World" text exists, remove it from the torso
} else {
// If the "Hello World" text does not exist, create and append it
// Create a new div element
// Add the 'words' class to the div
// Set the text content to "Hello World!"
// Append the new div to the torso element
}
};
// Attach the handleSpeakClick function to the 'speak-button' button
//...Here
```
### Expected result
You can see an example of the expected result [here](https://youtu.be/At4BhyzMxzw)
**`Prompt Example:`**
- "How can I add and remove text in an element with a button click in JavaScript?"

View File

@ -0,0 +1,117 @@
## First wink
> JSPowered Mode
### Context
You're making fantastic progress! You've reached a crucial stage in your journey where youll learn how to make your robot alive using the power you gained, JavaScript basics.
Don't worry if things feel a bit challenging—that's part of the process! Just remember to take it step by step and never forget what you learned on using Generative AI along with your peers to seek clarifications, and you'll be amazed at how quickly you'll see results.
> Let's use all your power of learning and searching to make your robot alive!
#### Reminder:
- Before you start coding, it's okay to take a moment to think about what you want to do. You can even write out a rough plan or "PseudoCode" to help organize your thoughts. It makes the coding part much easier!
> We can mention thing you do not know; but by this time, you know what to do! Search for it, ask your peers and use clever prompts ;)
- **You need to continue on the HTML, CSS, JS code you submitted for the exercise `first-move`, but with an empty JavaScript file and do not forget to change the name of the linked files to the name of this exercise!**
### Resources
We provide you with some content to get started smoothly, check it out!
- [Video](https://www.youtube.com/watch?v=m34qd7aGMBo&list=PLHyAJ_GrRtf979iZZ1N3qYMfsPj9PCCrF&index=13) on `querySelector`
- [Video](https://www.youtube.com/watch?v=ydRv338Fl8Y) DOM JS - Add an `event listener` to an element
- [Video](https://www.youtube.com/watch?v=4O6zSVR0ufw&list=PLHyAJ_GrRtf979iZZ1N3qYMfsPj9PCCrF&index=15) DOM JS - Set an `element's properties`
- [Video](https://www.youtube.com/watch?v=amEBcoTYw0s&list=PLHyAJ_GrRtf979iZZ1N3qYMfsPj9PCCrF&index=21) DOM JS - `classList`: toggle, replace & contains
- [Video](https://www.youtube.com/watch?v=pxlYKvju1z8&list=PLHyAJ_GrRtf979iZZ1N3qYMfsPj9PCCrF&index=16) DOM JS - Set an element's `inline style`
- [Memo DOM JS](https://github.com/nan-academy/js-training/blob/gh-pages/examples/dom.js)
### Instructions
#### Task 1:
Let's put a button on the top right corner of the page, that will toggle (close or open) the left eye when clicked.
Add it in the HTML structure:
```js
<button>Click to close the left eye</button>
```
And add the style in the CSS file:
```css
button {
z-index: 1;
position: fixed;
top: 30px;
right: 30px;
padding: 20px;
}
```
#### Task 2:
Select the button in your JavaScript file that will allow the user to control the robots left eye.
```js
// Select the button element using its ID so we can interact with it in our JavaScript
//Example of selecting a button called myButton
const myButton = document.querySelector("button");
```
**`Prompt Example:`**
- "How do I use `querySelector` to select an HTML element by its ID?"
#### Task 3:
Write a function that will be triggered when the button is clicked.
This function will make the robot "wink" by toggling the `eye-closed` class on the left eye and change the `button` text based on the current state of the eye.
- It changes the text content of the button: if the eye is open, write "Click to close the left eye", if the eye is closed, write "Click to open the left eye".
- It toggles the class eye-closed in the `classList` of the eye-left HTML element.
It changes the background color of the eye-left: if the eye is open, to "red", if the eye is closed, to "black"
```js
const button = document.querySelector('button')
const handleClick = (event) => {
// Select the left eye element by its ID
const myDiv = ...
// Check if the eye is currently closed by looking at its background color
if (...) {
// If the eye is closed, open it and update the button text
} else {
// If the eye is open, close it and update the button text
}
// Toggle the 'eye-closed' class on the 'eye-left' div
};
// register the event:
button.addEventListener('click', handleClick)
// here we ask the button to call our `handleClick` function
// on the 'click' event, so every time it's clicked
```
### Expected result
You can see an example of the expected result [here](https://youtu.be/wuYTorfBViE)
**`Prompt Examples:`**
- "As a beginner, explain to me what is `querySelector` in JavaScript, and how do I use it to select an HTML element by its ID or class?"
- "As a beginner, explain to me how can I change the text content of an `HTML element` using JavaScript?"
- "As a beginner, explain to me how do I use `addEventListener` to make a button respond to a click event in JavaScript?"

View File

@ -76,6 +76,6 @@ Don't forget to test your code before submitting it, using the `Run` button.
Videos designed to give **hints** are assigned to each quest. It is strongly suggested to watch them as you go.
### Ressources
### Resources
- [Introduction to JavaScript](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps)

View File

@ -0,0 +1,110 @@
## Good Recipe
> Mindful AI mode
### Context
Welcome to this quest! I bet you are hungry after this long way gaining power!
Are you ready to cook? But instead of cooking food, we'll be applying recipes to data through methods! In JavaScript, methods are special functions called from another value, allowing you to perform various operations.
Let's find out more!
### AI-Powered Learning Techniques
**Guided Practice Technique:**
This type of prompt encourages the AI to guide learners through hands-on practice exercises, providing immediate feedback and helping them build confidence in their skills.
Find the examples across the subject ;)
### Concepts
### Functions and Methods
In JavaScript, functions are like recipes that perform a task. Methods are special functions associated with objects. We are focusing on methods now.
### Example
```js
console.log("Robot is mixing ingredients");
```
### Multiple Arguments
Functions can take multiple arguments, like adding ingredients to a recipe:
```js
console.log("flour", 200); // both arguments will appear in your console
```
### Methods
Methods are functions called from another value. For example, `toFixed` is a method that formats numbers:
```js
let num = 10 / 3;
console.log(num.toFixed(2)); // -> '3.33'
```
### String Manipulation with Methods
Using the `.slice` method to cut parts of a string:
```js
let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
let cutFirst = alphabet.slice(10); // 'KLMNOPQRSTUVWXYZ'
let cutLast = alphabet.slice(0, -3); // 'ABCDEFGHIJKLMNOPQRSTU'
let cutFirstLast = alphabet.slice(5, -6); // 'FGHIJKLMNOPQRS
```
### Splitting Strings
Splitting a string into an array of words using split:
```js
let sentence = "Add flour, sugar, and eggs";
let words = sentence.split(" "); // ['Add', 'flour,', 'sugar,', 'and', 'eggs']
```
### Splitting text into lines:
```js
let text = "Add flour\nMix well\nBake at 350°F";
let lines = text.split("\n"); // ['Add flour', 'Mix well', 'Bake at 350°F']
```
#### **`Prompt Example`**:
- "Show me step-by-step how to use the `.split` method to break the sentence 'Learning JavaScript is fun' into an array of words."
- "Show me how to use the `.toUpperCase` method to convert the string 'hello' to uppercase."
- "Show me how to use `Math.max` to find the biggest number in an array."
### Instructions
#### Task 1:
You need to find the oldest robot in the kitchen to determine the most experienced helper.
We provide you with three robot objects assigned to their respective variables `martin`, `kevin`, and `stephanie`. Use the `Math.max` function on their `age` properties to find the oldest robot.
Declare an `oldestAge` variable that uses `Math.max` on the `age` properties of `martin`, `kevin`, and `stephanie`.
#### Task 2:
You need to slice some virtual vegetables. Using the `.slice` method and the provided alphabet variable, which is a string of all the characters in the alphabet:
- Declare a `cutFirst` variable that removes the first `10` characters of alphabet, simulating the removal of the first few slices.
- Declare a `cutLast` variable that removes the last `3` characters of alphabet, simulating the trimming of the last few slices.
- Declare a `cutFirstLast` variable that removes the first `5` characters and the last 6 characters of alphabet, simulating a precise cut in the middle.
#### Task 3:
You needs to prepare ingredients for a recipe, and part of the preparation involves transforming text.
For this task, you will use the `toUpperCase` and `toLowerCase` methods on the provided variable message.
- Create a `noCaps` variable with the value of message but in lower case to simulate finely chopped ingredients.
- Create an `allCaps` variable with the value of message but in upper case to simulate ingredients being loudly announced.

View File

@ -0,0 +1,162 @@
## I Win Arguments
> Mindful AI mode
### Context
You made it to the last mission in getting your full power, to make your robot alive and fully functional!
The final step involves mastering the use of `arguments` in functions. By learning how to use and manage these `arguments` effectively, you can unlock the full potential of your robot and make it later truly come alive.
Let's find out more!
### AI-Powered Learning Techniques
**Code Chunking Technique:**
This type of prompt encourages you to break down larger pieces of code into smaller, digestible chunks.
Each chunk is explained individually, allowing you to understand the purpose and functionality of each part.
Find the examples across the subject ;)
### Concepts
### One Argument
We mentioned it before with methods, functions can take arguments. They are always in between parenthesis `()`.
Let's use the same examples that we used for function calls:
Remember this example of function call ?
```js
// ↙ method
console.log("Hello There !"); //<-
// ↖ The String 'Hello There!' is
// the argument of console.log()
```
We are now going to adapt `myFirstFuntion` so that it takes one argument : `arg1`.
```js
let myFirstFunction = (arg1) => {
//<-arg1 is inputed in between the parenthesis
console.log(arg1); // arg1 can be use inside the scope of the function
// ↖ arg1 is "transfered" to be the arg of console.log()
}; //<-end of the scope of the function
```
Now if the function is called, it displays the output of `console.log(arg1)`.
```js
myFirstFunction("using my first arg"); // "using my first arg"
```
But let's say we want to change what the function logs. Now, instead of modifying `myFirstFunction` we just need to modify the `argument` in the `function call`.
```js
myFirstFunction("another arg"); // "another arg"
myFirstFunction("and another one"); // "and another one"
myFirstFunction("and one more"); // "and one more"
```
### More Arguments
Weve seen how to add `one` argument to a function. Now, lets learn how to add `two (or more)` arguments.
All we need to do to add a second argument `arg2` is to add a comma `,` after `arg1` and then add `arg2`.
```js
let myFirstFunction = (arg1, arg2) => {
//<-arg1 and arg2 are inputed in between the parenthesis
console.log(arg1, arg2);
// ↖ arg1 and arg2 are "transfered" to be the args of console.log()
};
// Now we call the function
myFirstFunction("first arg", "second arg");
// "first arg"
// "second arg"
```
For more args, you will need to simply repeat the same process! Comma `,` then the other argument and it goes on.
> Please note that you can name your arguments however you please. Just make sure that you reuse the proper name inside the scope of your function.
### Return value
In addition to accepting arguments, functions can also `return` values.
Return values are the `outputs` that a function provides after completing its task.
We are now going to adapt `myFirstFunction` so that it `returns` a value instead of just `logging it`.
```js
let myFirstFunction = (arg1) => {
return arg1; // the function now returns the value of arg1
};
```
Now if the function is called, it returns the value of `arg1`:
```js
let result = myFirstFunction("using my first return");
console.log(result); // "using my first return"
```
But let's say we want to change what the function `returns`. Now, instead of modifying `myFirstFunction`, we just need to modify `the argument` in `the function call`.
```js
let anotherResult = myFirstFunction("another return");
console.log(anotherResult); // "another return"
```
#### **`Prompt Example`**:
- "Can you guide me through creating and using a JavaScript function that takes multiple arguments, starting from a basic function without arguments, then adding single and multiple arguments ?"
### Instructions
#### Task 1:
You are the general's aide responsible for transmitting communications to the other `RoboGuards`.
1- Create the `battleCry` Function:
- This function should take `one argument` and display it in the `console`.
- The battlefield is vast, so ensure that `the argument is uppercased` before displaying it.
2- Create the `secretOrders` Function:
- Sometimes, communications need to be given quietly.
- This function will do the `same` as `battleCry`, except `it will lowercase` the argument before sending it.
> hint: you remember methods?
#### Task 2:
As the leader of the RoboGuard forces, you're not just preparing for battle—you're also forming dynamic duos of robots to work together on special missions.
1- Create the `duos` Function:
- This function will take `two arguments`, representing the **names** of **two robots**.
- It will `log them` together with an **and** and an **exclamation mark**.
> Output's example: "robotOne and robotTwo!"
2- Create the `duosWork` Function:
- This function will take `three arguments`: the **names** of two robots and the **task** they will perform together.
- It will `log them` together in a sentence describing their task.
> Output's example: "robotOne and robotTwo are saying hi!
#### Task 3:
Rick's robot, knows his purpose. (Remember ? 'He passes butter.')
- Define the function `passButter` that returns the string 'The butter'.
** "Your hard work is paying off. The only limit to your impact is your imagination and commitment." Tony Robbins**

View File

@ -0,0 +1,149 @@
## Listed
> Mindful AI mode
### Context
Sometimes we don't need a key, we just want a list of things, JS has a special type for that, called an array.
In JavaScript, arrays are essential tools for handling these lists efficiently.
Let's discover them together!
### AI-Powered Learning Techniques
**Example-Based Learning Technique:**
This type of prompt encourages the AI to provide concrete examples to illustrate concepts, making it easier to understand and apply them.
Find the examples across the subject ;)
### Concepts
### Understanding Arrays
Arrays are special types of objects in JavaScript used to store lists of items. Unlike objects, arrays don't have keys for each element, just a list of values.
**Example of an Array**
Let's see an example of an array:
```js
let batteryLevels = [
80, // <- no keys!
60,
90,
50,
];
// or for brevity, we often write them on a single line like so:
let batteryLevels = [80, 60, 90, 50];
```
### Indexes in Arrays
The position of an element in an array is called its index, starting from 0. So, our `batteryLevels` array is roughly equivalent to writing this object:
```js
let batteryLevelsObject = {
0: 80,
1: 60,
2: 90,
3: 50,
};
```
### Accessing Array Values
To access a value in an array, use the index inside square brackets:
```js
let batteryLevels = [80, 60, 90, 50];
console.log(batteryLevels[0]); // -> 80
console.log(batteryLevels[3]); // -> 50
console.log(batteryLevels[6]); // -> undefined
```
### Using the .length Property
Arrays keep track of how many elements they contain using the `.length` property:
```js
console.log([].length); // -> 0
console.log([80].length); // -> 1
console.log([80, 60, 90, 50].length); // -> 4
```
### Replacing an Array Value
You can replace an array value by accessing it via its index and assigning a new value:
```js
let robotTasks = [
"Charging",
"Cleaning",
"Maintenance",
"Patrolling",
"Greeting",
];
// Let's say I want to change 'Charging' to 'Upgrading'
robotTasks[0] = "Upgrading";
console.log(robotTasks);
```
Now, the array looks like this:
```js
["Upgrading", "Cleaning", "Maintenance", "Patrolling", "Greeting"];
```
#### **`Prompt Example`**:
- "How does accessing an array element differ from accessing an object property?"
- "Can you think of a scenario where using an array to store values would be more beneficial than using separate variables?"
### Instructions
#### Task 1:
You must declare a variable `components` that contains 4 strings, one for each robot component.
#### Task 2:
We provide you a variable `robotParts` that contains some elements. You will have to access them and assign their values to variables:
- A variable `firstPart` for the first element of the `robotParts` list
- A variable `lastPart` for the last element of the `robotParts` list
- A variable `comboParts` as an array of 2 elements, the last and the first element of the `robotParts` list, in that order.
Example: if `robotParts` is `[1, 2, 3]`
-`firstPart` would be `1`
-`lastPart` would be `3`
-`comboParts` would be `[3, 1]`
#### Task 3:
You must replace the third element of the provided `replaceComponents` array with the string 'enhanced'.
Example:
```js
let replaceComponents = ["motor", "sensor", "battery"];
// expect -> ['motor', 'sensor', 'enhanced']
```
You must swap the first and second element of the provided `swapComponents` array.
Example:
```js
let swapComponents = ["motor", "sensor", "battery"];
// expect -> ['sensor', 'motor', 'battery'] (last element is untouched)
```
> "Programming is like building a robot. You start with the basics, but the fun really begins when you start swapping parts and adding enhancements!"

View File

@ -0,0 +1,118 @@
## Objects Around
> Mindful AI mode
### Context
Think about all the objects around you: like your book or robot friend. Each of these objects has different properties that describe it. For example, a robot can have a type, weight, and operational status. In JavaScript, we use objects to group these related properties together, making it easy to manage and access this information.
### AI-Powered Learning Techniques
**Visualization Technique:**
This type of prompt encourages the AI to explain a concept using diagrams or visual representations to illustrate concepts.
Find the examples across the subject ;)
### Concepts
### JavaScript Objects
Objects in JavaScript are fundamental data structures used to group related values together. They are like a bag of values.
### Example
First, let's look at different types of variables:
```js
let type = "Talkative";
let weight = 120.5;
let isOperational = true;
```
Now, we can group them into an object. Objects are values too, so let's assign one to a robot variable:
```js
let robot = {
type: "Talkative",
weight: 120.5,
isOperational: true,
};
console.log(robot); // This will display the object 'robot'
```
Here, the robot variable is declared, and its value type is an object.
### Object Literal Syntax:
Objects are defined using curly brackets {}.
```js
let emptyRobot = {}; // an empty object
```
### Properties
Objects consist of properties, each having a key and a value:
```js
let robot = {
type: "Talkative", // 'type' is the key, 'Talkative' is the value
weight: 120.5,
isOperational: true,
};
```
Each property is separated by a comma ",". It's good practice to add a trailing comma to every property, though it's not required for the last one.
### Accessing Values
To access values in an object, use the dot notation. For example:
```js
let robot = {
type: "Talkative",
weight: 120.5,
isOperational: true,
};
console.log(robot); // Logs the whole 'robot' object
console.log(robot.weight); // Logs the weight of the robot (120.5)
```
You can use the property values just like any other values:
```js
let efficiency = 1.15; // Efficiency factor
let robot = {
type: "Talkative",
weight: 120.5,
isOperational: true,
};
const adjustedWeight = robot.weight * efficiency;
console.log(adjustedWeight); // Logs the adjusted weight
```
#### **`Prompt Example`**:
- Can you help me visualize a JavaScript object with the following properties: `name`, `age`, `hasEnergy``?
### Instructions
#### Task 1:
Let's declare a variable `myRobot` which has an object as its value with 3 properties.
1. A `name` property of `myRobot`'s name as a String
2. An `age` property of `myRobot`'s age as a Number
3. A `hasEnergy` property as a Boolean indicating if `myRobot` has dangerous features
#### Task 2:
We will provide a `robot` variable of type object just like the one you did in the previous task.
Your job will be to decompose each property into its own variable:
- Define a `name` variable with the value of the `name` property of the `robot` variable.
- Same for `age`.
- And same for `hasEnergy`.

View File

@ -0,0 +1,139 @@
## Only If
> Mindful AI mode
### Context
You are close to getting the ultimate power! Are you ready to command your robot using conditions? In JavaScript, conditions allow you to control what your robots do based on different situations.
Let's have some fun with it!
### AI-Powered Learning Techniques
**Interactive Learning Technique:**
This type of prompt engages you in active problem-solving by providing challenges or tasks that require applying concepts. This can work to compare your results with your peers!
Find the examples across the subject ;)
### Concepts
### Conditions in JavaScript
Conditions in JavaScript are like decision points, they allow you to execute different actions based on whether a condition is true or false.
```js
if (condition) {
// Code to execute if the condition is true
} else {
// Code to execute if the condition is false
}
```
For example:
```js
let batteryLevel = 75;
if (batteryLevel > 50) {
console.log("Robot is ready to patrol!");
} else {
console.log("Robot needs to recharge.");
}
```
### Truthy and Falsy
In JavaScript, all the values are either `truthy` or `falsy`. Truthy values validate conditions, while falsy values do not.
#### Falsy Values:
- `undefined` and `null`
- Numbers: `0` and `NaN`
- Empty string: `''`
- Boolean: `false`
**All other values are `truthy`!**
### Logical Operators
### AND Operator (&&)
The AND operator groups conditions:
```js
// Ex: let robot = { status: 'active', battery: 75, name: 'RoboGuard' };
if (robot.status === "active" && robot.battery > 50) {
console.log("Robot" + robot.name + "is active and has sufficient battery.");
}
//Output : Robot RoboGuard is active and has sufficient battery.
```
### OR Operator (||)
The OR operator groups conditions:
```js
if (robot.type === "security" || robot.type === "assistant") {
console.log(robot.name + "is available for tasks.");
}
```
### `else if` Keyword
Chain conditions using else if:
```js
if (temperature < 8) {
console.log("Very cold!");
} else if (temperature < 16) {
console.log("Still too cold...");
} else if (temperature < 24) {
console.log("Getting warmer");
} else if (temperature < 32) {
console.log("Nice :)");
} else {
console.log("Too hot!!!");
}
```
#### **`Prompt Example`**:
- "Give me an easy coding challenge involving conditions in JavaScript, and provide feedback on my solution."
### Instructions
#### Task 1:
Your Robot must always seek the truth.
- Check if the value of the provided variable `truth` is truthy, log '`The truth was spoken.`'
- Otherwise, log '`Lies !!!!`' because the value of the provided variable truth is falsy.
#### Task 2:
Your `RoboGuard's traveling company` has a special promotion for robot members aged between 18 and 25. Write the if condition that will check if the robot user can benefit from the promotion:
- `user.age` must be at least `18`.
- `user.age` must be less than or equal to `25`.
- `user.activeMembership` must be `true`.
If `all` of these conditions are `true`, log the message '`You can benefit from our special promotion`'.
> Hint : use AND Operator in your condition!
#### Task 3:
Your RoboGuard is selling plane tickets, each costing `9.99$`. The RoboGuard must confirm that the customer robot has the means to buy this ticket.
The customer robot may have enough cash `or` a voucher.
Check if the provided variable customer can afford the ticket:
If the customer has enough `cash` (`customer.cash` property)
`or` If the customer has a `voucher` (`customer.hasVoucher` property is true)
If so, `increment` the provided variable `ticketSold` value by `1`.
> Hint : use OR Operator in your condition!

View File

@ -0,0 +1,93 @@
## Play with variables
> Mindful AI mode
### Context
Remember that if things get a little hectic at times, take the time to get closer to your peers so that you can think, share and move forward together.
> Keep Going!
### AI-Powered Learning Techniques
**Clarification Technique:**
This type of prompt encourages the AI to explain a concept in detail, helping you gain a deeper understanding.
> Find the examples across the subject ;)
## Concepts
### Escape characters
**Quote delimiters** can be one of the tricky things to deal with.
Since they are used for delimiting text, they need a trick to include them in
our text.
For example, we want a `'` _(single quote)_ in our text, but use them as
delimiters:
```js
console.log('I keep trying , I can't give up! ')
// too bad a single quote, ruined the quote, get it ?
```
The `\` _(backslash)_ is used for that:
Every time there is an _extra special_ character into your string, putting a `\`
in front of it will **escape** it and doing so will let JS understand you meant
the **literal** following character and not the delimiter, _or whatever else
the character normally means for a string_
```js
console.log("I keep trying , I can't give up! ");
// Output: I keep trying, I can't give up!
```
#### **`Prompt Example`**:
"As a beginner, how do I include special characters in a string in JavaScript? Give me simple examples too."
### Assign re-assign
Remember the `let` keyword is used to declare new variables.
> Note that we can't have multiple variables with the same identifier otherwise JS wouldn't know which one is which.
If you redeclare a variable, it will crash!
But it is still possible to use the `=` (assignment operator) to change its value!
> Note that sometimes you may find variable declared with `const`. This means that the assignation is constant and can never be re-assigned!
> It is used to protect your code against errors, but you can always use `let` in its place..
> Also you may find online old code using var. We are trying to get rid of `var`s since 2015. It's ancient syntax and it was pretty problematic. Never use it! If you see code using it, try to find a more recent example. That one is outdated.
#### **`Prompt Example`**:
- "As a beginner, what is the difference between let and `const` in JavaScript?"
- "As a beginner, how do I reassign a value to an already declared variable in JavaScript?"
### Instructions
#### Task 1:
- Create a `escapeFromDelimiters` variable that includes all 3 quotes _(`` ` ``, `"` and
`'`)_.
- Create a `escapeTheEscape` variable that includes a backslash _(`\`)_.
#### Task 2:
- The variable `power` has been declared and will be used during the tests.
- You must try to re-assign the power variable to the string value `levelMax`. But without re-declaring it!
---
> “How did I escape? With difficulty. How did I plan this moment? With
> pleasure.” \
> ― Alexandre Dumas, The Count of Monte Cristo

View File

@ -0,0 +1,421 @@
## Robots Harmony
> AI Synergy Mode
## Context
Welcome to your final milestone! After each of you has brought a robot to friend to life, it's time to reunite them together.
Now, all those incredible robots need to be displayed in perfect harmony in our interactive and visually stunning Robots `Gallery`.
As a team, your task is to combine your individual creations into a cohesive display.
This gallery won't just be functional, it will be a fun and visually appealing experience that highlights the creativity and collaboration behind your robots.
> You'll be working on this mission as a team, so effective communication and mutual support are key to bringing your robots together.
> Separate tasks equally, it will make the results better!
> Remember what you learned in asking AI for the precise explanation of concepts, while your team apply those concepts and do the actual fun work!
Go ahead, and let the world see the amazing robots you've created together!
## Setups:
**1- Code Editor:**
First , remember that you will not be using the platform's code editor. Instead, you can use this online [tool](https://jsfiddle.net/) to create and modify your code.
> Feel free to play with the settings and familiarize yourself with the collaborative environment!
> PS: Click on Run to see the result of your code!
**2- How to submit your code:**
Your project must be handed in by the group captain before the time runs out. This is done by publishing the code on the platform.
To do so, go to **gitea** by clicking on the logo at the top right of your platform dashboard. (on the captain's account)
[![Capture-d-e-cran-2024-08-29-a-19-51-15.png](https://i.postimg.cc/zBRM6BMv/Capture-d-e-cran-2024-08-29-a-19-51-15.png)](https://postimg.cc/N9BprgQv)
Sign in if you are not already logged in.
You must create a repository to submit your work.
[![Capture-d-e-cran-2024-08-29-a-19-57-32.png](https://i.postimg.cc/59Bt8f3q/Capture-d-e-cran-2024-08-29-a-19-57-32.png)](https://postimg.cc/vDmMsFCc)
Name it **robots-harmony** and check the box that says **Initialize Repository (Adds .gitignore, License and README).**
You can now create all your project files to this repository, using the button New file and finalize this step by clicking Commit changes
[![Capture-d-e-cran-2024-08-29-a-20-00-08.png](https://i.postimg.cc/G2kqcB15/Capture-d-e-cran-2024-08-29-a-20-00-08.png)](https://postimg.cc/vgZWhZTr)
**3- Expected files:**
You need to submit the following files:
- `robots-harmony.html`
- `robots-harmony.css`
- `robots-harmony.js`
## Instructions
Theses tasks are representing the mandatory part for this raid to be passed successfully. Bonus part is optional but highly encouraged for more fun!
### Task 1: Set Up the Gallery Structure
#### 1- Create a New HTML File:
Inside your HTML file, set up the basic structure of the HTML document with a `<head>` and `<body>` inside an `<html>` tag.
#### 2- Give a gallery title:
- Inside your `<body>` , create an `<h1>` tag inside a `<div>` with an `id` of `title`. Then put the name of your gallery inside it !
```HTML
<div id="title">
<h1>your favorite gallery name</h1>
</div>
```
#### 3- Put your robots inside the gallery:
- Under the `title` div, create a div element with the `id` `gallery`.
- This div will serve as the container for all the robot portraits.
```html
<div id="gallery"></div>
```
- Each team member should copy their robot's HTML structure (the one you provided in the `first-move.html` exercise between the `<section>` `</section>` code) and paste it inside this `gallery` div.
- Ensure each robot is placed inside its own div with the class `name-robot`, do not forget to change the `name` to be your name in the team, for example:
```html
<div class="john-robot">
<!-- Paste your robot's HTML structure here (face, upper-body, lowe-body)-->
</div>
<div class="sarah-robot">
<!-- Paste your robot's HTML structure here (face, upper-body, lowe-body) -->
</div>
<div class="bob-robot">
<!-- Paste your robot's HTML structure here (face, upper-body, lowe-body) -->
</div>
```
#### 4- Add Robot Information:
Under each robot's `</section>` (that you copied from your robot's code in `first-move.html`), add an `<h3>` element for the robot's name and a `<p>` element for a short description of its power.
```html
<h3>Your robot's name</h3>
<p>Your robot's description</p>
```
### Task 2: Style the Gallery
#### 1- Update the CSS File:
- In your HTML file, link your CSS file by pasting the following code in between the `<head></head>` tags:
```html
<link rel="stylesheet" href="robots-harmony.css" />
```
- In your CSS file, add these styles:
```css
* {
margin: 0;
box-sizing: border-box;
opacity: 0.85;
}
body {
height: 100vh;
}
section {
padding: 20px;
width: 100%;
height: auto;
display: flex;
justify-content: center;
}
div,
p {
border: solid 1px black;
padding: 10px;
margin: 0;
border-radius: 30px;
}
#face {
align-items: center;
margin-bottom: 20px;
}
#eyes {
display: flex;
background-color: yellow;
justify-content: space-between;
align-items: center;
border-radius: 50px;
width: 200px;
}
#torso {
width: 150px;
height: 90%;
background-color: violet;
}
.eye {
width: 60px;
height: 60px;
background-color: red;
border-radius: 50%;
}
.arm {
background-color: aquamarine;
width: 50px;
height: 100px;
margin: 20px;
}
.leg {
background-color: dodgerblue;
width: 50px;
height: 100px;
margin: 20px;
}
.body-member {
width: 50px;
margin: 30px;
}
h3 {
margin-bottom: 10px;
}
#title {
text-align: center;
margin: 1rem;
background-color: #383086;
color: rgb(158, 235, 223);
}
```
> Trust the process!
- Then add this gallery style block, and change the `background-color` of it based on your team's favorite color:
```css
#gallery {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 100px;
padding: 100px;
/* Change this color to reflect the color of your gallery */
background-color: #383086;
}
```
- Add the following block of style to all your class's of `name-robot`. To do so, we follow the rule:
```css
.class-one,
.class-two,
.class-three {
/* block of style */
}
```
- Name it with your `name-robot` for each member of the team, and put inside the block the following styles:
```css
{
border: 2px solid #333;
padding: 20px;
text-align: center;
background-color: #fff;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s, box-shadow 0.3s;
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 400px;
}
```
#### 2- Add Animations:
- Add a subtle `hover` animation to the robot portraits to make the gallery more dynamic and engaging.
```css
.class-one:hover,
.class-two:hover,
.class-three:hover {
transform: scale(1.05);
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
```
> Experiment by changing the colors of the box-shadow and the scale value! Be creative.
- In your `#gallery` CSS rule, add some animated gradient color to the background! You can achieve it by combining CSS properties: `background`, `background-size`, `animation`, `box-shadow`.
> Hint : Do not forget to replace the background property with the new value bellow!
_For Example:_
```css
background: linear-gradient(
45deg,
/* Starting angle of the gradient */ red,
/* First color in the gradient */ blue,
/* Second color in the gradient */ green
); /* Optional third color in the gradient */
background-size: 300% 300%; /* Increases the background size for smooth animation or effects */
animation: gradientBackground 2s ease infinite; /* Animates the background to create a dynamic effect. */
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Adds a shadow around the element. Adjust the offsets, blur radius, and opacity as needed */
```
> You saw no change? well we did not specify yet what to do with all those colors, angles and timing yet!
- Let's make it more exciting, by actually making the colors move! We can do that with `keyframes`! Under the `#gallery` css rule, put the `keyframes`` block and see the magic !
_For Example:_
```css
@keyframes gradientBackground {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
```
> Play with the values and colors to get the best effect for your gallery!
**`Prompt Example:`**
- "How do I create a smooth gradient background with multiple colors in CSS?"
- "Explain to me as a beginner these CSS properties: `background`, `background-size`, `animation`, `box-shadow`."
### Task 3: Add Interactivity with JavaScript:
#### 1- Add Color Change on Key Press:
Inside your JavaScript file, write functions that change the colors of different parts of your robots when specific keys are pressed.
Follow the following steps:
- **Function to Change Arm Colors**:
- Create a function named `changeArmColor`.
- This function should accept a parameter `robotClass` to identify which robot to modify.
- Inside the function, generate a random color using JavaScript, to both `left` and `right` arms.
```js
const randomColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
```
- Use `document.querySelector` to select the `left` and `right` arm elements of the robot.
- Apply the random color to both arm elements using `style.backgroundColor`.
- Here is an example, do the same for right arm:
```js
const randomColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
document.querySelector(`.${robotClass} #arm-left`).style.backgroundColor =
randomColor;
//do the same to right arm
```
- **Function to Change Legs Colors**:
- Create a function named `changeLegColor`.
- Follow the same steps as the `changeArmColor` function but target the `legs`.
- **Function to Change Eye Colors**:
- Create a function named `changeEyeColor`.
- Follow the same steps as the `changeArmColor` function but target the `eye`.
- **Function to Change Face Colors**:
- Create a function named `changeFaceColor`.
- Follow the same steps as the `changeArmColor` function but target the `eyes` `id`. (Yes, pay attention, the `id` that changes the face color is called `eyes`!)
#### 3- Adding Event Listeners for Keyboard Input:
Next, you need to detect when specific keys are pressed and trigger the corresponding function.
- Use `document.addEventListener` to listen for `keydown` events.
- Inside the event listener, use multiple `if` statements to check which `key` was `pressed`.
- Depending on the `key` pressed, call the appropriate `function` and pass the `robot's class` as an `argument`.
_Code example:_
```js
document.addEventListener("keydown", function (event) {
if (event.key === "1") {
changeArmColor("john-robot");
}
if (event.key === "2") {
changeLegColor("john-robot");
}
if (event.key === "Q" || event.key === "q") {
changeEyeColor("john-robot");
}
if (event.key === "A" || event.key === "a") {
changeFaceColor("john-robot");
}
// Add similar conditions for other robots choosing what keys will change the colors!
//...Here
});
```
- You should decide with your team mates the keys that will trigger each robot of yours!
**`Prompt Example:`**
- "What is `event.key` in JavaScript and how can it be used to detect keyboard inputs?"
- "How can I use `document.querySelector` to select multiple elements in JavaScript?"
#### 4- Task 5: Final Touches:
- Ensure that all robots are displayed correctly in the gallery.
- Make sure all files (robots-harmony.html, robots-harmony.css, robots-harmony.js) are in the same folder submitted to your `Gitea`.
- Double-check the code to ensure everything is clean and well-organized.
### Expected Output
Your project needs to check all the previous tasks, it will look something close to (and maybe better than) [this](https://youtu.be/pWD0tbyTyiI).
### Bonus part
If you would like to make your project even more creative, you can add more features to your `gallery` on top of the mandatory ones!
It could be `music` to the `background`, `pop-out` information window or anything that makes your project `different`!
> Remember to ensure that the mandatory part is working perfectly before adding more effects.
Look at all of you—you've made it to this point, working on uniting all your robot friends after bringing them to life. Now in this final step (or maybe the beginning), use your collaboration skills as much as you can!
**"Alone, we can do so little; together, we can do so much." — Helen Keller**

View File

@ -0,0 +1,55 @@
#### General
##### Check the Repository Content:
Files that must be inside the repository:
- robots-harmony.html
- robots-harmony.css
- robots-harmony.js
###### Are the required files present in the repository?
#### HTML Structure
###### Verify that the HTML file contains a `<head>`, `<body>`, and `<html>` tag.
###### Check if the `robots-harmony.html` file includes a `<div>` with the ID gallery.
###### Verify that each robot is placed inside its own div with a class of `name-robot` (The name is the team member's name).
###### Ensure that each robot's section has an `<h3>` for the robots name and a `<p>` for the robots description.
###### Is the HTML structure properly set up according to the instructions?
###### Does each robot have its unique div with appropriate classes and tags?
#### CSS Styling:
###### Verify that the `robots-harmony.css` file includes the required global styles, such as `*`, `body`, `section`, and others.
###### Ensure that the `#gallery` ID has been styled with the required properties, including a customized `background-color`.
###### Confirm that each `name-robot` class has been styled using the block provided in the instructions.
###### Verify that a `hover animation` is applied to each robot's class.
###### Verify that a `background` animation is applied.
#### JavaScript Functionality
###### Verify that `robots-harmony.js` is correctly linked to the HTML file.
###### Check if the functions `changeArmColor`, `changeLegColor`, `changeEyeColor`, and `changeFaceColor` are implemented correctly.
###### Ensure that the event listeners are set up to listen for `keydown` events and trigger the correct functions.
###### Are the event listeners working as expected when keys are pressed?
#### Functionality and Design
###### Test the website to ensure that all robots are displayed correctly in the gallery.
###### Verify that all mandatory interactive features (color changes on `keydown`, hover and background effects) function as intended.
##### Bonus: If the team implemented further functionalities, ask for a quick presentation of what they added on their submission.

View File

@ -0,0 +1,62 @@
## Star Forge
> Mindful AI mode
Just as the Star Forge is a legendary source of power and innovation in the Star Wars universe, Artificial Intelligence tools are the cutting-edge instruments for modern learners. Imagine harnessing AI in your learning journey, forging new paths of understanding and creating knowledge with precision.
> Let's discover together the new subject section you will find from now on in the next subjects:
### AI-Powered Learning Techniques
As you dive into this quest, using AI tools can significantly boost your learning.
A key skill is mastering how to `Speak AI`, which means knowing how to ask AI the right questions to get the answers you need while learning.
You must understand these few easy concepts first:
> **A prompt** is a question or instruction given to a generative AI to produce a specific response or action, helping users learn or achieve a desired outcome.
> **Generative AI** is an exciting tool that helps you learn by generating new content, like texts and images, based on existing examples and your prompts, making the learning process more dynamic and engaging!
**Suggested Free Generative AI Tools:**
- [ChatGPT](https://chatgpt.com/)
- [Phind](https://www.phind.com/)
- [Gemini](https://gemini.google.com/)
For example:
### Metaphor Explanation Technique
This type of prompt encourages the AI to explain complex concepts using simple metaphors, making them easier to understand.
**`Prompt example`**
- "Explain what a variable is in JavaScript using a metaphor."
**How to Use It with ChatGPT:**
1. **Open your favorite Generative AI (ChatGPT as an example)**: Go to [ChatGPT](https://chatgpt.com/) and start a new chat session.
2. **Enter the Prompt**: Type or paste your prompt into the chat. For example, "Explain what a variable is in JavaScript using a metaphor."
3. **Review the Response**: ChatGPT will provide a metaphorical explanation. For instance:
> "A variable in JavaScript is like a labeled jar that you can store items in. You can put different things into the jar (like numbers, strings, or objects) and label it with a name so you can easily find and use the contents later. For example: `let myJar = 'Cookies';`."
4. **Ask Follow-Up Questions and compare results with your peers**: If you need further clarification or more metaphors, you can ask follow-up questions!
---
Similar to this technique , we will discover in each incoming exercise, a new way to learn with AI , helping you achieve your goals with your peers
> Remember that we use AI as a tool to understand deeply the notions, and not to get ready answers! So collaborate with your peers ;)
### Task:
Write the following line of code in the code editor. Put `Yes` in between the quotes, then submit it:
```js
let ready = "";
```
You just declared a variable ! What does that mean ? Well, let's move to the next exercise where you will discover
to `declare everything`!

View File

@ -0,0 +1,114 @@
## The Smooth Operator
> Mindful AI mode
> Unlike the song, smooth operators in JavaScript help you perform various calculations and manipulations with ease.
### AI-Powered Learning Techniques
**Step-by-Step Instruction Technique:**
This type of prompt encourages the AI to provide detailed, step-by-step instructions for learning new concepts.
> Find the examples across the subject ;)
## Concepts:
### Math Operators
In JavaScript, operators are symbols that perform operations on variables and values. Let's delve into the most common types of operators you'll encounter.
There are other operators other than assignment, for now let's focus on the one you
probably already know:
- `+` Addition
- `-` Subtraction
- `/` Division
- `*` Multiplication
Those operators are used the same way we would write them in math:
```js
console.log(5 + 7); // -> 12
console.log(5 * 5); // -> 25
console.log(7 - 5); // -> 2
console.log(9 / 3); // -> 3
```
Operators are evaluated using classic priority:
```js
console.log(1 + 5 * 10); // -> 51
```
you can use parentheses `()` to enforce priority:
```js
console.log((1 + 5) * 10); // -> 60
```
And they result in a value, so they can be assigned to variables:
```js
let halfMyAge = 33 / 2;
let twiceMyAge = 33 * 2;
```
#### **`Prompt example`**:
"Can you provide step-by-step examples of basic math operations in JavaScript?"
### Placeholders
JavaScript allows you to include expressions within strings using template literals. This is done using backticks ``(`)`` and the `${}` syntax to include expressions.
#### Example
```js
console.log(`5 + 10 = ${5 + 10} = 15`); // -> 5 + 10 = 15 = 15
```
**Note that it only works using:** the `` ` `` backtick, not the `"` or `'`
quotes.
#### **`Prompt example`**:
"Can you provide a step-by-step guide on how to use template literals to create a string that includes variable values in JavaScript?"
### Instructions
#### Task 1:
Your code must use the given variable `smooth` as our initial value
> When in doubt, always test your code with console.log() and the Run button.
> But, when the platform gives you an already existing variable to manipulate, like the `smooth` variable here, if you want to use/display it, you have to do so with the submit button.
> You'll then see the result in the code editor console output, as this variable is not available in `Run` button mode, but only in `Submit` button mode.
```js
console.log("smooth = ", smooth);
let lessSmooth = smooth - 5;
console.log("lessSmooth = ", lessSmooth);
```
You will declare a few variables:
- `lessSmooth` that is just `1` less than `smooth`
- `semiSmooth` that is half the amount of `smooth` _(it's still pretty
smooth)_
- `plus11` that is `smooth` plus `11`
- `ultraSmooth` that is the square of smooth _(now that's smooth !)_
#### Task 2:
We will provide a variable `name` and `age`. They will be pre-declared by us.
Declare your robot's `presentation` variable of the string:
> `Hello, my name is` **name** `and I'm` **age** `years old`
> But use placeholders to build the string you will put inside the `presentation`.
> Put the values of the provided variables `age` and `name` inside those placeholders.
---
> BGM:
> [Sade - Smooth Operator - Official - 1984](https://www.youtube.com/watch?v=4TYv2PhG89A)

View File

@ -0,0 +1,79 @@
## Transform Objects
> Mindful AI mode
### Context
Imagine your favorite robot friend with all its cool features: a type, weight, and operational status.
In JavaScript, we use objects to group these properties together, making it easy to manage and tweak our robots settings. Lets see how we can modify, add, or remove properties in a JavaScript object to make our robot even cooler!
### AI-Powered Learning Techniques
**Contextual Learning Technique:**
This strategy places learning within a real-world or practical context by having the AI relate concepts to scenarios you might encounter in everyday life or your work. It helps you understand the relevance of what youre learning and how to apply it.
Find the examples across the subject ;)
### Concepts
### Modifying Objects
Let's start with a robot object:
```js
const robot = {
points: 0,
code: "75lai78wn",
};
```
### Adding a New Property
Give your robot a name:
```js
robot.name = "RoboMax";
```
### Changing a Property Value
Boost your robots points:
```js
robot.points = 10;
```
### Removing a Property
Remove a property:
```js
robot.code = undefined;
```
#### **`Prompt Example`**:
- "Think about your pet. How would you use an object to keep track of its name, age, and favorite food?"
- "You have a collection of books. How could you use an object to remember the title, author, and how many pages each book has?"
### Instructions
#### Task 1:
Modify the provided `robot` variable:
- Add a `model` property with the string value 'RX-78'.
- Add a `fullName` property that is the joined value of the `brand` and the `model` with a space in between.
- Add `10` to its `batteryLevel` property.
#### Task 2:
Let's move away from objects a bit, and discover a notion we will use later. `Duplicating a String with Placeholders`!
Declare a variable `duplicate` that repeats the provided variable `sentence`, separated by a comma, and adds an exclamation mark at the end.
> For example, if `sentence` is "Hello there", we expect "Hello there, Hello there!".
**What a good occasion to apply what you learned in using generative AI and documentations to understand duplicating a string with placeholders! Now you are capable to find the information everywhere;)**

View File

@ -1,18 +1,22 @@
## Emotions detection with Deep Learning
Cameras are everywhere. Videos and images have become one of the most interesting data sets for artificial intelligence.
Image processing is a quite broad research area, not just filtering, compression, and enhancement. Besides, we are even interested in the question, “what is in images?”, i.e., content analysis of visual inputs, which is part of the main task of computer vision.
The study of computer vision could make possible such tasks as 3D reconstruction of scenes, motion capturing, and object recognition, which are crucial for even higher-level intelligence such as image and video understanding, and motion understanding.
For this 2 months project we will
focus on two tasks:
Image processing is a quite broad research area, not just filtering, compression, and enhancement.
- emotion classification
- face tracking
Besides, we are even interested in the question, “what is in images?”, i.e., content analysis of visual inputs, which is part of the main task of computer vision.
The study of computer vision could make possible such tasks as 3D reconstruction of scenes, motion capturing, and object recognition, which are crucial for even higher-level intelligence such as image and video understanding, and motion understanding.
For this project we will focus on two tasks:
- Emotion classification
- Face tracking
With the computing power exponentially increasing the computer vision field has been developing exponentially. This is a key element because the computer power allows using more easily a type of neural networks very powerful on images:
CNN's (Convolutional Neural Networks). Before the CNNs were democratized, the algorithms used relied a lot on human analysis to extract features which obviously time-consuming and not reliable. If you're interested in the "old
school methodology" [this article](https://towardsdatascience.com/classifying-facial-emotions-via-machine-learning-5aac111932d3) explains it.
The history behind this field is fascinating! [Here](https://kapernikov.com/basic-introduction-to-computer-vision/) is a short summary of its history.
- CNN's (Convolutional Neural Networks). Before the CNNs were democratized, the algorithms used relied a lot on human analysis to extract features which obviously time-consuming and not reliable. If you're interested in the "old school methodology" [this article](https://towardsdatascience.com/classifying-facial-emotions-via-machine-learning-5aac111932d3) explains it.
- The history behind this field is fascinating! [Here](https://kapernikov.com/basic-introduction-to-computer-vision/) is a short summary of its history.
### Project goal and suggested timeline
@ -31,15 +35,18 @@ The two steps are detailed below.
### Preliminary:
- Take [this course](https://www.coursera.org/learn/convolutional-neural-networks). This course is a reference for many reasons and one of them is the creator: **Andrew Ng**. He explains the basics of CNNs but also some more advanced topics as transfer learning, siamese networks etc ...
I suggest to focus on Week 1 and 2 and to spend less time on Week 3 and 4. Don't worry the time scoping of such MOOCs are conservative. You can attend the lessons for free!
- I suggest to focus on Week 1 and 2 and to spend less time on Week 3 and 4. Don't worry the time scoping of such MOOCs are conservative. You can attend the lessons for free!
- Participate in [this challenge](https://www.kaggle.com/c/digit-recognizer/code). The MNIST dataset is a reference in computer vision. Researchers use it as a benchmark to compare their models.
Start first with a logistic regression to understand how to handle images in Python. And then train your first CNN on this data set.
- Start first with a logistic regression to understand how to handle images in Python. And then train your first CNN on this data set.
### Face emotions classification
Emotion detection is one of the most researched topics in the modern-day machine learning arena. The ability to accurately detect and identify an emotion opens up numerous doors for Advanced Human Computer Interaction.
The aim of this project is to detect up to seven distinct facial emotions in real time. This project runs on top of a Convolutional Neural Network (CNN) that is built with the help of Keras whose backend is TensorFlow in Python.
The aim of this project is to detect up to seven distinct facial emotions in real time.
This project runs on top of a Convolutional Neural Network (CNN) that is built with the help of Keras whose backend is TensorFlow in Python.
The facial emotions that can be detected and classified by this system are Happy, Sad, Angry, Surprise, Fear, Disgust and Neutral.
Your goal is to implement a program that takes as input a video stream that contains a person's face and that predicts the emotion of the person.
@ -49,10 +56,10 @@ Your goal is to implement a program that takes as input a video stream that cont
- Download and unzip the [data here](https://assets.01-edu.org/ai-branch/project3/emotions-detector.zip).
This dataset was provided for this past [Kaggle challenge](https://www.kaggle.com/competitions/challenges-in-representation-learning-facial-expression-recognition-challenge/overview).
It is possible to find more information about on the challenge page. Train a CNN on the dataset `train.csv`. Here is an [example of architecture](https://www.quora.com/What-is-the-VGG-neural-network) you can implement.
**The CNN has to perform more than 70% on the test set**. You can use the `test_with_emotions.csv` file for this. You will see that the CNNs take a lot of time to train.
**The CNN has to perform more than 60% on the test set**. You can use the `test_with_emotions.csv` file for this. You will see that the CNNs take a lot of time to train.
You don't want to overfit the neural network. I strongly suggest to use early stopping, callbacks and to monitor the training using the `TensorBoard`.
You have to save the trained model in `my_own_model.pkl` and to explain the chosen architecture in `my_own_model_architecture.txt`. Use `model.summary())` to print the architecture.
You have to save the trained model in `final_emotion_model.keras` and to explain the chosen architecture in `final_emotion_model_arch.txt`. Use `model.summary())` to print the architecture.
It is also expected that you explain the iterations and how you end up choosing your final architecture. Save a screenshot of the `TensorBoard` while the model's training in `tensorboard.png` and save a plot with the learning curves showing the model training and stopping BEFORE the model starts overfitting in `learning_curves.png`.
- Optional: Use a pre-trained CNN to improve the accuracy. You will find some huge CNN's architecture that perform well. The issue is that it is expensive to train them from scratch.
@ -86,13 +93,10 @@ project
├── environment.yml
├── README.md
├── results
│   ├── hack_cnn
│   │   ├── hacked_image.png
│   │   └── input_image.png
│   ├── model
│   │   ├── learning_curves.png
│   │   ├── my_own_model_architecture.txt
│   │   ├── my_own_model.pkl
│   │   ├── final_emotion_model_arch.txt
│   │   ├── final_emotion_model.keras
│   │   ├── pre_trained_model_architecture.txt
│   │   └── pre_trained_model.pkl
│   └── preprocessing_test
@ -101,7 +105,7 @@ project
│   ├── image_n.png
│   └── input_video.mp4
└── scripts
├── hack_the_cnn.py
|__ validation_loss_accuracy.py
├── predict_live_stream.py
├── predict.py
├── preprocess.py
@ -114,7 +118,7 @@ project
```prompt
python ./scripts/predict.py
Accuracy on test set: 72%
Accuracy on test set: 62%
```

View File

@ -24,12 +24,12 @@
###### Does the text document explain why the architecture was chosen, and what were the previous iterations?
###### Does the following command `python ./scripts/predict.py` run without any error and returns an accuracy greater than 70%?
###### Does the following command `python ./scripts/predict.py` run without any error and returns an accuracy greater than 60%?
```prompt
python ./scripts/predict.py
Accuracy on test set: 72%
Accuracy on test set: 62%
```

View File

@ -46,10 +46,8 @@ project
| | gender_submission.csv
└───notebook
│ │ EDA.ipynb
|
|───scripts
│ │ main.ipynb
```
@ -59,21 +57,19 @@ project
- `username.txt` contains the username, the last modified date of the file **has to correspond to the first day of the project**.
- `EDA.ipynb` contains the exploratory data analysis. This file should contain all steps of data analysis that contributed or not to improve the accuracy. It has to be commented so that the reviewer can understand the analysis and run it without any problem.
- `scripts` contains python file(s) that perform(s) the feature engineering, the model's training and prediction on the test set. It could also be one single Jupyter Notebook. It has to be commented to help the reviewers understand the approach and run the code without any bugs.
- `main.ipynb` This file (single Jupyter Notebook) should contain all steps of data analysis that contributed or not to improve the accuracy, the feature engineering, the model's training and prediction on the test set. It has to be commented to help the reviewers understand the approach and run the code without any bugs.
- **Submit your predictions on the Kaggle's competition platform**. Check your ranking and score in the leaderboard.
### Scores
In order to validate the project you will have to score at least **79% accuracy on the Leaderboard**:
- 79% accuracy is the minimum score to validate the project.
- 78.9% accuracy is the minimum score to validate the project.
Scores indication:
- 79% difficult - minimum required
- 81% very difficult: smart feature engineering needed
- 78.9% difficult - minimum required
- 80% very difficult: smart feature engineering needed
- More than 83%: excellent that corresponds to the top 2% on Kaggle
- More than 85%: cheating
@ -108,8 +104,6 @@ Iteration 3:
- Perform an EDA. Make assumptions and check them. Example: What if first class passengers survived more. Check the assumption through EDA and create relevant features to help the model capture the information.
- Run a gridsearch
Iteration 4:
- Good luck !

View File

@ -241,8 +241,10 @@ breast: One Hot
breast-quad: One Hot
['right_low' 'left_low' 'left_up' 'central' 'right_up']
irradiat: One Hot
['yes' 'no']
Class: Target (One Hot)
['recurrence-events' 'no-recurrence-events']
```
@ -259,16 +261,16 @@ input: ohe.transform(X_test[ohe_cols])[:10]
output:
array([[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0.],
[0., 1., 1., 0., 0., 1., 0., 0., 0., 0., 1.],
[0., 1., 1., 0., 0., 1., 0., 0., 0., 0., 1.],
[1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 1., 0., 0., 0., 0., 1., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 0., 0., 1., 1., 0.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 0., 1., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[0., 1., 1., 0., 0., 0., 1., 0., 0., 0., 1.]])
[1., 0., 1., 0., 0., 0., 0., 1., 0., 0., 1.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.]])
input: ohe.get_feature_names(ohe_cols)
input: ohe.get_feature_names_out(ohe_cols)
output:
array(['node-caps_no', 'node-caps_yes', 'breast_left', 'breast_right',
'breast-quad_central', 'breast-quad_left_low',

View File

@ -146,14 +146,14 @@ dtype: int64
array([[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0.],
[0., 1., 1., 0., 0., 1., 0., 0., 0., 0., 1.],
[0., 1., 1., 0., 0., 1., 0., 0., 0., 0., 1.],
[1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 1., 0., 0., 0., 0., 1., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 0., 0., 1., 1., 0.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 0., 1., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.],
[1., 0., 0., 1., 0., 0., 1., 0., 0., 1., 0.],
[0., 1., 1., 0., 0., 0., 1., 0., 0., 0., 1.]])
[1., 0., 1., 0., 0., 0., 0., 1., 0., 0., 1.],
[1., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0.]])
```
@ -162,16 +162,16 @@ array([[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0.],
```console
#First 10 rows:
array([[1., 2., 5., 0., 1.],
[1., 3., 4., 0., 1.],
[1., 2., 4., 0., 1.],
[1., 3., 2., 0., 1.],
[1., 4., 3., 0., 1.],
[1., 4., 5., 0., 0.],
[2., 5., 4., 0., 1.],
[2., 5., 8., 0., 1.],
[0., 2., 3., 0., 2.],
[1., 3., 6., 4., 2.]])
array([[2., 5., 2., 0., 1.],
[2., 5., 2., 0., 0.],
[2., 5., 4., 5., 2.],
[1., 4., 5., 1., 1.],
[2., 5., 5., 0., 2.],
[1., 2., 1., 0., 1.],
[1., 2., 8., 0., 1.],
[2., 5., 2., 0., 0.],
[2., 5., 5., 0., 2.],
[1., 2., 3., 0., 0.]])
```
@ -180,8 +180,8 @@ array([[1., 2., 5., 0., 1.],
```console
# First 2 rows:
array([[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0., 1., 2., 5., 0., 1.],
[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0., 1., 3., 4., 0., 1.]])
array([[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0., 2., 5., 2., 0., 1.],
[1., 0., 1., 0., 0., 1., 0., 0., 0., 1., 0., 2., 5., 2., 0., 0.]])
```
---

View File

@ -1,10 +1,12 @@
## Financial strategies on the SP500
In this project we will apply machine to finance. You are a Quant/Data Scientist and your goal is to create a financial strategy based on a signal outputted by a machine learning model that over-performs the [SP500](https://en.wikipedia.org/wiki/S%26P_500).
In this project, you'll apply machine learning to finance. Your goal as a Quant/Data Scientist is to create a financial strategy that uses a signal generated by a machine learning model to outperform the [SP500](https://en.wikipedia.org/wiki/S%26P_500).
The Standard & Poor's 500 Index is a collection of stocks intended to reflect the overall return characteristics of the stock market as a whole. The stocks that make up the S&P 500 are selected by market capitalization, liquidity, and industry. Companies to be included in the S&P are selected by the S&P 500 Index Committee, which consists of a group of analysts employed by Standard & Poor's.
The S&P 500 Index originally began in 1926 as the "composite index" comprised of only 90 stocks. According to historical records, the average annual return since its inception in 1926 through 2018 is approximately 10%11%. The average annual return since adopting 500 stocks into the index in 1957 through 2018 is roughly 8%.
As a Quant Researcher, you may beat the SP500 one year or few years. The real challenge though is to beat the SP500 consistently over decades. That's what most hedge funds in the world are trying to do.
The S&P 500 Index is a collection of 500 stocks that represent the overall performance of the U.S. stock market. The stocks in the S&P 500 are chosen based on factors like market value, liquidity, and industry. These selections are made by the S&P 500 Index Committee, which is a group of analysts from Standard & Poor's.
The S&P 500 started in 1926 with only 90 stocks and has grown to include 500 stocks since 1957. Historically, the average annual return of the S&P 500 has been about 10-11% since 1926, and around 8% since 1957.
As a Quantitative Researcher, your challenge is to develop a strategy that can consistently outperform the S&P 500, not just in one year, but over many years. This is a difficult task and is the primary goal of many hedge funds around the world.
The project is divided in parts:
@ -199,4 +201,5 @@ Note: `features_engineering.py` can be used in `gridsearch.py`
### Files for this project
You can find the data required for this project in this [link](https://assets.01-edu.org/ai-branch/project4/project04-20221031T173034Z-001.zip)
You can find the data required for this project in this :
[link](https://assets.01-edu.org/ai-branch/project4/project04-20221031T173034Z-001.zip)

View File

@ -43,3 +43,4 @@ Files that must be inside your repository:
- All tools you use, and any scripts you write.
> It's forbidden to use external scripts, in the audit you will be asked different questions about the concepts and the practices of this project, prepare yourself!
> It's is forbidden to use `strings` command.

View File

@ -0,0 +1,182 @@
## OSINT-Master
<center>
<img src="./resources/osint-meme.png?raw=true" style = "width: 673px !important; height: 439px !important;"/>
</center>
### Introduction:
Open-source intelligence (OSINT) is a key component of cybersecurity, providing valuable insights into potential vulnerabilities and security risks. This project involves creating a tool that performs comprehensive passive reconnaissance using publicly available data.
### Objective:
The goal is to build a multi-functional tool using a programming language of your choice, The tool is capable of retrieving detailed information based on user inputs such as `Full names`, `IP addresses`, `usernames`, and `domains`. This project will enhance your skills in data analysis, ethical considerations, and the use of various cybersecurity tools and APIs.
By completing this project, You will:
- Develop an understanding of OSINT techniques and their applications.
- Gain practical experience in programming, API integration, and data handling.
- Learn to identify and mitigate security risks, including subdomain takeovers.
- Understand the ethical and legal implications of cybersecurity practices.
### Resources
Some useful resources:
- [Open-source intelligence](https://en.wikipedia.org/wiki/Open-source_intelligence)
- [Doxing](https://en.wikipedia.org/wiki/Doxing)
- [OSINT Tools on GitHub](https://github.com/topics/osint-tools)
Before asking for help, ask yourself if you have really thought about all the possibilities.
### Role play
To enhance the learning experience and assess your knowledge, a role play question session will be included as part of this project.
This section will involve answering a series of questions in a simulated real-world scenario where you assume the role of a Cyber Security Expert explaining how to protect information from OSINT techniques to a team or stakeholder.
The goal of the role play question session is to:
- Assess your understanding of OSINT risks and mitigation strategies.
- Test your ability to communicate effectively and explain security measures related to this project.
- Challenge you to think critically about the importance of information security and consider alternative approaches.
- Explain what subdomain takeovers are.
Prepare for a role play question session in the audit.
### Project Requirements
#### Input Handling:
The tool should accept the following inputs: `Full Name`, `IP Address`, `Username`, and `Domain`.
#### Information Retrieval:
- Full Name:
Parse the input to extract "First Name" and "Last Name".
Look up associated information such as phone numbers, addresses, and social media profiles using directory APIs or web scraping.
- IP Address:
Retrieve geolocation data, ISP details, and check for any historical data associated with the IP (e.g., from abuse databases).
- Username:
Check for the presence of the username on at least five known social networks and public repositories.
Retrieve public profile information, such as profile bio, activity status, and follower count.
- Domain and Subdomain Enumeration:
Enumerate subdomains and gather information including IP addresses, SSL certificate details, and potential vulnerabilities.
Identify potential subdomain takeover risks by analyzing DNS records and associated resources.
> You are responsible for choosing the way you want to find the data and for using the APIs. Be aware of the API's `Terms of Use` and `Cost` before use!
#### Output Management:
Store the results in a well-organized file format.
### Usage Examples
#### Command Line Interface:
```sh
$> osintmaster --help
Welcome to osintmaster multi-function Tool
OPTIONS:
-n "Full Name" Search information by full name
-i "IP Address" Search information by IP address
-u "Username" Search information by username
-d "Domain" Enumerate subdomains and check for takeover risks
-o "FileName" File name to save output
```
#### Example Outputs:
```sh
$> osintmaster -n "FNAME LNAME" -o result1.txt
First name: FNAME
Last name: LNAME
Phone Number: +1234567890
Address: Address123, CITY, COUNTRY-CODE
LinkedIn: linkedin.com/in/XX.XX
Facebook: facebook.com/XX.XX
Data Saved in result1.txt
```
#### IP Address:
```sh
$> osintmaster -i 8.8.8.8 -o result2.txt
ISP: Google LLC
City: Mountain View
Country: COUNTRY
ASN: 15169
Known Issues: No reported abuse
Data Saved in result2.txt
```
#### Username:
```sh
$> osintmaster -u "@username" -o result3.txt
Facebook: Found
Twitter: Found
LinkedIn: Found
Instagram: Not Found
GitHub: Found
Recent Activity: Active on GitHub, last post 1 days ago
Data Saved in result3.txt
```
#### Domain and Subdomain Enumeration:
```sh
$> osintmaster -d "example.com" -o result4.txt
Main Domain: example.com
Subdomains found: 3
- www.example.com (IP: 123.123.123.123)
SSL Certificate: Valid until 2030-03-01
- mail.example.com (IP: 123.123.123.123)
SSL Certificate: Valid until 2030-03-01
- test.example.com (IP: 123.123.123.123)
SSL Certificate: Not found
Potential Subdomain Takeover Risks:
- Subdomain: test.example.com
CNAME record points to a non-existent AWS S3 bucket
Recommended Action: Remove or update the DNS record to prevent potential misuse
Data saved in result4.txt
```
### Bonus
If you complete the mandatory part successfully, and you still have free time, you can implement anything that you feel deserves to be a bonus, for example:
- User Interface: Develop a graphical user interface (GUI) for better user accessibility.
- PDF Generation: Add a feature to generate your OSINT result as PDF files.
Challenge yourself!
### Documentation
Create a `README.md` file that provides comprehensive documentation for your tool (prerequisites, setup, configuration, usage, ...). This file must be submitted as part of the solution for the project.
Add clear guidelines and warnings about the ethical and legal use of the tool to your documentation.
### Ethical and Legal Considerations
- Get Permission: Always obtain explicit permission before gathering information.
- Respect Privacy: Collect only necessary data and store it securely.
- Follow Laws: Adhere to relevant laws such as GDPR and CFAA.
- Report Responsibly: Privately notify affected parties of any vulnerabilities.
- Educational Use Only: Use this tool and techniques solely for learning and improving security.
> ⚠️ Disclaimer: This project is for educational purposes only. Ensure all activities comply with legal and ethical standards. The institution is not responsible for misuse of the techniques and tools demonstrated.
### Submission and audit
Upon completing this project, you should submit the following:
- Your documentation in the `README.md` file.
- The Source code of your tool.
- Any required files to run your tool.

View File

@ -0,0 +1,107 @@
#### General
##### Check the Repo content.
Files that must be inside the repository:
- Detailed documentation in the `README.md` file.
- Source code for the OSINT-Master tool.
- Any required configuration files and scripts for running the tool.
###### Are all the required files present?
##### Play the role of a stakeholder
Organize a simulated scenario where the student take on the role of Cyber Security Experts and explain their solution and knowledge to a team or stakeholder. Evaluate their grasp of the concepts and technologies used in the project, their communication efficacy, and their critical thinking about their solution and knowledge behind this project.
Suggested role play questions include:
- What is OSINT and why is it significant in cybersecurity?
- What types of information can be gathered using OSINT techniques?
- Explain what subdomain takeovers are, and how to protect against it?
- How does the OSINT-Master tool help identify sensitive information?
- What challenges did you face while developing the OSINT-Master tool and how did you address them?
- How can we protect our critical information from OSINT techniques?
- How can this tool help in a defensive approach?
###### Were the student able to answer all the questions?
###### Did the student demonstrate a thorough understanding of the concepts and technologies used in the project?
###### Were the students able to communicate effectively and justify their decisions and explain the knowledge behind this project?
###### Was the student able to evaluate the value of this project in real-life scenarios?
###### Did the students demonstrate an understanding of ethical and legal considerations related to OSINT?
##### Check the Student Documentation in the `README.md` File
###### Does the `README.md` file contain all the necessary information about the tool (prerequisites, setup, configuration, usage, ...)?
###### Does the `README.md` file contain clear guidelines and warnings about the ethical and legal use of the tool?
##### Review the Tool's Design and Implementation
1. **Help Command:**
```sh
$> osintmaster --help
```
###### Does the output include explanation how to use the tool?
2. **Full Name Option:**
```sh
$> osintmaster -n "Full Name" -o filename
```
###### Does the output include accurate details such as phone numbers, addresses, and social media profiles?
###### Does the output stored to the file specified in the output parameter?
3. **IP Address Option:**
```sh
$> osintmaster -i "IP Address" -o filename
```
###### Does the output include geolocation data, ISP details, and historical data?
###### Does the output stored to the file specified in the output parameter?
4. **Username Option:**
```sh
$> osintmaster -u "Username" -o filename
```
###### Does the output check the presence of the username on multiple social networks and public repositories?
###### Does the output stored to the file specified in the output parameter?
5. **Domain Option:**
```sh
$> osintmaster -d "Domain" -o filename
```
###### Does the output enumerate subdomains, gather relevant information, and identify potential subdomain takeover risks?
###### Does the output stored to the file specified in the output parameter?
##### Ensure that the student submission meets the project requirements:
1. **Functionality:** Does the tool retrieve detailed information based on the given inputs (Full Name, IP Address, Username, and Domain)?
2. **Data Accuracy:** Is the retrieved information accurate and relevant?
3. **Ethical Considerations:** Are there clear guidelines and warnings about the ethical and legal use of the tool?
4. **Usability:** Is the tool user-friendly and well-documented?
###### Did the tool design and implementation align with all the project requirements above?
###### Were the students able to implement a functional and reliable tool that meets the project requirements?
#### Bonus
###### + Did the student implement additional valuable features?
###### + Is this project an outstanding project that exceeds the basic requirements?

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

View File

@ -0,0 +1,184 @@
## Pentest-kit
<center>
<img src="./resources/pentest-meme.jpg?raw=true" style = "width: 700px !important; height: 464px !important;"/>
</center>
### Introduction:
Penetration testing (Pentesting) is a critical process in cybersecurity, involving the use of specialized tools to identify and exploit vulnerabilities in systems and networks. Pentest tools are essential for conducting thorough security assessments, helping to safeguard against potential threats.
### Objective:
Using a programming language from your choice you will create a multi-functional tool for penetration testing, similar to popular security tools like `Nmap`, and `Dirsearch`. This project aims to give hands-on experience in understanding and developing security tools and building a practical toolkit for various Pentesting tasks.
By completing this project, You will:
- Gain practical experience in developing custom pentesting tools.
- Understand the core functionalities of port scanning, directory brute-forcing, network mapping, and HTTP header analysis.
- Learn how to build a cohesive set of utilities for penetration testing.
- Enhance your understanding of ethical considerations in cybersecurity.
### Resources
Some useful resources:
- [Penetration testing](https://en.wikipedia.org/wiki/Penetration_test)
- [Dirsearch](https://www.kali.org/tools/dirsearch/)
- [Port Scanning](https://en.wikipedia.org/wiki/Port_scanner)
- [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)
Before asking for help, ask yourself if you have really thought about all the possibilities.
### Role play
To enhance the learning experience and assess your knowledge, a role play question session will be included as part of this project. This section will involve answering a series of questions in a simulated real-world scenario where you assume the role of a Cyber Security Expert explaining how to use pentesting tools to a team or stakeholder.
The goal of the role play question session is to:
- Assess your understanding of pentesting tools and techniques.
- Test your ability to communicate effectively and explain security measures related to this project.
- Challenge you to think critically about the importance of penetration testing and consider alternative approaches.
Prepare for a role play question session in the audit.
### Project Requirements
#### Tool Development:
You will develop the following tools:
1. **TinyScanner (Simple Port Scanner):**
- Create a tool that checks for open, closed, or filtered ports on a target host.
- The tool should support TCP scanning and the ability to scan a range of ports.
2. **DirFinder (Small Dirsearch):**
- Develop a tool to discover hidden directories and files on a web server by brute-forcing common paths using a wordlist.
3. **HostMapper:**
- Build a tool to perform a ping sweep to identify live hosts on a subnet.
4. **HeaderGrabber:**
- Implement a tool that retrieves and analyzes HTTP headers from a web server.
> All the tools must be built from scratch. Calling existing or external CLI will not be considered a valid solution in the audit!
#### Input Handling:
Each tool should accept the relevant input parameters, such as IP addresses, URLs, and port ranges.
#### Output Management:
Store the results in a well-organized file format.
### Usage Examples
#### Command Line Interface:
```sh
$> pentestkit --help
Welcome to PentestKit
OPTIONS:
-t TinyScanner Run the simple port scanner.
Use this option to specify the target IP address and the ports you wish to scan.
Example: -t 192.168.1.1 -p 22,80,443
-d DirFinder Run the directory brute-forcer.
Use this option to specify the target URL and the path to a wordlist for discovering hidden directories.
Example: -d http://example.com -w /path/to/wordlist.txt
-h HostMapper Run the network host mapper.
Use this option to perform a ping sweep on a specified subnet to identify live hosts.
Example: -h 192.168.1.0/24
-g HeaderGrabber Run the HTTP header analyzer.
Use this option to retrieve and analyze HTTP headers from a specified URL, useful for identifying security headers.
Example: -g http://example.com
-o "FileName" File name to save output.
Use this option to specify the file name where the results of the scan or analysis will be saved.
Example: -o result.txt
```
#### Example Outputs:
1. **TinyScanner (Simple Port Scanner):**
```sh
$> pentestkit -t 192.168.1.1 -p 22,80,443 -o result1.txt
Port 22 is open (SSH)
Port 80 is open (HTTP)
Port 443 is closed
Data Saved in result1.txt
```
2. **DirFinder (Small Dirsearch):**
```sh
$> pentestkit -d http://example.com -w /path/to/wordlist.txt -o result2.txt
/admin [Status: 200]
/uploads [Status: 403]
/login [Status: 200]
Data Saved in result2.txt
```
3. **HostMapper:**
```sh
$> pentestkit -h 192.168.1.0/24 -o result3.txt
Live hosts found:
192.168.1.1
192.168.1.10
192.168.1.15
Data Saved in result3.txt
```
4. **HeaderGrabber:**
```sh
$> pentestkit -g http://example.com -o result4.txt
HTTP/1.1 200 OK
Date: Mon, 01 Jan 2022 12:00:00 GMT
Server: Apache/2.4.41 (Ubuntu)
X-Powered-By: PHP/7.4.3
Warning: Missing Security Headers - X-Content-Type-Options, X-Frame-Options
Data saved in result4.txt
```
### Bonus
If you complete the mandatory part successfully, and you still have free time, you can implement anything that you feel deserves to be a bonus, for example:
- Adding a graphical user interface (GUI) for better user accessibility.
- Implementing advanced scanning techniques like SYN scans in TinyScanner.
Challenge yourself!
### Documentation
Create a `README.md` file that provides comprehensive documentation for your tools (prerequisites, setup, configuration, usage, ...). This file must be submitted as part of the solution for the project.
Include clear guidelines and warnings about the ethical and legal use of the tools in your documentation.
### Ethical and Legal Considerations
- Get Permission: Always obtain explicit permission before scanning or testing any network or system.
- Respect Privacy: Collect only necessary data and store it securely.
- Follow Laws: Adhere to relevant laws such as GDPR and CFAA.
- Report Responsibly: Notify affected parties privately if you identify vulnerabilities.
- Educational Use Only: Use these tools solely for learning and improving security.
> ⚠️ Disclaimer: This project is for educational purposes only. Ensure all activities comply with legal and ethical standards. The institution is not responsible for misuse of the techniques and tools demonstrated.
### Submission and Audit
Upon completing this project, you should submit the following:
- Your documentation in the `README.md` file.
- The source code for your tool.
- Any required files to run your tool.

View File

@ -0,0 +1,114 @@
#### General
##### Check the Repo Content.
Files that must be inside the repository:
- Detailed documentation in the `README.md` file.
- Source code for the PentestKit tools.
- Any required configuration files and scripts for running the tools.
###### Are all the required files present?
##### Play the Role of a Stakeholder
Organize a simulated scenario where the student takes on the role of Cyber Security Experts and explains their solution and knowledge to a team or stakeholder. Evaluate their grasp of the concepts and technologies used in the project, their communication efficacy, and their critical thinking about their solution and knowledge behind this project.
Suggested role play questions include:
- What is penetration testing and why is it important in cybersecurity?
- How do the penetration testing tools contribute to identifying vulnerabilities?
- What challenges did you face while developing the PentestKit tools, and how did you address them?
- How does the PentestKit help in conducting thorough security assessments?
- How can these tools be used in a real-life pentesting scenario?
- How do you ensure the ethical and legal use of these pentesting tools?
###### Were the students able to answer all the questions?
###### Did the students demonstrate a thorough understanding of the concepts and technologies used in the project?
###### Were the students able to communicate effectively and justify their decisions and explain the knowledge behind this project?
###### Were the students able to evaluate the value of this project in real-life scenarios?
###### Did the students demonstrate an understanding of ethical and legal considerations related to pentesting?
##### Check the Student Documentation in the `README.md` File
###### Does the `README.md` file contain all the necessary information about the tools (prerequisites, setup, configuration, usage, ...)?
###### Does the `README.md` file contain clear guidelines and warnings about the ethical and legal use of the tools?
##### Review the Tools' Design and Implementation
1. **Help Command:**
```sh
$> pentestkit --help
```
###### Does the output include an explanation of how to use the tools?
2. **TinyScanner (Port Scanning) Option:**
```sh
$> pentestkit -t 192.168.1.1 -p 22,80,443 -o result1.txt
```
###### Does the output correctly show whether the ports are open or closed?
###### Is the output stored in the file specified in the output parameter?
3. **DirFinder (Directory Brute-forcing) Option:**
```sh
$> pentestkit -d http://example.com -w /path/to/wordlist.txt -o result2.txt
```
###### Does the output correctly list the directories and their HTTP status codes?
###### Is the output stored in the file specified in the output parameter?
4. **HostMapper (Network Mapping) Option:**
```sh
$> pentestkit -h 192.168.1.0/24 -o result3.txt
```
###### Does the output correctly identify live hosts on the subnet?
###### Is the output stored in the file specified in the output parameter?
4. **HeaderGrabber (HTTP Header Analysis) Option:**
```sh
$> pentestkit -g http://example.com -o result4.txt
```
###### Does the output correctly retrieve and analyze HTTP headers?
###### Is the output stored in the file specified in the output parameter?
##### Ensure that the student submission meets the project requirements:
1. **Functionality:** Do the tools perform their intended functions accurately (e.g., port scanning, directory brute-forcing, network mapping, HTTP header analysis)?
2. **Data Accuracy:** Is the retrieved information accurate and relevant?
3. **Ethical Considerations:** Are there clear guidelines and warnings about the ethical and legal use of the tools?
4. **Usability:** Are the tools user-friendly and well-documented?
> You can compare the results of the student's tool with another tool to to prove the output match with the expected one if needed!
###### Are all the tools implemented from scratch? Can you confirm that no external CLI are called to perform the checks described in the subject?
###### Did the tool design and implementation align with all the project requirements above?
###### Were the students able to implement functional and reliable tools that meet the project requirements?
#### Bonus
###### + Did the student implement additional valuable features?
###### + Is this project an outstanding project that exceeds the basic requirements?

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

View File

@ -1,82 +1,101 @@
## stealth-boom
In this project, you will have to create an entire stealth game using Unreal Engine.
A stealth game.
<center>
<img src="./resources/mgsmeme.png?raw=true" style = "width: 700px !important; height: 464px !important;"/>
</center>
### Objectives
The idea of this project is to create a little 10 minutes gameplay game with missions, with stealth based gameplay and with an AI patrolling NPC.
The goal of this project is to create a playable gameplay loop around stealth mechanics.
The basics assets you will need for this project can be found in the [Stealth-Boom.zip](https://assets.01-edu.org/Unreal-Engine-Projects/StealthBoom.zip) file. It contains the basic animations, character, enemies and props you will need for this project.
### Scenario
You are an Unreal Engine developer tasked with creating a complete stealth game from scratch. You need to implement everything, including AI behavior trees, player animations, and gun mechanics. As you progress, you realize balancing these elements—ensuring the AI responds accurately to player movements while maintaining smooth gameplay—is more challenging than expected. Every feature, from the main menu to mission completion, must work seamlessly to deliver a polished and playable game within the given constraints.
Good luck. and remember to have fun while making the game!
### Instructions
The following aspects should be fulfilled:
The following requirements should be fulfilled:
- Create a map where the player can walk around.
#### Main Menu:
- This map should contain places for the player to hide from enemies by crouching, hide behind walls, and all other props you may use to help it make a stealth game.
- Buildings with at least 2 floors.
- Pickable ammunition and weapons around the map.
- Option to start the game.
- Adjust the general sound of the game.
- Change graphics settings:
- When changing the resolution, a pop-up should appear in the middle of the screen, asking if the player wants to keep the newly applied graphics settings. If the player clicks "Yes" within 10 seconds, the settings are confirmed. If the 10 seconds pass or the player clicks "No," the settings revert to the previous ones.
- Change the mouse sensitivity.
- Option to invert the mouse vertical axis.
- For the player you should add:
#### Map/Level.
- Walk and run animations
- Reload animation
- Aim animation
- Shoot animation
- Crouch animation
- the player should be able to do the above six actions while crouching
- Melee attack animation
- Gun sound when firing
- Bullets visual impact on walls (see decals documentation)
- Blood particles when hit
- The map should include areas where the player can hide from enemies by `ducking` or taking cover `behind walls and props`.
- There should be pickable ammunition scattered throughout the map.
- Health packs should be placed around the map for the player to collect.
- The game should contain a main menu where the player can:
#### Player:
- Start the game
- Adjust the general sound of the game
- Change the graphics settings
- When changing the resolution, a pop-up should appear in the middle of the screen asking if the player wants to keep the graphics setting he/she just applied. If `Yes` is clicked within 10 seconds, the settings are set, otherwise, if the 10 seconds delay is over or if the player clicks `No`, the settings go back to the old ones.
- Change the mouse sensitivity
- Invert the mouse vertical axis
- The player should have animations for `walking`, `running`, `shooting`, `ducking`, and performing `melee attacks`.
- Blood particles should appear when the player is hit.
- A health bar should decrease whenever the player takes damage.
- Upon death, the player should have the option to quit the game, return to the main menu, or start over.
- The player's mission is flexible and can be any of the following: completing a task, eliminating all enemies without being detected, or collecting documents. Regardless of the mission, the player will encounter enemies that attempt to hinder their progress.
- When the player successfully completes their mission, a pop-up should appear stating that the mission is complete.
- You should have at least 3 types of enemies: `Guards` (who patrol around and are lookig for intruders), `Drones` (same as Guards but which can fly), and `Cameras` (stationary and looking for intruders). More enemies can be added if you want to.
#### Gun mechanics:
- Guards AI:
- Guards should be able to patrol around the map;
- A Guard is able to see the player, if the player crosses his field of view;
- When the player enters the field of view of a Guard, the Guard enters into chasing mode and must start running after the player, takes cover and shoots at the player.
- If the player leaves the field of view for a certain time, the Guard goes back to patrol mode.
- Drones AI:
- Drones should be able to patrol around the map;
- A light color should determine the state of the drone (Blue for patrolling, Red for chasing the player);
- Once the player crosses the drone camera, the drone light turns red and the drone enters chasing mode;
- When a drone is in chasing mode, all the guards on the area are alerted, and should enter chasing mode as well;
- When the player is out of the drone sight, the drone turns back to patrol mode;
- The sight radius should be inferior on the drones that on the guards.
- Camera AI:
- Cameras should be placed on walls;
- Cameras should have the same light sign as the drone, so when the player is in the camera sight, the camera light turns red and all Guards enter in chasing mode;
- Like the Drones, Cameras warn guards, whenever the player passes through the camera field of view;
- Some Cameras should lock access of certain areas of the map (for example, close doors) when the player is detected by that camera.
- The player should be able to shoot.
- A widget should display the current number of bullets available to the player.
- When the bullet count reaches 0, the player should be unable to shoot.
- Shooting should trigger both a sound effect and a visual effect.
- Bullets should have a visual impact on walls.
- Drones, Guards and Cameras should have sounds effect whenever they change from chase to patrol mode, as well as the other way around.
#### Enemy:
- All AI should be implemented using Behavior Trees except for the Camera.
- The game should feature at least two types of enemies: `Melee` and `Ranged`.
- Behavior trees should be used to implement enemy AI.
- Enemies should be able to patrol pre-defined paths around the map.
- Enemies should detect the player if the player enters their field of view.
- When the player enters the field of view of an enemy, the enemy enters into chasing mode and must start running after the player.
- `Ranged` enemies should take cover and shoot at the player.
- `melee` enemies should run close to the player and perform melee attacks.
- Enemies in chase mode alert nearby enemies making them enter chase mode as well.
- If the player leaves the field of view of all enemies for a specified duration, the enemies go back to patrol mode.
- Enemies should have sound effects whenever they change from chase to patrol mode,and vice versa.
- Enemies should have a visual indicator showing whether they are in patrol or chase mode
- The player mission is up to you, either it can be some task to fix, kill all guards without getting caught or collect documents... Whatever you choose, the player should have enemies on his way to divert him away from his objective.
#### Game loop
- When the player successfully completes his mission, a pop up should appear saying that the mission is completed.
- Pressing `Esc` pauses the game, bringing up a widget similar to the main menu.
- The player should be able to change the game graphics settings the same way as in the main menu.
- The game should last no longer than 6 minutes. After this time, the player is presented with the same choices as when they die: quit the game, return to the main menu, or start over.
- The player has a health bar that should go down whenever the player gets shot. When the player dies, he has the choice to either quit the game, go back to the main menu or start over.
### Bonus
- If the player starts over, the level should not be reloaded. The player should spawn back to the starting point.
- Use your own assets to create a game in your own style by either searching online or creating them on your own.
- When pressing `Esc` the game is set on paused and the main menu widget pops up.
- Have more enemy types e.g. a turret that is stationary but inflicts significant damage, etc.
- The player should be able to change the game graphics setting exactly like in the main menu.
- Have areas in the game that are locked behind doors that require keys. which you can obtain from specific enemies.
- A game should not last longer than 6 minutes. After that the same choices should appear as when the player dies.
- Have multiple different weapon types that you can pick up around the map and use to finish the mission.
### Resources
Here are some resources to help you tackle potential project challenges:
- [behavior-tree-in-unreal-engine](https://dev.epicgames.com/documentation/en-us/unreal-engine/behavior-tree-in-unreal-engine---quick-start-guide)
- [decal materials and decal actors](https://dev.epicgames.com/documentation/en-us/unreal-engine/decal-materials-in-unreal-engine?application_version=5.4)
- for inspiration look at games like metal gear solid 1/2/3.
- The basics assets you will need for this project can be found in the [StealthBoomAssets.zip](https://assets.01-edu.org/gamedev/stealth-boom-assets.zip) file. It contains the basic animations, character, enemies and props you will need for this project.
> NOTE: The assets in the file are intended to help streamline the process of locating assets, not to eliminate it.
> TIP: Use [itch.io](https://www.itch.io) to get sound effects (not included in the assets file) or to find extra assets
### Submission
> Do not forget to zip up the project compile and save everything for peer correction.
> If it is not possible to upload files to Gitea due to their size, use GitHub instead and have a look at [Git LSF](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github)

View File

@ -1,69 +1,89 @@
> Due to file size reason, the solution might be uploaded on GitHub instead of Gitea!
#### Functional
#### Main Menu
###### Does the map contain places for the player to hide from enemies?
###### Is the main menu displayed on the screen with all five options visible?
###### Does the map contain buildings, pickable ammunition and weapons placed around the map?
###### Can the general game sound be adjusted directly from the settings menu?
###### Does the player have all the minimal animation required (walking, running, melee attacking, aiming, reloading, shooting, crouching, crouch walking, crouch aiming, crouch reloading, crouch shooting)?
###### When changing the resolution, does a confirmation pop-up appear in the center of the screen asking if the player wants to keep the new graphics settings?
###### Is there a sound for the player shooting?
###### Are there bullets impacts present when shooting at a wall?
###### When the player is hit, are there any blood particles?
###### Is a main menu with the five options displayed on the screen?
###### Can the general sound of the game be managed directly on the settings menu?
###### When changing the resolution, does a pop-up get displayed on the screen to confirm the changes we just set?
###### Does pressing “No” on the graphics confirmation pop-up, resets the settings to the old ones?
###### If the player presses 'No' on the graphics confirmation pop-up, or if the pop-up is not confirmed within 10 seconds, do the settings revert to the previous ones?
###### Are the mouse settings (mouse sensitivity, invert mouse vertical axis) functioning according to their descriptions?
###### Do the guards and drones wander around the map?
#### Map / Level
###### When a player enters the field of view of a guard, does he switches to chasing mode, running and shooting towards the player while also taking cover?
###### Does the map contain props/walls for the player to hide from enemies?
###### Does the drone light switches between each state? Blue for patrolling and red for chase mode (when a player crosses its sight)?
###### Does the map contain pickable ammunition and health placed around?
###### Whenever a drone turns to chasing mode, do all the guards in the area get alerted and switch to chasing mode as well?
#### Player Mechanics
###### Does the drone come back to patrol mode when the player is out of the drone sight?
###### Is the sight radius of the drones smaller than the guards?
###### Are cameras attached to walls?
###### Do cameras have similar light sign as the drones (red for alert mode and blue for patrol)?
###### As the drones, do the cameras alert guards on the area, switching them to chasing mode?
###### Do Guards, Drones and Cameras play an alert sound when a player gets detected?
###### Do some cameras lock access to certain areas of the map, when they detect a player?
###### Can the camera close some part of the map (thru closed doors, open traps and tries to kill the player etc…) to the player when the player is being detected?
###### Are Behavior Trees used to implement the AI of the Guards and Drones?
###### Does the player have a goal?
###### When the goal of the player is successfully completed, does a pop up appear saying that the mission is completed?
###### Does the player have all the minimal animation required (walking, running, melee attacking, shooting, ducking)?
###### Does the player have a health bar?
###### Does the player health decreases when he gets shot by the guards?
###### Does the player health decreases when he gets damaged?
###### When the player is hit, are there any blood particles?
###### When the player loses all his health (dies), does he get to choose whether to quit the game, go back to the main menu, or to start over?
###### If the player starts over does he spawn back at the starting point?
###### Does the player have a defined goal or mission?
###### Is the lifespan of the game at least 6 minutes long from launch to mission completed?
###### Whatever the goal or mission, can you confirm that the player had enemies on his way to divert him away from his objective?
###### When the player successfully completes the goal or mission, does a pop-up appear indicating `mission completion`?
#### Gun Mechanics
###### Is the player able to shoot?
###### Is there a sound for the guns shooting?
###### Is a widget showing the remaining bullet count displayed?
###### Is the player unable to shoot when he has no bullets?
###### Are there bullets impacts present when shooting at a wall?
#### Enemies
###### Does the game include at least two types of enemies: `Melee` and `Ranged`?
###### Is enemy AI implemented using Behavior Trees?
###### Do the enemies wander around the map?
###### When a player enters an enemy's field of view, does the enemy switch to a chasing mode?
###### Do melee enemies approach the player to perform melee attacks?
###### Do ranged enemies take cover and shoot at the player?
###### Do the enemies go back to patrol mode when the player is hidden from all field of views for a set amount of time?
###### Do the enemies have a sound effect and visual effect when entering and exiting chase mode?
###### Are enemies in chase mode alerting nearby enemies ?
#### Game loop
###### When 'Esc' is pressed does the game pause and a widget similar to the main menu is displayed?
###### Can the player perform all the actions that appear in the menu when the game is paused?
###### Does the game loop last no more than 6 minutes from start to finish?
###### Is a widget that shows the player's remaining time displayed?
#### Bonus
###### +Are there headshots implemented?
###### +Did the student use different assets than the ones provided in the subject?
###### +Are there more enemy types than the basic melee and ranged enemies?
###### +Are there areas in the game that require an item to access?
###### +Are there different weapon types that you can pick up and use?

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

View File

@ -1,7 +1,7 @@
blinker==1.6.2
click==8.1.6
Flask==2.3.2
Flask-Cors==4.0.1
Flask-Cors==5.0.0
itsdangerous==2.1.2
Jinja2==3.1.4
MarkupSafe==2.1.3