Skip to content

Commit

Permalink
Merge pull request #29 from nazimboudeffa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nazimboudeffa authored Nov 11, 2023
2 parents aac6f66 + 17478df commit 568c5e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/problems/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export const problems: Problem[] = [
{
id: "0",
slug: "sum",
title: "Sum",
title: "Simple sum",
difficulty: "Easy",
category: "Integer",
order: 1,
videoId: "",
videoId: "KxcwwWNx5aA",
},
{
id: "1",
Expand Down
14 changes: 10 additions & 4 deletions src/problems/list/fizzbuzz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ const starterCodeFizzBuzz = `function fizzbuzz(n){
const handlerFizzBuzz = (fn: any) => {
// fn is the callback that user's code is passed into
try {
const n = 3;
const answer = [1, 2,'Fizz'];
const result = fn(n);
assert.deepStrictEqual(result, answer);
const nums = [3,5,15];
const answers = [
[1, 2,'Fizz'],
[1, 2,'Fizz',4,'Buzz'],
[1, 2,'Fizz',4,'Buzz','Fizz',7,8,'Fizz','Buzz',11,'Fizz',13,14,'FizzBuzz']
];
for (let i = 0; i < nums.length; i++) {
const result = fn(nums[i]);
assert.deepStrictEqual(result, answers[i]);
}
return true;
} catch (error: any) {
console.log("Fizz Buzz handler function error");
Expand Down
4 changes: 3 additions & 1 deletion src/problems/list/sum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ export const sum: ProblemElement = {
slug: "sum",
title: "0. A Simple Sum",
problemStatement: `<p class='mt-3'>
Welcome to Code 101!
Welcome to Code 101! The place where to learn coding in a friendly and stressless environment.
</p>
<p class='mt-3'>
In this problem, you will be asked to write a function that adds two numbers together.
</p>
<p class='mt-3'>
After that just click the "Run" button to see how this works.
</p>`,
examples: [
Expand Down

1 comment on commit 568c5e3

@vercel
Copy link

@vercel vercel bot commented on 568c5e3 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.