Compare commits

...

3 Commits

Author SHA1 Message Date
Toussaint Louis 32b7ed4f7d
Tests(DPxAI): Rename test file for Quest00 Ex05 2024-07-23 15:04:40 +02:00
oumaimafisaoui 80acabc997 Docs(DPxAI): Fixed subject for Quest00/Ex05 2024-07-23 09:50:14 +01:00
Louis TOUSSAINT ea0b189129 Tests(DPxAI): Add test for Quest00 Ex05 2024-07-23 08:23:06 +02:00
2 changed files with 19 additions and 3 deletions

View File

@ -0,0 +1,18 @@
[
{
"description": "Log a number in the console",
"code": "// If you see this code, it means that you failed the first tests.\n// each tests have it's own code to be tested that will appear if\n// your solution doesn't pass it, it is not here to help you.\n// While sometimes it may clarify the instructions\n// this specific test is complex and will most likely confuse you.\n\n// This is to save all the values that you console.log'd\nconst args = saveArguments(console, 'log')\n\n// This comment below will be replaced by your code\n// Your code\n\n// This is where we check that the value are expected.\n// It's pretty advanced code, you don't have to understand it\n// Do not try to use it for the solution, it will not help you.\nconst typeOfLoggedValues = args.flat().map((v) => typeof v)\nif (!typeOfLoggedValues.includes('number')) {\n // this is where we create the error message you see:\n throw Error('you must log a number')\n // that's what you should focus on trying to understand\n // the message, not `throw` or `Error` don't worry about\n // that, worry about showing a number in the console !\n}"
},
{
"description": "Log a boolean in the console",
"code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nconst typeOfLoggedValues = args.flat().map((v) => typeof v)\nif (!typeOfLoggedValues.includes('boolean')) {\n throw Error('you must log a boolean')\n}"
},
{
"description": "Log a string in the console",
"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}"
}
]

View File

@ -6,9 +6,7 @@
Bravo! You've successfully brought the shape of your robot friend into existence. Now, it's time to take the next exciting step and start building the power to bring your robot to life. Yes, it's time to start thinking like a coder, builder! Using JavaScript, you'll be able to add dynamic abilities and interactions to your creation. Get ready to breathe life into your robot friend!
> The platform includes a code editor, giving you an interface to write, test, and submit your exercises.
Ready to start collecting your power through learning to code? Let's start, time is against us!
Ready to start collecting your power through learning to code? Let's go, time is against us!
### Concepts