From 022f96d40dadcd9520e25737c37d60f27402770d Mon Sep 17 00:00:00 2001 From: Alex Chaffee Date: Fri, 23 Mar 2018 17:59:34 -0400 Subject: [PATCH] feat(seed): reformat seed/challenges JSON via repack script --- .../applied-visual-design.json | 2 +- .../basic-html-and-html5.json | 56 +- .../01-responsive-web-design/css-flexbox.json | 2 +- .../01-responsive-web-design/css-grid.json | 1832 ++++++++--------- .../responsive-web-design.json | 3 +- .../basic-algorithm-scripting.json | 2 +- .../basic-javascript.json | 45 +- .../debugging.json | 2 +- .../es6.json | 1 - .../functional-programming.json | 57 +- .../intermediate-algorithm-scripting.json | 4 +- ...gorithms-and-data-structures-projects.json | 6 +- .../object-oriented-programming.json | 9 +- .../regular-expressions.json | 2 +- .../03-front-end-libraries/bootstrap.json | 6 +- .../front-end-libraries-projects.json | 2 +- .../03-front-end-libraries/jquery.json | 2 - .../react-and-redux.json | 2 +- .../03-front-end-libraries/react.json | 192 +- .../03-front-end-libraries/redux.json | 2 +- .../03-front-end-libraries/sass.json | 2 +- .../data-visualization-projects.json | 2 +- .../data-visualization-with-d3.json | 2 +- .../json-apis-and-ajax.json | 2 +- .../api-and-microservice-projects.json | 2 +- .../basic-node-and-express.json | 2 +- .../managing-packages-with-npm.json | 2 +- .../mongodb-and-mongoose.json | 2 +- .../advanced-express-tools.json | 2 +- .../information-security-with-helmetjs.json | 2 +- ...nce-and-information-security-projects.json | 2 +- ...ality-assurance-and-testing-with-chai.json | 2 +- .../coding-interview-algorithm-questions.json | 2 +- ...ng-interview-data-structure-questions.json | 6 +- .../project-euler-problems.json | 542 ++--- .../rosetta-code-problems.json | 1186 +++++++---- .../system-design-and-concept-questions.json | 536 +++-- .../take-home-interview-projects.json | 34 +- 38 files changed, 2459 insertions(+), 2100 deletions(-) diff --git a/seed/challenges/01-responsive-web-design/applied-visual-design.json b/seed/challenges/01-responsive-web-design/applied-visual-design.json index cf3b22e087..57df85fec7 100644 --- a/seed/challenges/01-responsive-web-design/applied-visual-design.json +++ b/seed/challenges/01-responsive-web-design/applied-visual-design.json @@ -2752,4 +2752,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/01-responsive-web-design/basic-html-and-html5.json b/seed/challenges/01-responsive-web-design/basic-html-and-html5.json index 208981ef2f..80cfef4020 100644 --- a/seed/challenges/01-responsive-web-design/basic-html-and-html5.json +++ b/seed/challenges/01-responsive-web-design/basic-html-and-html5.json @@ -37,13 +37,13 @@ "
", "To pass the test on this challenge, change your h1 element's text to say \"Hello World\"." ], - "challengeSeed": ["

Hello

"], + "challengeSeed": [ + "

Hello

" + ], "tests": [ { - "text": - "Your h1 element should have the text \"Hello World\".", - "testString": - "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\".');" + "text": "Your h1 element should have the text \"Hello World\".", + "testString": "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\".');" } ], "type": "waypoint", @@ -130,7 +130,9 @@ "
", "Add an h2 tag that says \"CatPhotoApp\" to create a second HTML element below your \"Hello World\" h1 element." ], - "challengeSeed": ["

Hello World

"], + "challengeSeed": [ + "

Hello World

" + ], "tests": [ "assert(($(\"h2\").length > 0), 'message: Create an h2 element.');", "assert(code.match(/<\\/h2>/g) && code.match(/<\\/h2>/g).length === code.match(/

/g).length, 'message: Make sure your h2 element has a closing tag.');", @@ -195,7 +197,10 @@ "
", "Create a p element below your h2 element, and give it the text \"Hello Paragraph\"." ], - "challengeSeed": ["

Hello World

", "

CatPhotoApp

"], + "challengeSeed": [ + "

Hello World

", + "

CatPhotoApp

" + ], "tests": [ "assert(($(\"p\").length > 0), 'message: Create a p element.');", "assert.isTrue((/hello(\\s)+paragraph/gi).test($(\"p\").text()), 'message: Your p element should have the text \"Hello Paragraph\".');", @@ -639,8 +644,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-images-to-your-website" + "guideUrl": "https://guide.freecodecamp.org/certificates/add-images-to-your-website" }, { "id": "bad87fee1348bd9aedf08816", @@ -766,8 +770,7 @@ "challengeType": 0, "translations": { "pt-br": { - "title": - "Crie links para seções internas de uma página com elementos âncora", + "title": "Crie links para seções internas de uma página com elementos âncora", "description": [ "Além de criar links externos, elementos âncora também podem ser usados para criar links internos, que são links que pulam para diferentes seções dentro de uma mesma página.", "O formato é parecido com um link externo, só que, ao invés de uma URL no atributo href, você usa o símbolo # e uma palavra para descrever a seção para a qual você quer pular.", @@ -941,12 +944,12 @@ ] ] } - } - }, - { - "id": "58d9cc820ce2197370032a13", - "title": "Become a Supporter", - "description": [ + } + }, + { + "id": "58d9cc820ce2197370032a13", + "title": "Become a Supporter", + "description": [ [ "", "", @@ -1449,8 +1452,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-placeholder-text-to-a-text-field" + "guideUrl": "https://guide.freecodecamp.org/certificates/add-placeholder-text-to-a-text-field" }, { "id": "bad87fee1348bd9aede08830", @@ -1618,8 +1620,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-a-submit-button-to-a-form" + "guideUrl": "https://guide.freecodecamp.org/certificates/add-a-submit-button-to-a-form" }, { "id": "bad87fee1348bd9aedc08830", @@ -1696,8 +1697,7 @@ ] }, "ru": { - "title": - "Используйте HTML5, чтобы сделать заполнение поля обязательным", + "title": "Используйте HTML5, чтобы сделать заполнение поля обязательным", "description": [ "Вы можете требовать заполнения определённых полей формы, таким образом пользователь не сможет отправить данные формы до их заполнения.", "Например, если бы вы хотели сделать заполнение текстового поля обязательным, вы могли бы добавить слово required внутрь вашего элемента input: <input type=\"text\" required>", @@ -1976,8 +1976,7 @@ ] }, "es": { - "title": - "Marca botones de radio y casillas de verificación por omisión", + "title": "Marca botones de radio y casillas de verificación por omisión", "description": [ "Puedes marcar por omisión una casilla de verificación o un botón de radio usando el atributo checked.", "Para ello, sólo tienes que añadir la palabra \"checked\" en el interior de un elemento input. Por ejemplo:", @@ -1987,8 +1986,7 @@ ] }, "pt-br": { - "title": - "Faça botões de opção e caixas de seleção estarem marcados por padrão", + "title": "Faça botões de opção e caixas de seleção estarem marcados por padrão", "description": [ "Você pode fazer uma caixa de seleção ou botão de opção estar marcado por padrão usando o atributo checked.", "Para fazer isso, apenas insira a palavra \"checked\" em um elemento input. Por exemplo:", @@ -2120,7 +2118,7 @@ "
", "Add a DOCTYPE tag for HTML5 to the top of the blank HTML document in the code editor. Under it, add opening and closing html tags, which wrap around an h1 element. The heading can include any text." ], - "challengeSeed": ["", "", ""], + "challengeSeed": [], "tests": [ "assert(code.match(//gi), 'message: Your code should include a <!DOCTYPE html> tag.');", "assert($('html').length == 1, 'message: There should be one html element.');", @@ -2191,4 +2189,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/01-responsive-web-design/css-flexbox.json b/seed/challenges/01-responsive-web-design/css-flexbox.json index 6b3bc64938..0b214a2090 100644 --- a/seed/challenges/01-responsive-web-design/css-flexbox.json +++ b/seed/challenges/01-responsive-web-design/css-flexbox.json @@ -1161,4 +1161,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/01-responsive-web-design/css-grid.json b/seed/challenges/01-responsive-web-design/css-grid.json index e95cbd970d..3e30844fad 100644 --- a/seed/challenges/01-responsive-web-design/css-grid.json +++ b/seed/challenges/01-responsive-web-design/css-grid.json @@ -8,12 +8,12 @@ "id": "5a858937d96184f06fd60d60", "title": "Introduction to the CSS Grid Challenges", "description": [ - [ - "", - "", - "CSS Grid helps you easily build complex web designs. It works by turning an HTML element into a grid container with rows and columns for you to place children elements where you want within the grid.", - "" - ] + [ + "", + "", + "CSS Grid helps you easily build complex web designs. It works by turning an HTML element into a grid container with rows and columns for you to place children elements where you want within the grid.", + "" + ] ], "releasedOn": "Feb 15, 2018", "challengeSeed": [], @@ -27,40 +27,40 @@ "id": "5a858944d96184f06fd60d61", "title": "Create Your First CSS Grid", "description": [ - "Turn any HTML element into a grid container by setting its display property to grid. This gives you the ability to use all the other properties associated with CSS Grid.", - "Note
In CSS Grid, the parent element is referred to as the container and its children are called items.", - "
", - "Change the display of the div with the container class to grid." + "Turn any HTML element into a grid container by setting its display property to grid. This gives you the ability to use all the other properties associated with CSS Grid.", + "Note
In CSS Grid, the parent element is referred to as the container and its children are called items.", + "
", + "Change the display of the div with the container class to grid." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*display\\s*?:\\s*?grid\\s*?;[\\s\\S]*}/gi), 'message: container class should have a display property with a value of grid.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*display\\s*?:\\s*?grid\\s*?;[\\s\\S]*}/gi), 'message: container class should have a display property with a value of grid.');" ], "solutions": [], "hints": [], @@ -73,43 +73,43 @@ "id": "5a9036d038fddaf9a66b5d32", "title": "Add Columns with grid-template-columns", "description": [ - "Simply creating a grid element doesn't get you very far. You need to define the structure of the grid as well. To add some columns to the grid, use the grid-template-columns property on a grid container as demonstrated below:", - "
.container {
display: grid;
grid-template-columns: 50px 50px;
}
", - "This will give your grid two columns that are 50px wide each.", - "The number of parameters given to the grid-template-columns property indicates the number of columns in the grid, and the value of each parameter indicates the width of each column.", - "
", - "Give the grid container three columns that are 100px wide each." + "Simply creating a grid element doesn't get you very far. You need to define the structure of the grid as well. To add some columns to the grid, use the grid-template-columns property on a grid container as demonstrated below:", + "
.container {
display: grid;
grid-template-columns: 50px 50px;
}
", + "This will give your grid two columns that are 50px wide each.", + "The number of parameters given to the grid-template-columns property indicates the number of columns in the grid, and the value of each parameter indicates the width of each column.", + "
", + "Give the grid container three columns that are 100px wide each." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?100px\\s*?100px\\s*?100px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property with three units of 100px.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?100px\\s*?100px\\s*?100px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property with three units of 100px.');" ], "solutions": [], "hints": [], @@ -122,41 +122,41 @@ "id": "5a9036e138fddaf9a66b5d33", "title": "Add Rows with grid-template-rows", "description": [ - "The grid you created in the last challenge will set the number of rows automatically. To adjust the rows manually, use the grid-template-rows property in the same way you used grid-template-columns in previous challenge.", - "
", - "Add two rows to the grid that are 50px tall each." + "The grid you created in the last challenge will set the number of rows automatically. To adjust the rows manually, use the grid-template-rows property in the same way you used grid-template-columns in previous challenge.", + "
", + "Add two rows to the grid that are 50px tall each." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-rows\\s*?:\\s*?50px\\s*?50px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-rows property with two units of 50px.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-rows\\s*?:\\s*?50px\\s*?50px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-rows property with two units of 50px.');" ], "solutions": [], "hints": [], @@ -169,48 +169,48 @@ "id": "5a9036ee38fddaf9a66b5d34", "title": "Use CSS Grid units to Change the Size of Columns and Rows", "description": [ - "You can use absolute and relative units like px and em in CSS Grid to define the size of rows and columns. You can use these as well:", - "fr: sets the column or row to a fraction of the available space,", - "auto: sets the column or row to the width or height of its content automatically,", - "%: adjusts the column or row to the percent width of its container.", - "Here's the code that generates the output in the preview:", - "
grid-template-columns: auto 50px 10% 2fr 1fr;
", - "This snippet creates five columns. The first column is as wide as its content, the second column is 50px, the third column is 10% of its container, and for the last two columns; the remaining space is divided into three sections, two are allocated for the fourth column, and one for the fifth.", - "
", - "Make a grid with three columns whose widths are as follows: 1fr, 100px, and 2fr." + "You can use absolute and relative units like px and em in CSS Grid to define the size of rows and columns. You can use these as well:", + "fr: sets the column or row to a fraction of the available space,", + "auto: sets the column or row to the width or height of its content automatically,", + "%: adjusts the column or row to the percent width of its container.", + "Here's the code that generates the output in the preview:", + "
grid-template-columns: auto 50px 10% 2fr 1fr;
", + "This snippet creates five columns. The first column is as wide as its content, the second column is 50px, the third column is 10% of its container, and for the last two columns; the remaining space is divided into three sections, two are allocated for the fourth column, and one for the fifth.", + "
", + "Make a grid with three columns whose widths are as follows: 1fr, 100px, and 2fr." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?1fr\\s*?100px\\s*?2fr\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that has three columns with the following widths: 1fr, 100px, and 2fr.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?1fr\\s*?100px\\s*?2fr\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that has three columns with the following widths: 1fr, 100px, and 2fr.');" ], "solutions": [], "hints": [], @@ -223,45 +223,45 @@ "id": "5a9036ee38fddaf9a66b5d35", "title": "Create a Column Gap Using grid-column-gap", "description": [ - "So far in the grids you have created, the columns have all been tight up against each other. Sometimes you want a gap in between the columns. To add a gap between the columns, use the grid-column-gap property like this:", - "
grid-column-gap: 10px;
", - "This creates 10px of empty space between all of our columns.", - "
", - "Give the columns in the grid a 20px gap." + "So far in the grids you have created, the columns have all been tight up against each other. Sometimes you want a gap in between the columns. To add a gap between the columns, use the grid-column-gap property like this:", + "
grid-column-gap: 10px;
", + "This creates 10px of empty space between all of our columns.", + "
", + "Give the columns in the grid a 20px gap." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-column-gap\\s*?:\\s*?20px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-column-gap property that has the value of 20px.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-column-gap\\s*?:\\s*?20px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-column-gap property that has the value of 20px.');" ], "solutions": [], "hints": [], @@ -274,43 +274,43 @@ "id": "5a9036ee38fddaf9a66b5d36", "title": "Create a Row Gap using grid-row-gap", "description": [ - "You can add a gap in between the rows of a grid using grid-row-gap in the same way that you added a gap in between columns in the previous challenge.", - "
", - "Create a gap for the rows that is 5px tall." + "You can add a gap in between the rows of a grid using grid-row-gap in the same way that you added a gap in between columns in the previous challenge.", + "
", + "Create a gap for the rows that is 5px tall." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-row-gap\\s*?:\\s*?5px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-row-gap property that has the value of 5px.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-row-gap\\s*?:\\s*?5px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-row-gap property that has the value of 5px.');" ], "solutions": [], "hints": [], @@ -323,42 +323,42 @@ "id": "5a9036ee38fddaf9a66b5d37", "title": "Add Gaps Faster with grid-gap", "description": [ - "grid-gap is a shorthand property for grid-row-gap and grid-column-gap from the previous two challenges that's more convenient to use. If grid-gap has one value, it will a create a gap between all rows and columns. However, if there are two values, it will use the first one to set the gap between the rows and the second value for the columns.", - "
", - "Use grid-gap to introduce a 10px gap between the rows and 20px gap between the columns." + "grid-gap is a shorthand property for grid-row-gap and grid-column-gap from the previous two challenges that's more convenient to use. If grid-gap has one value, it will a create a gap between all rows and columns. However, if there are two values, it will use the first one to set the gap between the rows and the second value for the columns.", + "
", + "Use grid-gap to introduce a 10px gap between the rows and 20px gap between the columns." ], "challengeSeed": [ - "", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-gap\\s*?:\\s*?10px\\s*?20px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-gap property that introduces 10px gap between the rows and 20px gap between the columns.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-gap\\s*?:\\s*?10px\\s*?20px\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-gap property that introduces 10px gap between the rows and 20px gap between the columns.');" ], "solutions": [], "hints": [], @@ -371,54 +371,54 @@ "id": "5a90372638fddaf9a66b5d38", "title": "Use grid-column to Control Spacing", "description": [ - "Up to this point, all the properties that have been discussed are for grid containers. The grid-column property is the first one for use on the grid items themselves.", - "The hypothetical horizontal and vertical lines that create the grid are referred to as lines. These lines are numbered starting with 1 at the top left corner of the grid and move right for columns and down for rows, counting upward.", - "This is what the lines look like for a 3x3 grid:", - "

column lines

1

2

3

4

row lines

1

2

3

4

", - "To control the amount of columns an item will consume, you can use the grid-column property in conjunction with the line numbers you want the item to start and stop at.", - "Here's an example:", - "
grid-column: 1 / 3;
", - "This will make the item start at the first vertical line of the grid on the left and span to the 3rd line of the grid, consuming two columns.", - "
", - "Make the item with the class item5 consume the last two columns of the grid." + "Up to this point, all the properties that have been discussed are for grid containers. The grid-column property is the first one for use on the grid items themselves.", + "The hypothetical horizontal and vertical lines that create the grid are referred to as lines. These lines are numbered starting with 1 at the top left corner of the grid and move right for columns and down for rows, counting upward.", + "This is what the lines look like for a 3x3 grid:", + "

column lines

1

2

3

4

row lines

1

2

3

4

", + "To control the amount of columns an item will consume, you can use the grid-column property in conjunction with the line numbers you want the item to start and stop at.", + "Here's an example:", + "
grid-column: 1 / 3;
", + "This will make the item start at the first vertical line of the grid on the left and span to the 3rd line of the grid, consuming two columns.", + "
", + "Make the item with the class item5 consume the last two columns of the grid." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-column\\s*?:\\s*?2\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-column property that has the value of 2 / 4.');" + "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-column\\s*?:\\s*?2\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-column property that has the value of 2 / 4.');" ], "solutions": [], "hints": [], @@ -431,48 +431,48 @@ "id": "5a90373638fddaf9a66b5d39", "title": "Use grid-row to Control Spacing", "description": [ - "Of course, you can make items consume multiple rows just like you can with columns. You define the horizontal lines you want an item to start and stop at using the grid-row property on a grid item.", - "
", - "Make the element with the item5 class consume the last two rows." + "Of course, you can make items consume multiple rows just like you can with columns. You define the horizontal lines you want an item to start and stop at using the grid-row property on a grid item.", + "
", + "Make the element with the item5 class consume the last two rows." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-row\\s*?:\\s*?2\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-row property that has the value of 2 / 4.');" + "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-row\\s*?:\\s*?2\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-row property that has the value of 2 / 4.');" ], "solutions": [], "hints": [], @@ -485,51 +485,51 @@ "id": "5a90374338fddaf9a66b5d3a", "title": "Align an Item Horizontally using justify-self", "description": [ - "In CSS Grid, the content of each item is located in a box which is referred to as a cell. You can align the content's position within its cell horizontally using the justify-self property on a grid item. By default, this property has a value of stretch, which will make the content fill the whole width of the cell. This CSS Grid property accepts other values as well:", - "start: aligns the content at the left of the cell,", - "center: aligns the content in the center of the cell,", - "end: aligns the content at the right of the cell.", - "
", - "Use the justify-self property to center the item with the class item2." + "In CSS Grid, the content of each item is located in a box which is referred to as a cell. You can align the content's position within its cell horizontally using the justify-self property on a grid item. By default, this property has a value of stretch, which will make the content fill the whole width of the cell. This CSS Grid property accepts other values as well:", + "start: aligns the content at the left of the cell,", + "center: aligns the content in the center of the cell,", + "end: aligns the content at the right of the cell.", + "
", + "Use the justify-self property to center the item with the class item2." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item2\\s*?{[\\s\\S]*justify-self\\s*?:\\s*?center\\s*?;[\\s\\S]*}/gi), 'message: item2 class should have a justify-self property that has the value of center.');" + "assert(code.match(/.item2\\s*?{[\\s\\S]*justify-self\\s*?:\\s*?center\\s*?;[\\s\\S]*}/gi), 'message: item2 class should have a justify-self property that has the value of center.');" ], "solutions": [], "hints": [], @@ -542,48 +542,48 @@ "id": "5a90375238fddaf9a66b5d3b", "title": "Align an Item Vertically using align-self", "description": [ - "Just as you can align an item horizontally, there's a way to align an item vertically as well. To do this, you use the align-self property on an item. This property accepts all of the same values as justify-self from the last challenge.", - "
", - "Align the item with the class item3 vertically at the end." + "Just as you can align an item horizontally, there's a way to align an item vertically as well. To do this, you use the align-self property on an item. This property accepts all of the same values as justify-self from the last challenge.", + "
", + "Align the item with the class item3 vertically at the end." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item3\\s*?{[\\s\\S]*align-self\\s*?:\\s*?end\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a align-self property that has the value of end.');" + "assert(code.match(/.item3\\s*?{[\\s\\S]*align-self\\s*?:\\s*?end\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a align-self property that has the value of end.');" ], "solutions": [], "hints": [], @@ -596,44 +596,44 @@ "id": "5a90376038fddaf9a66b5d3c", "title": "Align All Items Horizontally using justify-items", "description": [ - "Sometimes you want all the items in your CSS Grid to share the same alignment. You can use the previously learned properties and align them individually, or you can align them all at once horizontally by using justify-items on your grid container. This property can accept all the same values you learned about in the previous two challenges, the difference being that it will move all the items in our grid to the desired alignment.", - "
", - "Use this property to center all our items horizontally." + "Sometimes you want all the items in your CSS Grid to share the same alignment. You can use the previously learned properties and align them individually, or you can align them all at once horizontally by using justify-items on your grid container. This property can accept all the same values you learned about in the previous two challenges, the difference being that it will move all the items in our grid to the desired alignment.", + "
", + "Use this property to center all our items horizontally." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*justify-items\\s*?:\\s*?center\\s*?;[\\s\\S]*}/gi), 'message: container class should have a justify-items property that has the value of center.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*justify-items\\s*?:\\s*?center\\s*?;[\\s\\S]*}/gi), 'message: container class should have a justify-items property that has the value of center.');" ], "solutions": [], "hints": [], @@ -646,44 +646,44 @@ "id": "5a94fdf869fb03452672e45b", "title": "Align All Items Vertically using align-items", "description": [ - "Using the align-items property on a grid container will set the vertical alignment for all the items in our grid.", - "
", - "Use it now to move all the items to the end of each cell." + "Using the align-items property on a grid container will set the vertical alignment for all the items in our grid.", + "
", + "Use it now to move all the items to the end of each cell." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*align-items\\s*?:\\s*?end\\s*?;[\\s\\S]*}/gi), 'message: container class should have a align-items property that has the value of end.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*align-items\\s*?:\\s*?end\\s*?;[\\s\\S]*}/gi), 'message: container class should have a align-items property that has the value of end.');" ], "solutions": [], "hints": [], @@ -696,51 +696,51 @@ "id": "5a94fe0569fb03452672e45c", "title": "Divide the Grid Into an Area Template", "description": [ - "You can group cells of your grid together into an area and give the area a custom name. Do this by using grid-template-areas on the container like this:", - "
grid-template-areas:
\"header header header\"
\"advert content content\"
\"footer footer footer\";
", - "The code above merges the top three cells together into an area named header, the bottom three cells into a footer area, and it makes two areas in the middle row; advert and content.", - "Note
Every word in the code represents a cell and every pair of quotation marks represent a row.", - "In addition to custom labels, you can use a period (.) to designate an empty cell in the grid.", - "
", - "Place the area template so that the cell labeled advert becomes an empty cell." + "You can group cells of your grid together into an area and give the area a custom name. Do this by using grid-template-areas on the container like this:", + "
grid-template-areas:
\"header header header\"
\"advert content content\"
\"footer footer footer\";
", + "The code above merges the top three cells together into an area named header, the bottom three cells into a footer area, and it makes two areas in the middle row; advert and content.", + "Note
Every word in the code represents a cell and every pair of quotation marks represent a row.", + "In addition to custom labels, you can use a period (.) to designate an empty cell in the grid.", + "
", + "Place the area template so that the cell labeled advert becomes an empty cell." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-areas\\s*?:\\s*?\"\\s*?header\\s*?header\\s*?header\\s*?\"\\s*?\"\\s*?.\\s*?content\\s*?content\\s*?\"\\s*?\"\\s*?footer\\s*?footer\\s*?footer\\s*?\"\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-areas propertiy similar to the preview but has . instead of the advert area.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-areas\\s*?:\\s*?\"\\s*?header\\s*?header\\s*?header\\s*?\"\\s*?\"\\s*?.\\s*?content\\s*?content\\s*?\"\\s*?\"\\s*?footer\\s*?footer\\s*?footer\\s*?\"\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-areas propertiy similar to the preview but has . instead of the advert area.');" ], "solutions": [], "hints": [], @@ -753,53 +753,53 @@ "id": "5a94fe1369fb03452672e45d", "title": "Place Items in Grid Areas Using the grid-area Property", "description": [ - "After creating an areas template for your grid container, as shown in the previous challenge, you can place an item in your custom area by referencing the name you gave it. To do this, you use the grid-area property on an item like this:", - "
.item1 { grid-area: header; }
", - "This lets the grid know that you want the item1 class to go in the area named header. In this case, the item will use the entire top row because that whole row is named as the header area.", - "
", - "Place an element with the item5 class in the footer area using the grid-area property." + "After creating an areas template for your grid container, as shown in the previous challenge, you can place an item in your custom area by referencing the name you gave it. To do this, you use the grid-area property on an item like this:", + "
.item1 { grid-area: header; }
", + "This lets the grid know that you want the item1 class to go in the area named header. In this case, the item will use the entire top row because that whole row is named as the header area.", + "
", + "Place an element with the item5 class in the footer area using the grid-area property." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-area\\s*?:\\s*?footer\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-area property that has the value of footer.');" + "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-area\\s*?:\\s*?footer\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-area property that has the value of footer.');" ], "solutions": [], "hints": [], @@ -812,51 +812,51 @@ "id": "5a94fe2669fb03452672e45e", "title": "Use grid-area Without Creating an Areas Template", "description": [ - "The grid-area property you learned in the last challenge can be used in another way. If your grid doesn't have an areas template to reference, you can create an area on the fly for an item to be placed like this:", - "
item1 { grid-area: 1/1/2/4; }
", - "This is using the line numbers you learned about earlier to define where the area for this item will be. The numbers in the example above represent these values:", - "
grid-area: horizontal line to start at / vertical line to start at / horizontal line to end at / vertical line to end at;
", - "So the item in the example will consume the rows between lines 1 and 2, and the columns between lines 1 and 4.", - "
", - "Using the grid-area property, place the element with item5 class between the third and fourth horizontal lines and between the first and fourth vertical lines." + "The grid-area property you learned in the last challenge can be used in another way. If your grid doesn't have an areas template to reference, you can create an area on the fly for an item to be placed like this:", + "
item1 { grid-area: 1/1/2/4; }
", + "This is using the line numbers you learned about earlier to define where the area for this item will be. The numbers in the example above represent these values:", + "
grid-area: horizontal line to start at / vertical line to start at / horizontal line to end at / vertical line to end at;
", + "So the item in the example will consume the rows between lines 1 and 2, and the columns between lines 1 and 4.", + "
", + "Using the grid-area property, place the element with item5 class between the third and fourth horizontal lines and between the first and fourth vertical lines." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-area\\s*?:\\s*?3\\s*?\\/\\s*?1\\s*?\\/\\s*?4\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-area property that has the value of 3/1/4/4.');" + "assert(code.match(/.item5\\s*?{[\\s\\S]*grid-area\\s*?:\\s*?3\\s*?\\/\\s*?1\\s*?\\/\\s*?4\\s*?\\/\\s*?4\\s*?;[\\s\\S]*}/gi), 'message: item5 class should have a grid-area property that has the value of 3/1/4/4.');" ], "solutions": [], "hints": [], @@ -869,52 +869,52 @@ "id": "5a94fe3669fb03452672e45f", "title": "Reduce Repetition Using the repeat Function", "description": [ - "When you used grid-template-columns and grid-template-rows to define the structure of a grid, you entered a value for each row or column you created.", - "Lets say you want a grid with 100 rows of the same height. It isn't very practical to insert 100 values individually. Fortunately, there's a better way - by using the repeat function to specify the number of times you want your column or row to be repeated, followed by a comma and the value you want to repeat.", - "Here's an example that would create the 100 row grid, each row at 50px tall.", - "
grid-template-rows: repeat(100, 50px);
", - "You can also repeat multiple values with the repeat function, and insert the function amongst other values when defining a grid structure. Here's what I mean:", - "
grid-template-columns: repeat(2, 1fr 50px) 20px;
", - "This translates to:", - "
grid-template-columns: 1fr 50px 1fr 50px 20px;
", - "Note
1fr 50px is repeated twice followed by 20px.", - "
", - "Use repeat to remove repetition from the grid-template-columns property." + "When you used grid-template-columns and grid-template-rows to define the structure of a grid, you entered a value for each row or column you created.", + "Lets say you want a grid with 100 rows of the same height. It isn't very practical to insert 100 values individually. Fortunately, there's a better way - by using the repeat function to specify the number of times you want your column or row to be repeated, followed by a comma and the value you want to repeat.", + "Here's an example that would create the 100 row grid, each row at 50px tall.", + "
grid-template-rows: repeat(100, 50px);
", + "You can also repeat multiple values with the repeat function, and insert the function amongst other values when defining a grid structure. Here's what I mean:", + "
grid-template-columns: repeat(2, 1fr 50px) 20px;
", + "This translates to:", + "
grid-template-columns: 1fr 50px 1fr 50px 20px;
", + "Note
1fr 50px is repeated twice followed by 20px.", + "
", + "Use repeat to remove repetition from the grid-template-columns property." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?3\\s*?,\\s*?1fr\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that is set to repeat 3 columns with the width of 1fr.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?3\\s*?,\\s*?1fr\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that is set to repeat 3 columns with the width of 1fr.');" ], "solutions": [], "hints": [], @@ -927,46 +927,46 @@ "id": "5a94fe4469fb03452672e460", "title": "Limit Item Size Using the minmax Function", "description": [ - "There's another built-in function to use with grid-template-columns and grid-template-rows called minmax. It's used to limit the size of items when the grid container changes size. To do this you need to specify the acceptable size range for your item. Here is an example:", - "
grid-template-columns: 100px minmax(50px, 200px);
", - "In the code above, grid-template-columns is set to create three columns; the first is 100px wide, and the second has the minimum width of 50px and the maximum width of 200px.", - "
", - "Using the minmax function, replace the 1fr in the repeat function with a column size that has the minimum width of 90px and the maximum width of 1fr, and resize the preview panel to see the effect." + "There's another built-in function to use with grid-template-columns and grid-template-rows called minmax. It's used to limit the size of items when the grid container changes size. To do this you need to specify the acceptable size range for your item. Here is an example:", + "
grid-template-columns: 100px minmax(50px, 200px);
", + "In the code above, grid-template-columns is set to create three columns; the first is 100px wide, and the second has the minimum width of 50px and the maximum width of 200px.", + "
", + "Using the minmax function, replace the 1fr in the repeat function with a column size that has the minimum width of 90px and the maximum width of 1fr, and resize the preview panel to see the effect." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?3\\s*?,\\s*?minmax\\s*?\\(\\s*?90px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that is set to repeat 3 columns with the minimum width of 90px and maximum width of 1fr.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?3\\s*?,\\s*?minmax\\s*?\\(\\s*?90px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property that is set to repeat 3 columns with the minimum width of 90px and maximum width of 1fr.');" ], "solutions": [], "hints": [], @@ -979,65 +979,65 @@ "id": "5a94fe5469fb03452672e461", "title": "Create Flexible Layouts Using auto-fill", "description": [ - "The repeat function comes with a option called auto-fill. This allows you to automatically insert as many rows or columns of your desired size as possible depending on the size of the container. You can create flexible layouts when combining auto-fill with minmax.", - "In the preview, grid-template-columns is set to", - "
repeat(auto-fill, minmax(60px, 1fr));
", - "When the container changes size, this setup keeps inserting 60px columns and stretching them until it can insert another one.", - "Note
If your container can't fit all your items on one row, it will move them down to a new one.", - "
", - "In the first grid, use auto-fill with repeat to fill the grid with columns that have a minimum width of 60px and maximum of 1fr. Then resize the preview to see auto-fill in action." + "The repeat function comes with a option called auto-fill. This allows you to automatically insert as many rows or columns of your desired size as possible depending on the size of the container. You can create flexible layouts when combining auto-fill with minmax.", + "In the preview, grid-template-columns is set to", + "
repeat(auto-fill, minmax(60px, 1fr));
", + "When the container changes size, this setup keeps inserting 60px columns and stretching them until it can insert another one.", + "Note
If your container can't fit all your items on one row, it will move them down to a new one.", + "
", + "In the first grid, use auto-fill with repeat to fill the grid with columns that have a minimum width of 60px and maximum of 1fr. Then resize the preview to see auto-fill in action." ], "challengeSeed": [ - "", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?auto-fill\\s*?,\\s*?minmax\\s*?\\(\\s*?60px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property with repeat and auto-fill that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?auto-fill\\s*?,\\s*?minmax\\s*?\\(\\s*?60px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container class should have a grid-template-columns property with repeat and auto-fill that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.');" ], "solutions": [], "hints": [], @@ -1050,63 +1050,63 @@ "id": "5a94fe6269fb03452672e462", "title": "Create Flexible Layouts Using auto-fit", "description": [ - "auto-fit works almost identical to auto-fill. The only difference is that when the container's size exceeds the size of all the items combined, auto-fill keeps inserting empty rows or columns and pushes your items to the side, while auto-fit collapses those empty rows or columns and stretches your items to fit the size of the container.", - "Note
If your container can't fit all your items on one row, it will move them down to a new one.", - "
", - "In the second grid, use auto-fit with repeat to fill the grid with columns that have a minimum width of 60px and maximum of 1fr. Then resize the preview to see the difference." + "auto-fit works almost identical to auto-fill. The only difference is that when the container's size exceeds the size of all the items combined, auto-fill keeps inserting empty rows or columns and pushes your items to the side, while auto-fit collapses those empty rows or columns and stretches your items to fit the size of the container.", + "Note
If your container can't fit all your items on one row, it will move them down to a new one.", + "
", + "In the second grid, use auto-fit with repeat to fill the grid with columns that have a minimum width of 60px and maximum of 1fr. Then resize the preview to see the difference." ], "challengeSeed": [ - "", - " ", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
", - "
", - "
1
", - "
2
", - "
3
", - "
4
", - "
5
", - "
" + "", + " ", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
", + "
", + "
1
", + "
2
", + "
3
", + "
4
", + "
5
", + "
" ], "tests": [ - "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?auto-fit\\s*?,\\s*?minmax\\s*?\\(\\s*?60px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container2 class should have a grid-template-columns property with repeat and auto-fit that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.');" + "assert(code.match(/.container\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?repeat\\s*?\\(\\s*?auto-fit\\s*?,\\s*?minmax\\s*?\\(\\s*?60px\\s*?,\\s*?1fr\\s*?\\)\\s*?\\)\\s*?;[\\s\\S]*}/gi), 'message: container2 class should have a grid-template-columns property with repeat and auto-fit that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.');" ], "solutions": [], "hints": [], @@ -1119,83 +1119,83 @@ "id": "5a94fe7769fb03452672e463", "title": "Use Media Queries to Create Responsive Layouts", "description": [ - "CSS Grid can be an easy way to make your site more responsive by using media queries to rearrange grid areas, change dimensions of a grid, and rearrange the placement of items.", - "In the preview, when the viewport width is 300px or more, the number of columns changes from 1 to 2. The advertisement area then occupies the left column completely.", - "
", - "When the viewport width is 400px or more, make the header area occupy the top row completely and the footer area occupy the bottom row completely." + "CSS Grid can be an easy way to make your site more responsive by using media queries to rearrange grid areas, change dimensions of a grid, and rearrange the placement of items.", + "In the preview, when the viewport width is 300px or more, the number of columns changes from 1 to 2. The advertisement area then occupies the left column completely.", + "
", + "When the viewport width is 400px or more, make the header area occupy the top row completely and the footer area occupy the bottom row completely." ], "challengeSeed": [ - "", - " ", - "
", - "
header
", - "
advert
", - "
content
", - "
footer
", - "
" + "", + " ", + "
", + "
header
", + "
advert
", + "
content
", + "
footer
", + "
" ], "tests": [ - "assert(code.match(/@media\\s*?\\(\\s*?min-width\\s*?:\\s*?400px\\s*?\\)[\\s\\S]*.container\\s*?{[\\s\\S]*grid-template-areas\\s*?:\\s*?\"\\s*?header\\s*?header\\s*?\"\\s*?\"\\s*?advert\\s*?content\\s*?\"\\s*?\"\\s*?footer\\s*?footer\\s*?\"\\s*?;[\\s\\S]*}/gi), 'message: When the viewport is 400px or more, container class should have a grid-template-columns property in which the footer and header areas occupy the top and bottom rows respectively and advert and content occupy the left and right columns of the middle row.');" + "assert(code.match(/@media\\s*?\\(\\s*?min-width\\s*?:\\s*?400px\\s*?\\)[\\s\\S]*.container\\s*?{[\\s\\S]*grid-template-areas\\s*?:\\s*?\"\\s*?header\\s*?header\\s*?\"\\s*?\"\\s*?advert\\s*?content\\s*?\"\\s*?\"\\s*?footer\\s*?footer\\s*?\"\\s*?;[\\s\\S]*}/gi), 'message: When the viewport is 400px or more, container class should have a grid-template-columns property in which the footer and header areas occupy the top and bottom rows respectively and advert and content occupy the left and right columns of the middle row.');" ], "solutions": [], "hints": [], @@ -1208,74 +1208,74 @@ "id": "5a94fe8569fb03452672e464", "title": "Create Grids within Grids", "description": [ - "Turning an element into a grid only affects the behavior of its direct descendants. So by turning a direct descendant into a grid, you have a grid within a grid.", - "For example, by setting the display and grid-template-columns properties of the element with the item3 class, you create a grid within your grid.", - "
", - "Turn the element with the item3 class into a grid with two columns with a width of auto and 1fr using display and grid-template-columns." + "Turning an element into a grid only affects the behavior of its direct descendants. So by turning a direct descendant into a grid, you have a grid within a grid.", + "For example, by setting the display and grid-template-columns properties of the element with the item3 class, you create a grid within your grid.", + "
", + "Turn the element with the item3 class into a grid with two columns with a width of auto and 1fr using display and grid-template-columns." ], "challengeSeed": [ - "", - " ", - "
", - "
header
", - "
advert
", - "
", - "
paragraph1
", - "
paragraph2
", - "
", - "
footer
", - "
" + "", + " ", + "
", + "
header
", + "
advert
", + "
", + "
paragraph1
", + "
paragraph2
", + "
", + "
footer
", + "
" ], "tests": [ - "assert(code.match(/.item3\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?auto\\s*?1fr\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a grid-template-columns property with auto and 1fr as values.');", - "assert(code.match(/.item3\\s*?{[\\s\\S]*display\\s*?:\\s*?grid\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a display property with the value of grid.');" + "assert(code.match(/.item3\\s*?{[\\s\\S]*grid-template-columns\\s*?:\\s*?auto\\s*?1fr\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a grid-template-columns property with auto and 1fr as values.');", + "assert(code.match(/.item3\\s*?{[\\s\\S]*display\\s*?:\\s*?grid\\s*?;[\\s\\S]*}/gi), 'message: item3 class should have a display property with the value of grid.');" ], "solutions": [], "hints": [], @@ -1285,4 +1285,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/01-responsive-web-design/responsive-web-design.json b/seed/challenges/01-responsive-web-design/responsive-web-design.json index c65fe7c629..0a53e2a675 100644 --- a/seed/challenges/01-responsive-web-design/responsive-web-design.json +++ b/seed/challenges/01-responsive-web-design/responsive-web-design.json @@ -68,7 +68,6 @@ "" ] ] - } } }, @@ -246,4 +245,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json index d281cdccfb..bbba20d78f 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json @@ -968,4 +968,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index 7f18186432..6f914a5d7d 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -36,9 +36,7 @@ "
", "Try creating one of each type of comment." ], - "challengeSeed": [ - "" - ], + "challengeSeed": [], "solutions": [ "// Fake Comment\n/* Another Comment */" ], @@ -1054,7 +1052,9 @@ " }", "})();" ], - "solutions": ["var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"], + "solutions": [ + "var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";" + ], "tests": [ "assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (") and four escaped double quotes (\").');", "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: I am a \"double quoted\" string inside \"double quotes\".');" @@ -1102,7 +1102,9 @@ "tail": [ "(function() { return \"myStr = \" + myStr; })();" ], - "solutions": ["var myStr = 'Link';"], + "solutions": [ + "var myStr = 'Link';" + ], "tests": [ "assert(!/\\\\/g.test(code) && myStr.match('\\\\s*\\\\s*Link\\\\s*\\\\s*'), 'message: Remove all the backslashes (\\)');", "assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes ' and four double quotes "');" @@ -1393,7 +1395,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/appending-variables-to-strings" + "guideUrl": "https://guide.freecodecamp.org/certificates/appending-variables-to-strings" }, { "id": "bd7123c9c448eddfaeb5bdef", @@ -2759,7 +2761,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/assignment-with-a-returned-value" + "guideUrl": "https://guide.freecodecamp.org/certificates/assignment-with-a-returned-value" }, { "id": "56533eb9ac21ba0edf2244c6", @@ -3931,7 +3933,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/adding-a-default-option-in-switch-statements" + "guideUrl": "https://guide.freecodecamp.org/certificates/adding-a-default-option-in-switch-statements" }, { "id": "56533eb9ac21ba0edf2244df", @@ -4086,9 +4088,7 @@ "// Change these values to test", "isLess(10, 15);" ], - "tail": [ - "" - ], + "tail": [], "solutions": [ "function isLess(a, b) {\n return a < b;\n}" ], @@ -4142,9 +4142,7 @@ "// Change values below to test your code", "abTest(2,2);" ], - "tail": [ - "" - ], + "tail": [], "solutions": [ "function abTest(a, b) {\n if(a < 0 || b < 0) {\n return undefined;\n } \n return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));\n}" ], @@ -4464,7 +4462,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/accessing-objects-properties-with-variables" + "guideUrl": "https://guide.freecodecamp.org/certificates/accessing-objects-properties-with-variables" }, { "id": "56bbb991ad1ed5201cd392d1", @@ -4756,9 +4754,7 @@ "// Test your code by modifying these values", "checkObj(\"gift\");" ], - "tail": [ - "" - ], + "tail": [], "solutions": [ "var myObj = {\n gift: \"pony\",\n pet: \"kitten\",\n bed: \"sleigh\"\n};\nfunction checkObj(checkProp) {\n if(myObj.hasOwnProperty(checkProp)) {\n return myObj[checkProp];\n } else {\n return \"Not Found\";\n }\n}" ], @@ -4906,7 +4902,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/accessing-nested-objects-in-json" + "guideUrl": "https://guide.freecodecamp.org/certificates/accessing-nested-objects-in-json" }, { "id": "56533eb9ac21ba0edf2244cd", @@ -4974,7 +4970,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/access-array-data-with-indexes" + "guideUrl": "https://guide.freecodecamp.org/certificates/access-array-data-with-indexes" }, { "id": "56533eb9ac21ba0edf2244cf", @@ -5379,9 +5375,7 @@ "multiplyAll([[1,2],[3,4],[5,6,7]]);", "" ], - "tail": [ - "" - ], + "tail": [], "solutions": [ "function multiplyAll(arr) {\n var product = 1;\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n product *= arr[i][j];\n }\n }\n return product;\n}\n\nmultiplyAll([[1,2],[3,4],[5,6,7]]);" ], @@ -5450,8 +5444,7 @@ ], "type": "waypoint", "challengeType": 1, - "translations": { - } + "translations": {} }, { "id": "5688e62ea601b2482ff8422b", @@ -5839,4 +5832,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/debugging.json b/seed/challenges/02-javascript-algorithms-and-data-structures/debugging.json index 69ac2e6cd3..cdbbf4cc9d 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/debugging.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/debugging.json @@ -423,4 +423,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json b/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json index 70b2f736e2..a363d22dde 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json @@ -84,7 +84,6 @@ "This exercise is designed to illustrate the difference between how var and let keywords assign scope to the declared variable. When programming a function similar to the one used in this exercise, it is often better to use different variable names to avoid confusion." ], "challengeSeed": [ - "", "function checkScope() {", "\"use strict\";", " var i = \"function scope\";", diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json b/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json index a4b7f62e1b..11df741082 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json @@ -6,20 +6,21 @@ "challenges": [ { "id": "587d7b8d367417b2b2512b5a", - "title": "Introduction to the Functional Programming Challenges", - "description": [ - [ - "", - "", - "Functional programming is an approach to software development based around the evaluation of functions. Like mathematics, functions in programming map input to output to produce a result. You can combine basic functions in many ways to build more and more complex programs.

Functional programming follows a few core principles:



The functional programming software development approach breaks a program into small, testable parts. This section covers basic functional programming principles in JavaScript.", - "" - ] ], - "releasedOn": "", - "challengeSeed": [], - "tests": [], - "type": "Waypoint", - "challengeType": 7, - "isRequired": false + "title": "Introduction to the Functional Programming Challenges", + "description": [ + [ + "", + "", + "Functional programming is an approach to software development based around the evaluation of functions. Like mathematics, functions in programming map input to output to produce a result. You can combine basic functions in many ways to build more and more complex programs.

Functional programming follows a few core principles:



The functional programming software development approach breaks a program into small, testable parts. This section covers basic functional programming principles in JavaScript.", + "" + ] + ], + "releasedOn": "", + "challengeSeed": [], + "tests": [], + "type": "Waypoint", + "challengeType": 7, + "isRequired": false }, { "id": "587d7b8d367417b2b2512b5b", @@ -276,9 +277,9 @@ "console.log(fixedValue); // Should print 4" ], "tests": [ - "assert(fixedValue === 4, 'message: Your function incrementer should not change the value of fixedValue.');", - "assert(code.match(/function\\s+?incrementer\\s*?\\(.+?\\)/g), 'message: Your incrementer function should take a parameter.');", - "assert(newValue === 5, 'message: Your incrementer function should return a value that is one larger than the fixedValue value.');" + "assert(fixedValue === 4, 'message: Your function incrementer should not change the value of fixedValue.');", + "assert(code.match(/function\\s+?incrementer\\s*?\\(.+?\\)/g), 'message: Your incrementer function should take a parameter.');", + "assert(newValue === 5, 'message: Your incrementer function should return a value that is one larger than the fixedValue value.');" ], "solutions": [], "hints": [], @@ -339,9 +340,9 @@ ], "solutions": [], "hints": [ - "Look at how the functions are called to see the correct order of the parameters.", - "Consider using the concat method instead of push.", - "The slice method returns a new array without modifying the original." + "Look at how the functions are called to see the correct order of the parameters.", + "Consider using the concat method instead of push.", + "The slice method returns a new array without modifying the original." ], "type": "waypoint", "challengeType": 1, @@ -990,9 +991,9 @@ ], "solutions": [], "hints": [ - "Try using .filter() to filter the watchList by Director.", - "Try using .map() to return an array of ratings.", - "You can use Number() to convert a string into a number." + "Try using .filter() to filter the watchList by Director.", + "Try using .map() to return an array of ratings.", + "You can use Number() to convert a string into a number." ], "type": "waypoint", "challengeType": 1, @@ -1088,7 +1089,7 @@ ], "solutions": [], "hints": [ - "The regex pre-defined character class for non-alphanumerics is \\W." + "The regex pre-defined character class for non-alphanumerics is \\W." ], "type": "waypoint", "challengeType": 1, @@ -1123,7 +1124,7 @@ ], "solutions": [], "hints": [ - "First try to split the given string before applying the join method." + "First try to split the given string before applying the join method." ], "type": "waypoint", "challengeType": 1, @@ -1166,8 +1167,8 @@ ], "solutions": [], "hints": [ - "When several spaces in a row are split by space, it puts an empty string in the array.", - "You can use the .toLowerCase() method to make the title all lower case." + "When several spaces in a row are split by space, it puts an empty string in the array.", + "You can use the .toLowerCase() method to make the title all lower case." ], "type": "waypoint", "challengeType": 1, @@ -1273,4 +1274,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json b/seed/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json index 275f69bdcd..8bc20c28f7 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json @@ -1056,7 +1056,7 @@ ] } }, - "guideUrl":"https://guide.freecodecamp.org/certificates/arguments-optional" + "guideUrl": "https://guide.freecodecamp.org/certificates/arguments-optional" }, { "id": "a2f1d72d9b908d0bd72bb9f6", @@ -1209,4 +1209,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects.json b/seed/challenges/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects.json index efa1583697..c0bce221d0 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects.json @@ -168,9 +168,7 @@ "// Change the inputs below to test", "rot13(\"SERR PBQR PNZC\");" ], - "tail": [ - "" - ], + "tail": [], "solutions": [ "var lookup = {\n 'A': 'N','B': 'O','C': 'P','D': 'Q',\n 'E': 'R','F': 'S','G': 'T','H': 'U',\n 'I': 'V','J': 'W','K': 'X','L': 'Y',\n 'M': 'Z','N': 'A','O': 'B','P': 'C',\n 'Q': 'D','R': 'E','S': 'F','T': 'G',\n 'U': 'H','V': 'I','W': 'J','X': 'K',\n 'Y': 'L','Z': 'M' \n};\n\nfunction rot13(encodedStr) {\n var codeArr = encodedStr.split(\"\"); // String to Array\n var decodedArr = []; // Your Result goes here\n // Only change code below this line\n \n decodedArr = codeArr.map(function(letter) {\n if(lookup.hasOwnProperty(letter)) {\n letter = lookup[letter];\n }\n return letter;\n });\n\n // Only change code above this line\n return decodedArr.join(\"\"); // Array to String\n}" ], @@ -386,4 +384,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json index 5781943308..de016bf62e 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json @@ -136,7 +136,6 @@ "Modify the dog.sayLegs method to remove any references to dog. Use the duck example for guidance." ], "challengeSeed": [ - "", "let dog = {", " name: \"Spot\",", " numLegs: 4,", @@ -171,11 +170,7 @@ "
", "Create a constructor, Dog, with properties name, color, and numLegs that are set to a string, a string, and a number, respectively." ], - "challengeSeed": [ - "", - "", - "" - ], + "challengeSeed": [], "tests": [ "assert(typeof (new Dog()).name === 'string', 'message: Dog should have a name property set to a string.');", "assert(typeof (new Dog()).color === 'string', 'message: Dog should have a color property set to a string.');", @@ -1060,4 +1055,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json b/seed/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json index 3116d4aef2..dc301efaa9 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json @@ -992,4 +992,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/03-front-end-libraries/bootstrap.json b/seed/challenges/03-front-end-libraries/bootstrap.json index c6481e18ad..c63e8df7b3 100644 --- a/seed/challenges/03-front-end-libraries/bootstrap.json +++ b/seed/challenges/03-front-end-libraries/bootstrap.json @@ -1894,11 +1894,7 @@ "To start with, create an h3 element, with the text jQuery Playground.", "Color your h3 element with the text-primary Bootstrap class, and center it with the text-center Bootstrap class." ], - "challengeSeed": [ - "", - "", - "" - ], + "challengeSeed": [], "tests": [ "assert($(\"h3\") && $(\"h3\").length > 0, 'message: Add a h3 element to your page.');", "assert(code.match(/<\\/h3>/g) && code.match(/

/g).length === code.match(/

h3 element has a closing tag.');", diff --git a/seed/challenges/03-front-end-libraries/front-end-libraries-projects.json b/seed/challenges/03-front-end-libraries/front-end-libraries-projects.json index cc15a1011d..d14c838646 100644 --- a/seed/challenges/03-front-end-libraries/front-end-libraries-projects.json +++ b/seed/challenges/03-front-end-libraries/front-end-libraries-projects.json @@ -195,4 +195,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/03-front-end-libraries/jquery.json b/seed/challenges/03-front-end-libraries/jquery.json index 49ec950219..31f47d0073 100644 --- a/seed/challenges/03-front-end-libraries/jquery.json +++ b/seed/challenges/03-front-end-libraries/jquery.json @@ -47,8 +47,6 @@ "This is important because without your document ready function, your code may run before your HTML is rendered, which would cause bugs." ], "challengeSeed": [ - "", - "", "", "", "
", diff --git a/seed/challenges/03-front-end-libraries/react-and-redux.json b/seed/challenges/03-front-end-libraries/react-and-redux.json index ccc3f310b2..a7ba840504 100644 --- a/seed/challenges/03-front-end-libraries/react-and-redux.json +++ b/seed/challenges/03-front-end-libraries/react-and-redux.json @@ -755,4 +755,4 @@ "reactRedux": true } ] -} +} \ No newline at end of file diff --git a/seed/challenges/03-front-end-libraries/react.json b/seed/challenges/03-front-end-libraries/react.json index 2066c5ebaa..99864d864f 100644 --- a/seed/challenges/03-front-end-libraries/react.json +++ b/seed/challenges/03-front-end-libraries/react.json @@ -1,5 +1,4 @@ { - "name": "React", "order": 5, "time": "5 hours", @@ -292,7 +291,8 @@ " // change code above this line", "}" ], - "tail": "ReactDOM.render(, document.getElementById('root'))" } + "tail": "ReactDOM.render(, document.getElementById('root'))" + } }, "tests": [ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.length === 1; })(), 'message: MyComponent should return JSX.');", @@ -300,7 +300,7 @@ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find('div').text() !== ''; })(), 'message: The div element should contain a string of text.');" ], "solutions": [ - "\nconst MyComponent = function() {\n // change code below this line\n return (\n
\n Demo Solution\n
\n );\n // change code above this line\n}" + "const MyComponent = function() {\n // change code below this line\n return (\n
\n Demo Solution\n
\n );\n // change code above this line\n}" ], "challengeType": 6, "isRequired": false, @@ -348,7 +348,7 @@ "assert(Enzyme.shallow(React.createElement(MyComponent)).html() === '

Hello React!

', 'message: The h1 header should contain the string Hello React!.');" ], "solutions": [ - "\nclass MyComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n // change code below this line\n return (\n
\n

Hello React!

\n
\n );\n // change code above this line\n }\n};" + "class MyComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n // change code below this line\n return (\n
\n

Hello React!

\n
\n );\n // change code above this line\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -506,49 +506,49 @@ "name": "index", "head": [ "class NonCitrus extends React.Component {", - " render() {", - " return (", - "
", - "

Non-Citrus:

", - "
    ", - "
  • Apples
  • ", - "
  • Blueberries
  • ", - "
  • Strawberries
  • ", - "
  • Bananas
  • ", - "
", - "
", - " );", - " }", - "};", - "class Citrus extends React.Component {", - " render() {", - " return (", - "
", - "

Citrus:

", - "
    ", - "
  • Lemon
  • ", - "
  • Lime
  • ", - "
  • Orange
  • ", - "
  • Grapefruit
  • ", - "
", - "
", - " );", - " }", - "};", - "class Vegetables extends React.Component {", - " render() {", - " return (", - "
", - "

Vegetables:

", - "
    ", - "
  • Brussel Sprouts
  • ", - "
  • Broccoli
  • ", - "
  • Squash
  • ", - "
", - "
", - " );", - " }", - "};" + " render() {", + " return (", + "
", + "

Non-Citrus:

", + "
    ", + "
  • Apples
  • ", + "
  • Blueberries
  • ", + "
  • Strawberries
  • ", + "
  • Bananas
  • ", + "
", + "
", + " );", + " }", + "};", + "class Citrus extends React.Component {", + " render() {", + " return (", + "
", + "

Citrus:

", + "
    ", + "
  • Lemon
  • ", + "
  • Lime
  • ", + "
  • Orange
  • ", + "
  • Grapefruit
  • ", + "
", + "
", + " );", + " }", + "};", + "class Vegetables extends React.Component {", + " render() {", + " return (", + "
", + "

Vegetables:

", + "
    ", + "
  • Brussel Sprouts
  • ", + "
  • Broccoli
  • ", + "
  • Squash
  • ", + "
", + "
", + " );", + " }", + "};" ], "contents": [ "class Fruits extends React.Component {", @@ -620,39 +620,39 @@ "head": [ "", "const Fruits = () => {", - " return (", - "
", - "

Fruits:

", - "

Non-Citrus:

", - "
    ", - "
  • Apples
  • ", - "
  • Blueberries
  • ", - "
  • Strawberries
  • ", - "
  • Bananas
  • ", - "
", - "

Citrus:

", - "
    ", - "
  • Lemon
  • ", - "
  • Lime
  • ", - "
  • Orange
  • ", - "
  • Grapefruit
  • ", - "
", - "
", - " );", - "};", - "const Vegetables = () => {", - " return (", - "
", - "

Vegetables:

", - "
    ", - "
  • Brussel Sprouts
  • ", - "
  • Broccoli
  • ", - "
  • Squash
  • ", - "
", - "
", - " );", - "};", - "" + " return (", + "
", + "

Fruits:

", + "

Non-Citrus:

", + "
    ", + "
  • Apples
  • ", + "
  • Blueberries
  • ", + "
  • Strawberries
  • ", + "
  • Bananas
  • ", + "
", + "

Citrus:

", + "
    ", + "
  • Lemon
  • ", + "
  • Lime
  • ", + "
  • Orange
  • ", + "
  • Grapefruit
  • ", + "
", + "
", + " );", + "};", + "const Vegetables = () => {", + " return (", + "
", + "

Vegetables:

", + "
    ", + "
  • Brussel Sprouts
  • ", + "
  • Broccoli
  • ", + "
  • Squash
  • ", + "
", + "
", + " );", + "};", + "" ], "contents": [ "", @@ -684,7 +684,7 @@ "assert((function() { const html = document.getElementById('challenge-node').childNodes[0].innerHTML; return (html === '

Types of Food:

Fruits:

Non-Citrus:

  • Apples
  • Blueberries
  • Strawberries
  • Bananas

Citrus:

  • Lemon
  • Lime
  • Orange
  • Grapefruit

Vegetables:

  • Brussel Sprouts
  • Broccoli
  • Squash
'); })(), 'message: The TypesOfFood component should render to the DOM within the div with the id challenge-node.');" ], "solutions": [ - "\nclass TypesOfFood extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return (\n
\n

Types of Food:

\n {/* change code below this line */}\n \n \n {/* change code above this line */}\n
\n );\n }\n};\n\n// change code below this line\nReactDOM.render(, document.getElementById('challenge-node'));" + "class TypesOfFood extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return (\n
\n

Types of Food:

\n {/* change code below this line */}\n \n \n {/* change code above this line */}\n
\n );\n }\n};\n\n// change code below this line\nReactDOM.render(, document.getElementById('challenge-node'));" ], "challengeType": 6, "isRequired": false, @@ -782,7 +782,7 @@ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.find('p').html().includes(Date().substr(3)); })(), 'message: The CurrentDate component should render the value from the date prop in the p tag.');" ], "solutions": [ - "\nconst CurrentDate = (props) => {\n return (\n
\n { /* change code below this line */ }\n

The current date is: {props.date}

\n { /* change code above this line */ }\n
\n );\n};\n\nclass Calendar extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return (\n
\n

What date is it?

\n { /* change code below this line */ }\n \n { /* change code above this line */ }\n
\n );\n }\n};" + "const CurrentDate = (props) => {\n return (\n
\n { /* change code below this line */ }\n

The current date is: {props.date}

\n { /* change code above this line */ }\n
\n );\n};\n\nclass Calendar extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return (\n
\n

What date is it?

\n { /* change code below this line */ }\n \n { /* change code above this line */ }\n
\n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -1096,8 +1096,8 @@ "name": "index", "head": [ "var PropTypes = {", - " string: { isRequired: true }", - "};" + " string: { isRequired: true }", + "};" ], "contents": [ "class CampSite extends React.Component {", @@ -1177,7 +1177,7 @@ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(StatefulComponent)); const initialState = mockedComponent.state(); return mockedComponent.find('h1').text() === initialState.name; })(), 'message: The property name in the state of StatefulComponent should render in the h1 element.');" ], "solutions": [ - "\nclass StatefulComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n name: 'freeCodeCamp!'\n }\n }\n render() {\n return (\n
\n

{this.state.name}

\n
\n );\n }\n};" + "class StatefulComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n name: 'freeCodeCamp!'\n }\n }\n render() {\n return (\n
\n

{this.state.name}

\n
\n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2058,7 +2058,7 @@ "tests": [ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Controller)); return mockedComponent.find('Controller').length === 1 && mockedComponent.find('Dialog').length === 1; })(), 'message: The Controller component should render the Dialog component as a child.');", "assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentWillReceiveProps.toString().replace(/ /g,''); return lifecycleChild.includes('console.log') && lifecycleChild.includes('this.props') })(), 'message: The componentWillReceiveProps method in the Dialog component should log this.props to the console.');", - "assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentWillReceiveProps.toString().replace(/ /g,''); const nextPropsAsParameterTest = \/componentWillReceiveProps(| *?= *?)(\\(|)nextProps(\\)|)( *?=> *?{| *?{|{)\/; const nextPropsInConsoleLogTest = \/console\\.log\\(.*?nextProps\\b.*?\\)\/; return ( lifecycleChild.includes('console.log') && nextPropsInConsoleLogTest.test(lifecycleChild) && nextPropsAsParameterTest.test(lifecycleChild) ); })(), 'message: The componentWillReceiveProps method in the Dialog component should log nextProps to the console.');", + "assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentWillReceiveProps.toString().replace(/ /g,''); const nextPropsAsParameterTest = /componentWillReceiveProps(| *?= *?)(\\(|)nextProps(\\)|)( *?=> *?{| *?{|{)/; const nextPropsInConsoleLogTest = /console\\.log\\(.*?nextProps\\b.*?\\)/; return ( lifecycleChild.includes('console.log') && nextPropsInConsoleLogTest.test(lifecycleChild) && nextPropsAsParameterTest.test(lifecycleChild) ); })(), 'message: The componentWillReceiveProps method in the Dialog component should log nextProps to the console.');", "assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentDidUpdate.toString().replace(/ /g,''); return lifecycleChild.length !== 'undefined' && lifecycleChild.includes('console.log'); })(), 'message: The Dialog component should call the componentDidUpdate method and log a message to the console.');" ], "solutions": [ @@ -2186,7 +2186,7 @@ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Colorful)); return (mockedComponent.children().props().style.fontSize === 72 || mockedComponent.children().props().style.fontSize === '72' || mockedComponent.children().props().style.fontSize === '72px'); })(), 'message: The div element should have a font size of 72px.');" ], "solutions": [ - "\nclass Colorful extends React.Component {\n render() {\n return (\n
Big Red
\n );\n }\n};\n" + "class Colorful extends React.Component {\n render() {\n return (\n
Big Red
\n );\n }\n};\n" ], "challengeType": 6, "isRequired": false, @@ -2235,7 +2235,7 @@ "assert((function() { const mockedComponent = Enzyme.shallow(React.createElement(Colorful)); return (mockedComponent.props().style.color === \"purple\" && mockedComponent.props().style.fontSize === 40 && mockedComponent.props().style.border === \"2px solid purple\"); })(), 'message: The div element should have its styles defined by the styles object.');" ], "solutions": [ - "\nconst styles = {\n color: \"purple\",\n fontSize: 40,\n border: \"2px solid purple\"\n};\n// change code above this line\nclass Colorful extends React.Component {\n render() {\n // change code below this line\n return (\n
Style Me!
\n // change code above this line\n );\n }\n};\n" + "const styles = {\n color: \"purple\",\n fontSize: 40,\n border: \"2px solid purple\"\n};\n// change code above this line\nclass Colorful extends React.Component {\n render() {\n // change code below this line\n return (\n
Style Me!
\n // change code above this line\n );\n }\n};\n" ], "challengeType": 6, "isRequired": false, @@ -2346,7 +2346,7 @@ "async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MagicEightBall)); const simulate = () => { comp.find('input').simulate('change', { target: { value: 'test?' }}); comp.find('button').simulate('click'); }; const result = () => comp.find('p').text(); const _1 = () => { simulate(); return waitForIt(() => result()) }; const _2 = () => { simulate(); return waitForIt(() => result()) }; const _3 = () => { simulate(); return waitForIt(() => result()) }; const _4 = () => { simulate(); return waitForIt(() => result()) }; const _5 = () => { simulate(); return waitForIt(() => result()) }; const _6 = () => { simulate(); return waitForIt(() => result()) }; const _7 = () => { simulate(); return waitForIt(() => result()) }; const _8 = () => { simulate(); return waitForIt(() => result()) }; const _9 = () => { simulate(); return waitForIt(() => result()) }; const _10 = () => { simulate(); return waitForIt(() => result()) }; const _1_val = await _1(); const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); const _6_val = await _6(); const _7_val = await _7(); const _8_val = await _8(); const _9_val = await _9(); const _10_val = await _10(); const actualAnswers = [_1_val, _2_val, _3_val, _4_val, _5_val, _6_val, _7_val, _8_val, _9_val, _10_val]; const hasIndex = actualAnswers.filter((answer, i) => possibleAnswers.indexOf(answer) !== -1); const notAllEqual = new Set(actualAnswers); assert(notAllEqual.size > 1 && hasIndex.length === 10, 'message: When text is entered into the input element and the button is clicked, the MagicEightBall component should return a p element that contains a random element from the possibleAnswers array.');}" ], "solutions": [ - "\nconst inputStyle = {\n width: 235,\n margin: 5\n}\n\nclass MagicEightBall extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n userInput: '',\n randomIndex: ''\n }\n this.ask = this.ask.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n ask() {\n if (this.state.userInput) {\n this.setState({\n randomIndex: Math.floor(Math.random() * 20),\n userInput: ''\n });\n }\n }\n handleChange(event) {\n this.setState({\n userInput: event.target.value\n });\n }\n render() {\n const possibleAnswers = [\n \"It is certain\", \"It is decidedly so\", \"Without a doubt\",\n \"Yes, definitely\", \"You may rely on it\", \"As I see it, yes\",\n \"Outlook good\", \"Yes\", \"Signs point to yes\", \"Reply hazy try again\",\n \"Ask again later\", \"Better not tell you now\", \"Cannot predict now\",\n \"Concentrate and ask again\", \"Don't count on it\", \"My reply is no\",\n \"My sources say no\", \"Outlook not so good\",\"Very doubtful\", \"Most likely\"\n ];\n const answer = possibleAnswers[this.state.randomIndex];\n return (\n
\n
\n
\n

Answer:

\n

\n {answer}\n

\n
\n );\n }\n};" + "const inputStyle = {\n width: 235,\n margin: 5\n}\n\nclass MagicEightBall extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n userInput: '',\n randomIndex: ''\n }\n this.ask = this.ask.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n ask() {\n if (this.state.userInput) {\n this.setState({\n randomIndex: Math.floor(Math.random() * 20),\n userInput: ''\n });\n }\n }\n handleChange(event) {\n this.setState({\n userInput: event.target.value\n });\n }\n render() {\n const possibleAnswers = [\n \"It is certain\", \"It is decidedly so\", \"Without a doubt\",\n \"Yes, definitely\", \"You may rely on it\", \"As I see it, yes\",\n \"Outlook good\", \"Yes\", \"Signs point to yes\", \"Reply hazy try again\",\n \"Ask again later\", \"Better not tell you now\", \"Cannot predict now\",\n \"Concentrate and ask again\", \"Don't count on it\", \"My reply is no\",\n \"My sources say no\", \"Outlook not so good\",\"Very doubtful\", \"Most likely\"\n ];\n const answer = possibleAnswers[this.state.randomIndex];\n return (\n
\n
\n
\n

Answer:

\n

\n {answer}\n

\n
\n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2545,7 +2545,7 @@ "assert(new RegExp(/(\\s|;)if(\\s|\\()/).test(Enzyme.mount(React.createElement(CheckUserAge)).instance().render.toString()) === false, 'message: Your code should not contain any if/else statements.');" ], "solutions": [ - "\nconst inputStyle = {\n width: 235,\n margin: 5\n}\n\nclass CheckUserAge extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n userAge: '',\n input: ''\n }\n this.submit = this.submit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n handleChange(e) {\n this.setState({\n input: e.target.value,\n userAge: ''\n });\n }\n submit() {\n this.setState({\n userAge: this.state.input\n });\n }\n render() {\n const buttonOne = ;\n const buttonTwo = ;\n const buttonThree = ;\n return (\n
\n

Enter Your Age to Continue

\n
\n {\n this.state.userAge === '' ?\n buttonOne :\n this.state.userAge >= 18 ?\n buttonTwo :\n buttonThree\n }\n
\n );\n }\n};" + "const inputStyle = {\n width: 235,\n margin: 5\n}\n\nclass CheckUserAge extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n userAge: '',\n input: ''\n }\n this.submit = this.submit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n handleChange(e) {\n this.setState({\n input: e.target.value,\n userAge: ''\n });\n }\n submit() {\n this.setState({\n userAge: this.state.input\n });\n }\n render() {\n const buttonOne = ;\n const buttonTwo = ;\n const buttonThree = ;\n return (\n
\n

Enter Your Age to Continue

\n
\n {\n this.state.userAge === '' ?\n buttonOne :\n this.state.userAge >= 18 ?\n buttonTwo :\n buttonThree\n }\n
\n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2691,7 +2691,7 @@ "async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); const simulateChange = (el, value) => el.simulate('change', {target: {value}}); let initialStyle = mockedComponent.find('input').props().style.border; const state_1 = () => { mockedComponent.setState({input: 'this is 15 char' }); return waitForIt(() => mockedComponent.find('input').props().style.border )}; const state_2 = () => { mockedComponent.setState({input: 'A very long string longer than 15 characters.' }); return waitForIt(() => mockedComponent.find('input').props().style.border )}; const style_1 = await state_1(); const style_2 = await state_2(); assert(initialStyle === '1px solid black' && style_1 === '1px solid black' && style_2 === '3px solid red', 'message: The input tag should be styled with a border of 3px solid red if the input value in state is longer than 15 characters.'); }; " ], "solutions": [ - "\nclass GateKeeper extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n input: ''\n };\n this.handleChange = this.handleChange.bind(this);\n }\n handleChange(event) {\n this.setState({ input: event.target.value })\n }\n render() {\n let inputStyle = {\n border: '1px solid black'\n };\n if (this.state.input.length > 15) {\n inputStyle.border = '3px solid red';\n };\n return (\n
\n

Don't Type Too Much:

\n \n
\n );\n }\n};" + "class GateKeeper extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n input: ''\n };\n this.handleChange = this.handleChange.bind(this);\n }\n handleChange(event) {\n this.setState({ input: event.target.value })\n }\n render() {\n let inputStyle = {\n border: '1px solid black'\n };\n if (this.state.input.length > 15) {\n inputStyle.border = '3px solid red';\n };\n return (\n
\n

Don't Type Too Much:

\n \n
\n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2772,7 +2772,7 @@ "async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); const simulateChange = (el, value) => el.simulate('change', {target: {value}}); const state_1 = () => { return waitForIt(() => mockedComponent.find('ul').find('li'))}; const setInput = () => { return waitForIt(() => simulateChange(mockedComponent.find('textarea'), \"testA, testB, testC\"))}; const click = () => { return waitForIt(() => mockedComponent.find('button').simulate('click'))}; const state_2 = () => { return waitForIt(() => { const nodes = mockedComponent.find('ul').find('li'); return { nodes, text: nodes.reduce((t, n) => t + n.text(), '') }; })}; const setInput_2 = () => { return waitForIt(() => simulateChange(mockedComponent.find('textarea'), \"t1, t2, t3, t4, t5, t6\"))}; const click_1 = () => { return waitForIt(() => mockedComponent.find('button').simulate('click'))}; const state_3 = () => { return waitForIt(() => { const nodes = mockedComponent.find('ul').find('li'); return { nodes, text: nodes.reduce((t, n) => t + n.text(), '') }; })}; const awaited_state_1 = await state_1(); const awaited_setInput = await setInput(); const awaited_click = await click(); const awaited_state_2 = await state_2(); const awaited_setInput_2 = await setInput_2(); const awaited_click_1 = await click_1(); const awaited_state_3 = await state_3(); assert(awaited_state_1.length === 0 && awaited_state_2.nodes.length === 3 && awaited_state_3.nodes.length === 6 && awaited_state_2.text === 'testA testB testC' && awaited_state_3.text === 't1 t2 t3 t4 t5 t6', 'message: When the Create List button is clicked, the MyToDoList component should dynamically return an unordered list that contains a list item element for every item of a comma-separated list entered into the textarea element.'); }; " ], "solutions": [ - "\nconst textAreaStyles = {\n width: 235,\n margin: 5\n};\n\nclass MyToDoList extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n toDoList: [],\n userInput: ''\n }\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n handleSubmit() {\n const itemsArray = this.state.userInput.split(',');\n this.setState({\n toDoList: itemsArray\n });\n }\n handleChange(e) {\n this.setState({\n userInput: e.target.value\n });\n }\n render() {\n const items = this.state.toDoList.map( (item, i) => {\n return
  • {item}
  • \n });\n return (\n
    \n
    \n \n

    My \"To Do\" List:

    \n
      \n {items}\n
    \n
    \n );\n }\n};" + "const textAreaStyles = {\n width: 235,\n margin: 5\n};\n\nclass MyToDoList extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n toDoList: [],\n userInput: ''\n }\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n handleSubmit() {\n const itemsArray = this.state.userInput.split(',');\n this.setState({\n toDoList: itemsArray\n });\n }\n handleChange(e) {\n this.setState({\n userInput: e.target.value\n });\n }\n render() {\n const items = this.state.toDoList.map( (item, i) => {\n return
  • {item}
  • \n });\n return (\n
    \n
    \n \n

    My \"To Do\" List:

    \n
      \n {items}\n
    \n
    \n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2828,7 +2828,7 @@ "assert((() => { const ul = Enzyme.mount(React.createElement(Frameworks)).find('ul'); const keys = new Set([ ul.childAt(0).key(), ul.childAt(1).key(), ul.childAt(2).key(), ul.childAt(3).key(), ul.childAt(4).key(), ul.childAt(5).key(), ]); return keys.size === 6; })(), 'message: Each list item element should have a unique key attribute.');" ], "solutions": [ - "\nconst frontEndFrameworks = [\n 'React',\n 'Angular',\n 'Ember',\n 'Knockout',\n 'Backbone',\n 'Vue'\n];\n\nfunction Frameworks() {\n const renderFrameworks = frontEndFrameworks.map((fw, i) => {\n return
  • {fw}
  • \n })\n return (\n
    \n

    Popular Front End JavaScript Frameworks

    \n
      \n {renderFrameworks}\n
    \n
    \n );\n};" + "const frontEndFrameworks = [\n 'React',\n 'Angular',\n 'Ember',\n 'Knockout',\n 'Backbone',\n 'Vue'\n];\n\nfunction Frameworks() {\n const renderFrameworks = frontEndFrameworks.map((fw, i) => {\n return
  • {fw}
  • \n })\n return (\n
    \n

    Popular Front End JavaScript Frameworks

    \n
      \n {renderFrameworks}\n
    \n
    \n );\n};" ], "challengeType": 6, "isRequired": false, @@ -2908,7 +2908,7 @@ "assert((() => { const ul = Enzyme.mount(React.createElement(MyComponent)).find('ul'); console.log(ul.debug()); const keys = new Set([ ul.childAt(0).key(), ul.childAt(1).key(), ul.childAt(2).key(), ul.childAt(3).key() ]); return keys.size === 4; })(), 'message: Each list item element should have a unique key attribute.');" ], "solutions": [ - "\nclass MyComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n users: [\n {\n username: 'Jeff',\n online: true\n },\n {\n username: 'Alan',\n online: false\n },\n {\n username: 'Mary',\n online: true\n },\n {\n username: 'Jim',\n online: false\n },\n {\n username: 'Sara',\n online: true\n },\n {\n username: 'Laura',\n online: true\n }\n ]\n }\n }\n render() {\n const usersOnline = this.state.users.filter(user => {\n return user.online;\n });\n const renderOnlineUsers = usersOnline.map(user => {\n return (\n
  • {user.username}
  • \n );\n });\n return (\n
    \n

    Current Online Users:

    \n
      \n {renderOnlineUsers}\n
    \n
    \n );\n }\n};" + "class MyComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n users: [\n {\n username: 'Jeff',\n online: true\n },\n {\n username: 'Alan',\n online: false\n },\n {\n username: 'Mary',\n online: true\n },\n {\n username: 'Jim',\n online: false\n },\n {\n username: 'Sara',\n online: true\n },\n {\n username: 'Laura',\n online: true\n }\n ]\n }\n }\n render() {\n const usersOnline = this.state.users.filter(user => {\n return user.online;\n });\n const renderOnlineUsers = usersOnline.map(user => {\n return (\n
  • {user.username}
  • \n );\n });\n return (\n
    \n

    Current Online Users:

    \n
      \n {renderOnlineUsers}\n
    \n
    \n );\n }\n};" ], "challengeType": 6, "isRequired": false, @@ -2954,7 +2954,7 @@ "getUserInput => assert(getUserInput('index').replace(/ /g,'').includes('ReactDOMServer.renderToString()') && Enzyme.mount(React.createElement(App)).children().name() === 'div', 'message: The App component should render to a string using ReactDOMServer.renderToString.');" ], "solutions": [ - "\nclass App extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return
    \n }\n};\n\n// change code below this line\nReactDOMServer.renderToString();" + "class App extends React.Component {\n constructor(props) {\n super(props);\n }\n render() {\n return
    \n }\n};\n\n// change code below this line\nReactDOMServer.renderToString();" ], "challengeType": 6, "isRequired": false, @@ -2962,4 +2962,4 @@ "react": true } ] -} +} \ No newline at end of file diff --git a/seed/challenges/03-front-end-libraries/redux.json b/seed/challenges/03-front-end-libraries/redux.json index 7a7879fca6..d59c8f726c 100644 --- a/seed/challenges/03-front-end-libraries/redux.json +++ b/seed/challenges/03-front-end-libraries/redux.json @@ -927,4 +927,4 @@ "redux": true } ] -} +} \ No newline at end of file diff --git a/seed/challenges/03-front-end-libraries/sass.json b/seed/challenges/03-front-end-libraries/sass.json index 607e106ddf..8b78325092 100644 --- a/seed/challenges/03-front-end-libraries/sass.json +++ b/seed/challenges/03-front-end-libraries/sass.json @@ -478,4 +478,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/04-data-visualization/data-visualization-projects.json b/seed/challenges/04-data-visualization/data-visualization-projects.json index 898ba0e790..cb54c04391 100644 --- a/seed/challenges/04-data-visualization/data-visualization-projects.json +++ b/seed/challenges/04-data-visualization/data-visualization-projects.json @@ -184,4 +184,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/04-data-visualization/data-visualization-with-d3.json b/seed/challenges/04-data-visualization/data-visualization-with-d3.json index e000755dba..484c087d28 100644 --- a/seed/challenges/04-data-visualization/data-visualization-with-d3.json +++ b/seed/challenges/04-data-visualization/data-visualization-with-d3.json @@ -1803,4 +1803,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/04-data-visualization/json-apis-and-ajax.json b/seed/challenges/04-data-visualization/json-apis-and-ajax.json index 34c03f3f45..554559bfae 100644 --- a/seed/challenges/04-data-visualization/json-apis-and-ajax.json +++ b/seed/challenges/04-data-visualization/json-apis-and-ajax.json @@ -691,4 +691,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/05-apis-and-microservices/api-and-microservice-projects.json b/seed/challenges/05-apis-and-microservices/api-and-microservice-projects.json index eca6eab092..0b908bc8ee 100644 --- a/seed/challenges/05-apis-and-microservices/api-and-microservice-projects.json +++ b/seed/challenges/05-apis-and-microservices/api-and-microservice-projects.json @@ -171,4 +171,4 @@ } } ] -} +} \ No newline at end of file diff --git a/seed/challenges/05-apis-and-microservices/basic-node-and-express.json b/seed/challenges/05-apis-and-microservices/basic-node-and-express.json index 6dc0df7e03..f66f876f05 100644 --- a/seed/challenges/05-apis-and-microservices/basic-node-and-express.json +++ b/seed/challenges/05-apis-and-microservices/basic-node-and-express.json @@ -309,4 +309,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/05-apis-and-microservices/managing-packages-with-npm.json b/seed/challenges/05-apis-and-microservices/managing-packages-with-npm.json index 6cb363c387..3d148a4792 100644 --- a/seed/challenges/05-apis-and-microservices/managing-packages-with-npm.json +++ b/seed/challenges/05-apis-and-microservices/managing-packages-with-npm.json @@ -304,4 +304,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/05-apis-and-microservices/mongodb-and-mongoose.json b/seed/challenges/05-apis-and-microservices/mongodb-and-mongoose.json index db93f42f53..c2d08c5f1a 100644 --- a/seed/challenges/05-apis-and-microservices/mongodb-and-mongoose.json +++ b/seed/challenges/05-apis-and-microservices/mongodb-and-mongoose.json @@ -323,4 +323,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json b/seed/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json index a750cccae2..99c2d97a00 100644 --- a/seed/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json +++ b/seed/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json @@ -738,4 +738,4 @@ "isRequired": false } ] -} +} \ No newline at end of file diff --git a/seed/challenges/06-information-security-and-quality-assurance/information-security-with-helmetjs.json b/seed/challenges/06-information-security-and-quality-assurance/information-security-with-helmetjs.json index 80b665a8c1..2ba45de34c 100644 --- a/seed/challenges/06-information-security-and-quality-assurance/information-security-with-helmetjs.json +++ b/seed/challenges/06-information-security-and-quality-assurance/information-security-with-helmetjs.json @@ -371,4 +371,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-information-security-projects.json b/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-information-security-projects.json index aed18c6357..a905c18a63 100644 --- a/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-information-security-projects.json +++ b/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-information-security-projects.json @@ -295,4 +295,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai.json b/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai.json index ff21ef10b2..af87bccc5b 100644 --- a/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai.json +++ b/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai.json @@ -831,4 +831,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-algorithm-questions.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-algorithm-questions.json index a10cf6964f..f780e36266 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-algorithm-questions.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-algorithm-questions.json @@ -467,4 +467,4 @@ "releasedOn": "February 17, 2017" } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json index 35a2372674..49d51d866f 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json @@ -390,7 +390,7 @@ "releasedOn": "Feb 17, 2017", "solutions": [ "function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};}" - ], + ], "challengeType": 1, "translations": {} }, @@ -988,7 +988,7 @@ "description": [ "Let's create a linked list class. Every linked list should start out with a few basic properties: a head (the first item in your list) and a length (number of items in your list). Sometimes you'll see implementations of linked lists that incorporate a tail for the last element of the list, but for now we'll just stick with these two. Whenever we add an element to the linked list, our length property should be incremented by one.", "We'll want to have a way to add items to our linked list, so the first method we'll want to create is the add method.", - "If our list is empty, adding an element to our linked list is straightforward enough: we just wrap that element in a Node class, and we assign that node to the head of our linked list." , + "If our list is empty, adding an element to our linked list is straightforward enough: we just wrap that element in a Node class, and we assign that node to the head of our linked list.", "But what if our list already has one or more members? How do we add an element to the list? Recall that each node in a linked list has a next property. To add a node to the list, find the last node in the list, and point that last node's next property at our new node. (Hint: you know you've reached the end of a linked list when a node's next property is null.)", "
    ", "Write an add method that assigns the first node you push to the linked list to the head; after that, whenever adding a node, every node should be referenced by the previous node's next property.", @@ -2826,4 +2826,4 @@ "translations": {} } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json index a5171fcae0..62aa1a7fca 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json @@ -15,7 +15,9 @@ "assert.strictEqual(multiplesOf3and5(19564), 89301183, 'message: multiplesOf3and5(19564) should return 89301183.');", "assert.strictEqual(multiplesOf3and5(8456), 16687353, 'message: Your function is not returning the correct result using our tests values.');" ], - "solutions": ["const multiplesOf3and5 = (number) => {\n var total = 0;\n\n for(var i = 0; i < number; i++) {\n if(i % 3 == 0 || i % 5 == 0) {\n total += i;\n }\n }\n return total;\n};"], + "solutions": [ + "const multiplesOf3and5 = (number) => {\n var total = 0;\n\n for(var i = 0; i < number; i++) {\n if(i % 3 == 0 || i % 5 == 0) {\n total += i;\n }\n }\n return total;\n};" + ], "translations": {}, "challengeSeed": [ "function multiplesOf3and5(number) {", @@ -42,7 +44,9 @@ "assert.strictEqual(fiboEvenSum(18), 3382, 'message: Your function is not returning the correct result using our tests values.');", "assert.equal(fiboEvenSum(31) % 2 === 0, true, 'message: Your function should return an even value.');" ], - "solutions": ["const fiboEvenSum = (number) => {\n let temp, sum = 0, a = 0, b = 1;\n while (number >= 0) {\n temp = a;\n a = b;\n b += temp;\n number --;\n if ((b % 2) === 0) {\n sum += b;\n }\n }\n\n return sum;\n}"], + "solutions": [ + "const fiboEvenSum = (number) => {\n let temp, sum = 0, a = 0, b = 1;\n while (number >= 0) {\n temp = a;\n a = b;\n b += temp;\n number --;\n if ((b % 2) === 0) {\n sum += b;\n }\n }\n\n return sum;\n}" + ], "translations": {}, "challengeSeed": [ "function fiboEvenSum(number) {", @@ -124,7 +128,9 @@ "assert.strictEqual(smallestMult(10), 2520, 'message: smallestMult(10) should return 2520.');", "assert.strictEqual(smallestMult(20), 232792560, 'message: smallestMult(20) should return 232792560.');" ], - "solutions": ["function smallestMult(n){\n function gcd(a, b) {\n return b === 0 ? a : gcd(b, a%b); // Euclidean algorithm\n }\n\n function lcm(a, b) {\n return a * b / gcd(a, b);\n }\n var result = 1;\n for(var i = 2; i <= n; i++) {\n result = lcm(result, i);\n }\n return result;\n}"], + "solutions": [ + "function smallestMult(n){\n function gcd(a, b) {\n return b === 0 ? a : gcd(b, a%b); // Euclidean algorithm\n }\n\n function lcm(a, b) {\n return a * b / gcd(a, b);\n }\n var result = 1;\n for(var i = 2; i <= n; i++) {\n result = lcm(result, i);\n }\n return result;\n}" + ], "translations": {}, "challengeSeed": [ "function smallestMult(n) {", @@ -263,8 +269,10 @@ "translations": {}, "challengeSeed": [ "function specialPythagoreanTriplet(n) {", - " let sumOfabc = n;", " // Good luck!", - " return true;", "}", + " let sumOfabc = n;", + " // Good luck!", + " return true;", + "}", "", "specialPythagoreanTriplet(1000);" ], @@ -286,7 +294,9 @@ "assert.strictEqual(primeSummation(140759), 873608362, 'message: primeSummation(140759) should return 873608362.');", "assert.strictEqual(primeSummation(2000000), 142913828922, 'message: primeSummation(2000000) should return 142913828922.');" ], - "solutions": ["//noprotect\nfunction primeSummation(n) {\n // Initialise an array containing only prime numbers\n let primes = [2];\n let result = 2;\n\n function isPrime(y, primes) {\n // Find sqrt(y)\n const sqrt = Math.floor(Math.sqrt(y));\n\n // Divide y by each applicable prime, return false if any of them divide y\n for (let i = 0; i < primes.length && primes[i] <= sqrt; i++) {\n if (y % primes[i] === 0) {\n return false;\n }\n }\n\n // At this point x must be prime\n return true;\n }\n\n // For every odd integer, add it to the array if it is prime\n for (let x = 3; x < n; x += 2) {\n if (isPrime(x, primes)) {\n if (x > n) {\n return result;\n } else {\n result += x;\n primes.push(x);\n }\n }\n }\n\n return result;\n}"], + "solutions": [ + "//noprotect\nfunction primeSummation(n) {\n // Initialise an array containing only prime numbers\n let primes = [2];\n let result = 2;\n\n function isPrime(y, primes) {\n // Find sqrt(y)\n const sqrt = Math.floor(Math.sqrt(y));\n\n // Divide y by each applicable prime, return false if any of them divide y\n for (let i = 0; i < primes.length && primes[i] <= sqrt; i++) {\n if (y % primes[i] === 0) {\n return false;\n }\n }\n\n // At this point x must be prime\n return true;\n }\n\n // For every odd integer, add it to the array if it is prime\n for (let x = 3; x < n; x += 2) {\n if (isPrime(x, primes)) {\n if (x > n) {\n return result;\n } else {\n result += x;\n primes.push(x);\n }\n }\n }\n\n return result;\n}" + ], "translations": {}, "challengeSeed": [ "function primeSummation(n) {", @@ -310,7 +320,9 @@ "assert.strictEqual(largestGridProduct(grid), 70600674, 'message: largestGridProduct(grid) should return 70600674.');", "assert.strictEqual(largestGridProduct(testGrid), 14169081, 'message: largestGridProduct(testGrid) should return 14169081.');" ], - "solutions": ["function largestGridProduct(arr) {\n let maxProduct = 0;\n let currProduct = 0;\n\n function maxProductChecker(n) {\n if (n > maxProduct) {\n return maxProduct = n;\n }\n }\n\n // loop rows\n for (let r = 0; r < arr.length; r++) {\n // loop columns\n for (let c = 0; c < arr[r].length; c++) {\n const limit = arr[r].length - 3;\n\n // check horizontal\n if (c < limit) {\n currProduct = arr[r][c] * arr[r][c + 1] * arr[r][c + 2] * arr[r][c + 3];\n maxProductChecker(currProduct);\n }\n\n // check vertical\n if (r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c] * arr[r + 2][c] * arr[r + 3][c];\n maxProductChecker(currProduct);\n }\n\n // check diagonal [\\]\n if (c < limit && r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c + 1] * arr[r + 2][c + 2] * arr[r + 3][c + 3];\n maxProductChecker(currProduct);\n }\n\n // check diagonal [/]\n if (c > 3 && r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c - 1] * arr[r + 2][c - 2] * arr[r + 3][c - 3];\n maxProductChecker(currProduct);\n }\n }\n }\n\n return maxProduct;\n}\n\n const grid = [ [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],\n [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],\n [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],\n [52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],\n [22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],\n [24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],\n [32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],\n [67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],\n [24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],\n [21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],\n [78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],\n [16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],\n [86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],\n [19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],\n [4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],\n [88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],\n [4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],\n [20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],\n [20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],\n [1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]\n];\n\nconst testGrid = [\n [40, 17, 81, 18, 57],\n [74, 4, 36, 16, 29],\n [36, 42, 69, 73, 45],\n [51, 54, 69, 16, 92],\n [7, 97, 57, 32, 16]\n];"], + "solutions": [ + "function largestGridProduct(arr) {\n let maxProduct = 0;\n let currProduct = 0;\n\n function maxProductChecker(n) {\n if (n > maxProduct) {\n return maxProduct = n;\n }\n }\n\n // loop rows\n for (let r = 0; r < arr.length; r++) {\n // loop columns\n for (let c = 0; c < arr[r].length; c++) {\n const limit = arr[r].length - 3;\n\n // check horizontal\n if (c < limit) {\n currProduct = arr[r][c] * arr[r][c + 1] * arr[r][c + 2] * arr[r][c + 3];\n maxProductChecker(currProduct);\n }\n\n // check vertical\n if (r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c] * arr[r + 2][c] * arr[r + 3][c];\n maxProductChecker(currProduct);\n }\n\n // check diagonal [\\]\n if (c < limit && r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c + 1] * arr[r + 2][c + 2] * arr[r + 3][c + 3];\n maxProductChecker(currProduct);\n }\n\n // check diagonal [/]\n if (c > 3 && r < limit) {\n currProduct = arr[r][c] * arr[r + 1][c - 1] * arr[r + 2][c - 2] * arr[r + 3][c - 3];\n maxProductChecker(currProduct);\n }\n }\n }\n\n return maxProduct;\n}\n\n const grid = [ [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],\n [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],\n [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],\n [52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],\n [22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],\n [24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],\n [32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],\n [67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],\n [24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],\n [21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],\n [78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],\n [16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],\n [86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],\n [19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],\n [4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],\n [88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],\n [4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],\n [20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],\n [20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],\n [1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]\n];\n\nconst testGrid = [\n [40, 17, 81, 18, 57],\n [74, 4, 36, 16, 29],\n [36, 42, 69, 73, 45],\n [51, 54, 69, 16, 92],\n [7, 97, 57, 32, 16]\n];" + ], "translations": {}, "challengeSeed": [ "function largestGridProduct(arr) {", @@ -320,34 +332,34 @@ "", "// Only change code above this line", "const grid = [", - " [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],", - " [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],", - " [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],", - " [52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],", - " [22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],", - " [24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],", - " [32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],", - " [67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],", - " [24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],", - " [21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],", - " [78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],", - " [16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],", - " [86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],", - " [19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],", - " [4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],", - " [88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],", - " [4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],", - " [20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],", - " [20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],", - " [1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]", + " [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],", + " [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],", + " [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],", + " [52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],", + " [22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],", + " [24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],", + " [32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],", + " [67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],", + " [24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],", + " [21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],", + " [78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],", + " [16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],", + " [86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],", + " [19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],", + " [4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],", + " [88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],", + " [4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],", + " [20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],", + " [20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],", + " [1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]", "];", "", "const testGrid = [", - " [40, 17, 81, 18, 57],", - " [74, 4, 36, 16, 29],", - " [36, 42, 69, 73, 45],", - " [51, 54, 69, 16, 92],", - " [7, 97, 57, 32, 16]", + " [40, 17, 81, 18, 57],", + " [74, 4, 36, 16, 29],", + " [36, 42, 69, 73, 45],", + " [51, 54, 69, 16, 92],", + " [7, 97, 57, 32, 16]", "];", "", "largestGridProduct(testGrid);" @@ -389,7 +401,9 @@ "assert.strictEqual(divisibleTriangleNumber(23), 630, 'message: divisibleTriangleNumber(23) should return 630.');", "assert.strictEqual(divisibleTriangleNumber(500), 76576500, 'message: divisibleTriangleNumber() should return 76576500.');" ], - "solutions": ["function divisibleTriangleNumber(n) {\n let counter = 1;\n let triangleNumber = counter++;\n\n function getFactors(num) {\n let factors = [];\n\n let possibleFactor = 1;\n let sqrt = Math.sqrt(num);\n\n while (possibleFactor <= sqrt) {\n if (num % possibleFactor == 0) {\n factors.push(possibleFactor);\n var otherPossibleFactor = num / possibleFactor;\n if (otherPossibleFactor > possibleFactor) {\n factors.push(otherPossibleFactor);\n }\n }\n possibleFactor++;\n }\n\n return factors;\n }\n\n while (getFactors(triangleNumber).length < n) {\n triangleNumber += counter++;\n }\n console.log(triangleNumber)\n return triangleNumber;\n}"], + "solutions": [ + "function divisibleTriangleNumber(n) {\n let counter = 1;\n let triangleNumber = counter++;\n\n function getFactors(num) {\n let factors = [];\n\n let possibleFactor = 1;\n let sqrt = Math.sqrt(num);\n\n while (possibleFactor <= sqrt) {\n if (num % possibleFactor == 0) {\n factors.push(possibleFactor);\n var otherPossibleFactor = num / possibleFactor;\n if (otherPossibleFactor > possibleFactor) {\n factors.push(otherPossibleFactor);\n }\n }\n possibleFactor++;\n }\n\n return factors;\n }\n\n while (getFactors(triangleNumber).length < n) {\n triangleNumber += counter++;\n }\n console.log(triangleNumber)\n return triangleNumber;\n}" + ], "translations": {}, "challengeSeed": [ "function divisibleTriangleNumber(n) {", @@ -423,7 +437,9 @@ "assert.strictEqual(largeSum(testNums), 8348422521, 'message: largeSum(testNums) should return 8348422521.');", "assert.strictEqual(largeSum(fiftyDigitNums), 5537376230, 'message: largeSum(fiftyDigitNums) should return 5537376230.');" ], - "solutions": ["function largeSum(arr) {\n\n let sum = 0;\n\n arr.forEach(function(num) {\n sum += parseInt(num, 10);\n });\n\n sum = sum.toString(10);\n\n sum = sum.substr(0, 1) + sum.substr(2);\n\n let firstTen = sum.slice(0, 10);\n return parseInt(firstTen, 10);\n}"], + "solutions": [ + "function largeSum(arr) {\n\n let sum = 0;\n\n arr.forEach(function(num) {\n sum += parseInt(num, 10);\n });\n\n sum = sum.toString(10);\n\n sum = sum.substr(0, 1) + sum.substr(2);\n\n let firstTen = sum.slice(0, 10);\n return parseInt(firstTen, 10);\n}" + ], "translations": {}, "head": [ "const fiftyDigitNums = [", @@ -664,7 +680,9 @@ "assert.strictEqual(longestCollatzSequence(5847), 3711, 'message: longestCollatzSequence(5847) should return 3711.');", "assert.strictEqual(longestCollatzSequence(1000000), 837799, 'message: longestCollatzSequence(1000000) should return 837799.');" ], - "solutions": ["function longestCollatzSequence(limit) {\n let longestSequenceLength = 0;\n let startingNum = 0;\n\n function sequenceLength(num) {\n let length = 1;\n\n while (num >= 1) {\n if (num === 1) { break;\n } else if (num % 2 === 0) {\n num = num / 2;\n length++;\n } else {\n num = num * 3 + 1;\n length++;\n }\n }\n return length;\n }\n\n for (let i = 2; i < limit; i++) {\n let currSequenceLength = sequenceLength(i);\n if (currSequenceLength > longestSequenceLength) {\n longestSequenceLength = currSequenceLength;\n startingNum = i;\n }\n }\n return startingNum;\n}"], + "solutions": [ + "function longestCollatzSequence(limit) {\n let longestSequenceLength = 0;\n let startingNum = 0;\n\n function sequenceLength(num) {\n let length = 1;\n\n while (num >= 1) {\n if (num === 1) { break;\n } else if (num % 2 === 0) {\n num = num / 2;\n length++;\n } else {\n num = num * 3 + 1;\n length++;\n }\n }\n return length;\n }\n\n for (let i = 2; i < limit; i++) {\n let currSequenceLength = sequenceLength(i);\n if (currSequenceLength > longestSequenceLength) {\n longestSequenceLength = currSequenceLength;\n startingNum = i;\n }\n }\n return startingNum;\n}" + ], "translations": {}, "challengeSeed": [ "function longestCollatzSequence(limit) {", @@ -694,7 +712,9 @@ "assert.strictEqual(latticePaths(9), 48620, 'message: latticePaths(9) should return 48620.');", "assert.strictEqual(latticePaths(20), 137846528820, 'message: latticePaths(20) should return 137846528820.');" ], - "solutions": ["function latticePaths(gridSize) {\n let paths = 1;\n\n for (let i = 0; i < gridSize; i++) {\n paths *= (2 * gridSize) - i;\n paths /= i + 1;\n }\n return paths;\n}"], + "solutions": [ + "function latticePaths(gridSize) {\n let paths = 1;\n\n for (let i = 0; i < gridSize; i++) {\n paths *= (2 * gridSize) - i;\n paths /= i + 1;\n }\n return paths;\n}" + ], "translations": {}, "challengeSeed": [ "function latticePaths(gridSize) {", @@ -722,7 +742,9 @@ "assert.strictEqual(powerDigitSum(128), 166, 'message: powerDigitSum(128) should return 166.');", "assert.strictEqual(powerDigitSum(1000), 1366, 'message: powerDigitSum(1000) should return 1366.');" ], - "solutions": ["function powerDigitSum(exponent) {\n const bigNum = [1];\n let sum = 0;\n\n for (let i = 1; i <= exponent; i++) {\n let count = bigNum.length + 1;\n let overflow = 0;\n for (let j = 0; j < count; j++) {\n let digit = bigNum[j] || 0;\n digit = 2 * digit + overflow;\n\n if (digit > 9) {\n digit -= 10;\n overflow = 1;\n } else {\n overflow = 0;\n }\n\n bigNum[j] = digit;\n }\n }\n\n bigNum.forEach(function(num) {\n return sum += num;\n });\n\n return sum;\n}"], + "solutions": [ + "function powerDigitSum(exponent) {\n const bigNum = [1];\n let sum = 0;\n\n for (let i = 1; i <= exponent; i++) {\n let count = bigNum.length + 1;\n let overflow = 0;\n for (let j = 0; j < count; j++) {\n let digit = bigNum[j] || 0;\n digit = 2 * digit + overflow;\n\n if (digit > 9) {\n digit -= 10;\n overflow = 1;\n } else {\n overflow = 0;\n }\n\n bigNum[j] = digit;\n }\n }\n\n bigNum.forEach(function(num) {\n return sum += num;\n });\n\n return sum;\n}" + ], "translations": {}, "challengeSeed": [ "function powerDigitSum(exponent) {", @@ -747,7 +769,9 @@ "assert.strictEqual(numberLetterCounts(150), 1903, 'message: numberLetterCounts(150) should return 1903.');", "assert.strictEqual(numberLetterCounts(1000), 21124, 'message: numberLetterCounts(1000) should return 21124.');" ], - "solutions": ["function numberLetterCounts(limit) {\n const dictionary = {\n 0: '',\n 1: 'one',\n 2: 'two',\n 3: 'three',\n 4: 'four',\n 5: 'five',\n 6: 'six',\n 7: 'seven',\n 8: 'eight',\n 9: 'nine',\n 10: 'ten',\n 11: 'eleven',\n 12: 'twelve',\n 13: 'thirteen',\n 14: 'fourteen',\n 15: 'fifteen',\n 16: 'sixteen',\n 17: 'seventeen',\n 18: 'eighteen',\n 19: 'nineteen',\n 20: 'twenty',\n 30: 'thirty',\n 40: 'forty',\n 50: 'fifty',\n 60: 'sixty',\n 70: 'seventy',\n 80: 'eighty',\n 90: 'ninety',\n 1000: 'onethousand'\n };\n\n let numString = '';\n\n function convertToString(num) {\n // check dictionary for number\n if (dictionary[num]) {\n return dictionary[num];\n } else {\n const hundreds = Math.floor(num / 100);\n const tens = Math.floor((num / 10) % 10) * 10;\n const remainder = num % 10;\n\n let tempStr = '';\n\n if (hundreds === 0) {\n tempStr += dictionary[tens] + dictionary[remainder];\n } else {\n tempStr += dictionary[hundreds] + 'hundred';\n\n if (tens !== 0 || remainder !== 0) {\n tempStr += 'and';\n }\n\n if (tens < 20) {\n const lessThanTwenty = tens + remainder;\n tempStr += dictionary[lessThanTwenty];\n } else {\n tempStr += dictionary[tens] + dictionary[remainder];\n }\n }\n // console.log(num, hundreds, tens, remainder);\n return tempStr;\n }\n }\n\n for (let i = 1; i <= limit; i++) {\n numString += convertToString(i);\n }\n return numString.length;\n}"], + "solutions": [ + "function numberLetterCounts(limit) {\n const dictionary = {\n 0: '',\n 1: 'one',\n 2: 'two',\n 3: 'three',\n 4: 'four',\n 5: 'five',\n 6: 'six',\n 7: 'seven',\n 8: 'eight',\n 9: 'nine',\n 10: 'ten',\n 11: 'eleven',\n 12: 'twelve',\n 13: 'thirteen',\n 14: 'fourteen',\n 15: 'fifteen',\n 16: 'sixteen',\n 17: 'seventeen',\n 18: 'eighteen',\n 19: 'nineteen',\n 20: 'twenty',\n 30: 'thirty',\n 40: 'forty',\n 50: 'fifty',\n 60: 'sixty',\n 70: 'seventy',\n 80: 'eighty',\n 90: 'ninety',\n 1000: 'onethousand'\n };\n\n let numString = '';\n\n function convertToString(num) {\n // check dictionary for number\n if (dictionary[num]) {\n return dictionary[num];\n } else {\n const hundreds = Math.floor(num / 100);\n const tens = Math.floor((num / 10) % 10) * 10;\n const remainder = num % 10;\n\n let tempStr = '';\n\n if (hundreds === 0) {\n tempStr += dictionary[tens] + dictionary[remainder];\n } else {\n tempStr += dictionary[hundreds] + 'hundred';\n\n if (tens !== 0 || remainder !== 0) {\n tempStr += 'and';\n }\n\n if (tens < 20) {\n const lessThanTwenty = tens + remainder;\n tempStr += dictionary[lessThanTwenty];\n } else {\n tempStr += dictionary[tens] + dictionary[remainder];\n }\n }\n // console.log(num, hundreds, tens, remainder);\n return tempStr;\n }\n }\n\n for (let i = 1; i <= limit; i++) {\n numString += convertToString(i);\n }\n return numString.length;\n}" + ], "translations": {}, "challengeSeed": [ "function numberLetterCounts(limit) {", @@ -772,7 +796,9 @@ "assert.strictEqual(maximumPathSumI(testTriangle), 23, 'message: maximumPathSumI(testTriangle) should return 23.');", "assert.strictEqual(maximumPathSumI(numTriangle), 1074, 'message: maximumPathSumI(numTriangle) should return 1074.');" ], - "solutions": ["const testTriangle = [[3, 0, 0, 0],\n [7, 4, 0, 0],\n [2, 4, 6, 0],\n [8, 5, 9, 3]];\n\nfunction maximumPathSumI(triangle) {\n let maxSum = triangle.slice();\n\n for (let i = triangle.length - 1; i > 0; i--) {\n let currentRow = maxSum[i];\n let previousRow = maxSum[i - 1];\n const temp = [];\n for (let j = 0; j < i; j++) {\n temp.push(Math.max((currentRow[j] + previousRow[j]), (currentRow[j + 1] + previousRow[j])));\n }\n maxSum[i - 1] = temp;\n maxSum.pop();\n }\n return maxSum[0][0];\n}"], + "solutions": [ + "const testTriangle = [[3, 0, 0, 0],\n [7, 4, 0, 0],\n [2, 4, 6, 0],\n [8, 5, 9, 3]];\n\nfunction maximumPathSumI(triangle) {\n let maxSum = triangle.slice();\n\n for (let i = triangle.length - 1; i > 0; i--) {\n let currentRow = maxSum[i];\n let previousRow = maxSum[i - 1];\n const temp = [];\n for (let j = 0; j < i; j++) {\n temp.push(Math.max((currentRow[j] + previousRow[j]), (currentRow[j + 1] + previousRow[j])));\n }\n maxSum[i - 1] = temp;\n maxSum.pop();\n }\n return maxSum[0][0];\n}" + ], "translations": {}, "head": [ "const numTriangle = [[75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [95, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [17, 47, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [18, 35, 87, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [20, 4, 82, 47, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [19, 1, 23, 75, 3, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0], [88, 2, 77, 73, 7, 63, 67, 0, 0, 0, 0, 0, 0, 0, 0], [99, 65, 4, 28, 6, 16, 70, 92, 0, 0, 0, 0, 0, 0, 0], [41, 41, 26, 56, 83, 40, 80, 70, 33, 0, 0, 0, 0, 0, 0], [41, 48, 72, 33, 47, 32, 37, 16, 94, 29, 0, 0, 0, 0, 0], [53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14, 0, 0, 0, 0], [70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57, 0, 0, 0], [91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48, 0, 0], [63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31, 0], [4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23]];" @@ -809,7 +835,9 @@ "assert.strictEqual(countingSundays(1995, 2000), 9, 'message: countingSundays(1995, 2000) should return 9.');", "assert.strictEqual(countingSundays(1901, 2000), 171, 'message: countingSundays(1901, 2000) should return 171.');" ], - "solutions": ["function countingSundays(firstYear, lastYear) {\n let sundays = 0;\n\n for (let year = firstYear; year <= lastYear; year++) {\n for (let month = 1; month <= 12; month++) {\n const thisDate = new Date(year, month, 1);\n if (thisDate.getDay() === 0) {\n sundays++;\n }\n }\n }\n return sundays;\n}"], + "solutions": [ + "function countingSundays(firstYear, lastYear) {\n let sundays = 0;\n\n for (let year = firstYear; year <= lastYear; year++) {\n for (let month = 1; month <= 12; month++) {\n const thisDate = new Date(year, month, 1);\n if (thisDate.getDay() === 0) {\n sundays++;\n }\n }\n }\n return sundays;\n}" + ], "translations": {}, "challengeSeed": [ "function countingSundays(firstYear, lastYear) {", @@ -866,10 +894,10 @@ "type": "bonfire", "title": "Problem 21: Amicable numbers", "tests": [ - "assert.strictEqual(sumAmicableNum(1000), 504, 'message: \u003ccode\u003esumAmicableNum(1000)\u003c/code\u003e should return 504.');", - "assert.strictEqual(sumAmicableNum(2000), 2898, 'message: \u003ccode\u003esumAmicableNum(2000)\u003c/code\u003e should return 2898.');", - "assert.strictEqual(sumAmicableNum(5000), 8442, 'message: \u003ccode\u003esumAmicableNum(5000)\u003c/code\u003e should return 8442.');", - "assert.strictEqual(sumAmicableNum(10000), 31626, 'message: \u003ccode\u003esumAmicableNum(10000)\u003c/code\u003e should return 31626.');" + "assert.strictEqual(sumAmicableNum(1000), 504, 'message: sumAmicableNum(1000) should return 504.');", + "assert.strictEqual(sumAmicableNum(2000), 2898, 'message: sumAmicableNum(2000) should return 2898.');", + "assert.strictEqual(sumAmicableNum(5000), 8442, 'message: sumAmicableNum(5000) should return 8442.');", + "assert.strictEqual(sumAmicableNum(10000), 31626, 'message: sumAmicableNum(10000) should return 31626.');" ], "solutions": [], "translations": {}, @@ -1590,19 +1618,19 @@ "description": [ "Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:", "Triangle", - " ", + "", "Tn=n(n+1)/2", - " ", + "", "1, 3, 6, 10, 15, ...", "Pentagonal", - " ", + "", "Pn=n(3n−1)/2", - " ", + "", "1, 5, 12, 22, 35, ...", "Hexagonal", - " ", + "", "Hn=n(2n−1)", - " ", + "", "1, 6, 15, 28, 45, ...", "It can be verified that T285 = P165 = H143 = 40755.", "Find the next triangle number that is also pentagonal and hexagonal." @@ -2045,34 +2073,34 @@ "description": [ "Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:", "Triangle", - " ", + "", "P3,n=n(n+1)/2", - " ", + "", "1, 3, 6, 10, 15, ...", "Square", - " ", + "", "P4,n=n2", - " ", + "", "1, 4, 9, 16, 25, ...", "Pentagonal", - " ", + "", "P5,n=n(3n−1)/2", - " ", + "", "1, 5, 12, 22, 35, ...", "Hexagonal", - " ", + "", "P6,n=n(2n−1)", - " ", + "", "1, 6, 15, 28, 45, ...", "Heptagonal", - " ", + "", "P7,n=n(5n−3)/2", - " ", + "", "1, 7, 18, 34, 55, ...", "Octagonal", - " ", + "", "P8,n=n(3n−2)", - " ", + "", "1, 8, 21, 40, 65, ...", "The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.", "The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with the first).", @@ -2150,16 +2178,16 @@ "", "√N = a0 +", "1", - " ", + "", "a1 +", "1", - " ", - " ", + "", + "", "a2 +", "1", - " ", - " ", - " ", + "", + "", + "", "a3 + ...", "", "For example, let us consider √23:", @@ -2168,9 +2196,9 @@ "1", " = 4 + ", "1", - " ", + "", "1√23—4", - " ", + "", "1 + ", "√23 – 37", "", @@ -2178,77 +2206,77 @@ "", "√23 = 4 +", "1", - " ", + "", "1 +", "1", - " ", - " ", + "", + "", "3 +", "1", - " ", - " ", - " ", + "", + "", + "", "1 +", "1", - " ", - " ", - " ", - " ", + "", + "", + "", + "", "8 + ...", "", "The process can be summarised as follows:", "", "a0 = 4,", - " ", + "", "1√23—4", " = ", "√23+47", " = 1 + ", "√23—37", "a1 = 1,", - " ", + "", "7√23—3", " = ", "7(√23+3)14", " = 3 + ", "√23—32", "a2 = 3,", - " ", + "", "2√23—3", " = ", "2(√23+3)14", " = 1 + ", "√23—47", "a3 = 1,", - " ", + "", "7√23—4", " = ", "7(√23+4)7", " = 8 + ", "√23—4", "a4 = 8,", - " ", + "", "1√23—4", " = ", "√23+47", " = 1 + ", "√23—37", "a5 = 1,", - " ", + "", "7√23—3", " = ", "7(√23+3)14", " = 3 + ", "√23—32", "a6 = 3,", - " ", + "", "2√23—3", " = ", "2(√23+3)14", " = 1 + ", "√23—47", "a7 = 1,", - " ", + "", "7√23—4", " = ", "7(√23+4)7", @@ -2295,22 +2323,22 @@ "", "√2 = 1 +", "1", - " ", + "", "2 +", "1", - " ", - " ", + "", + "", "2 +", "1", - " ", - " ", - " ", + "", + "", + "", "2 +", "1", - " ", - " ", - " ", - " ", + "", + "", + "", + "", "2 + ...", "", "The infinite continued fraction can be written, √2 = [1;(2)], (2) indicates that 2 repeats ad infinitum. In a similar way, √23 = [4;(1,3,1,8)].", @@ -2320,59 +2348,59 @@ "1 +", "1", "= 3/2", - " ", + "", "2", - " ", + "", "1 +", "1", "= 7/5", - " ", + "", "2 +", "1", - " ", - " ", + "", + "", "2", - " ", + "", "1 +", "1", "= 17/12", - " ", + "", "2 +", "1", - " ", - " ", - " ", + "", + "", + "", "2 +", "1", - " ", - " ", - " ", - " ", + "", + "", + "", + "", "2", - " ", + "", "1 +", "1", "= 41/29", - " ", + "", "2 +", "1", - " ", - " ", + "", + "", "2 +", "1", - " ", - " ", - " ", - " ", + "", + "", + "", + "", "2 +", "1", - " ", - " ", - " ", - " ", - " ", + "", + "", + "", + "", + "", "2", - " ", + "", "", "Hence the sequence of the first ten convergents for √2 are:", "1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, 577/408, 1393/985, 3363/2378, ...", @@ -2984,31 +3012,31 @@ "B3", "JAIL", "H2", - " ", + "", "C1", "T2", - " ", + "", "U1", "H1", - " ", + "", "C2", "CH3", - " ", + "", "C3", "R4", - " ", + "", "R2", "G3", - " ", + "", "D1", "CC3", - " ", + "", "CC2", "G2", - " ", + "", "D2", "G1", - " ", + "", "D3", "G2J", "F3", @@ -3752,9 +3780,7 @@ "", "euler108();" ], - "description": [ - "" - ] + "description": [] }, { "id": "5900f3db1000cf542c50feec", @@ -3785,20 +3811,20 @@ "There are exactly eleven distinct ways to checkout on a score of 6:", "", "D3", - " ", - " ", + "", + "", "D1", "D2", - " ", + "", "S2", "D2", - " ", + "", "D2", "D1", - " ", + "", "S4", "D1", - " ", + "", "S1", "S1", "D2", @@ -3842,9 +3868,7 @@ "", "euler110();" ], - "description": [ - "" - ] + "description": [] }, { "id": "5900f3db1000cf542c50feee", @@ -4093,7 +4117,7 @@ "", "", "", - " ", + "", "How many ways can a row measuring fifty units in length be filled?", "NOTE: Although the example above does not lend itself to the possibility, in general it is permitted to mix block sizes. For example, on a row measuring eight units in length you could use red (3), black (1), and red (4)." ] @@ -4187,7 +4211,7 @@ "", "", "", - " ", + "", "If green tiles are chosen there are three ways.", "", "", @@ -4205,7 +4229,7 @@ "", "", "", - " ", + "", "And if blue tiles are chosen there are two ways.", "", "", @@ -4319,7 +4343,7 @@ "", "", "", - " ", + "", "How many ways can a row measuring fifty units in length be tiled?", "NOTE: This is related to Problem 116." ] @@ -4497,7 +4521,7 @@ "The radical of n, rad(n), is the product of the distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.", "If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on rad(n), and sorting on n if the radical values are equal, we get:", "Unsorted", - " ", + "", "Sorted", "n", "rad(n)", @@ -4506,34 +4530,34 @@ "rad(n)", "k", "11", - " ", + "", "111", "22", - " ", + "", "222", "33", - " ", + "", "423", "42", - " ", + "", "824", "55", - " ", + "", "335", "66", - " ", + "", "936", "77", - " ", + "", "557", "82", - " ", + "", "668", "93", - " ", + "", "779", "1010", - " ", + "", "101010", "Let E(k) be the kth element in the sorted n column; for example, E(4) = 8 and E(6) = 9.", "If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000)." @@ -4880,10 +4904,10 @@ "Surprisingly AF(1/2)", " = ", "(1/2).1 + (1/2)2.1 + (1/2)3.2 + (1/2)4.3 + (1/2)5.5 + ...", - " ", + "", " = ", "1/2 + 1/4 + 2/8 + 3/16 + 5/32 + ...", - " ", + "", " = ", "2", "The corresponding values of x for the first five natural numbers are shown below.", @@ -5196,75 +5220,75 @@ ], "description": [ "We can easily verify that none of the entries in the first seven rows of Pascal's triangle are divisible by 7:", - " ", - " ", - " ", - " ", - " ", - " ", + "", + "", + "", + "", + "", + "", " 1", - " ", - " ", - " ", - " ", - " ", + "", + "", + "", + "", + "", " 1", - " ", + "", " 1", - " ", - " ", - " ", - " ", + "", + "", + "", + "", " 1", - " ", + "", " 2", - " ", + "", " 1", - " ", - " ", - " ", + "", + "", + "", " 1", - " ", + "", " 3", - " ", + "", " 3", - " ", + "", " 1", - " ", - " ", + "", + "", " 1", - " ", + "", " 4", - " ", + "", " 6", - " ", + "", " 4", - " ", + "", " 1", - " ", + "", " 1", - " ", + "", " 5", - " ", + "", "10", - " ", + "", "10", - " ", + "", " 5", - " ", + "", " 1", "1", - " ", + "", " 6", - " ", + "", "15", - " ", + "", "20", - " ", + "", "15", - " ", + "", " 6", - " ", + "", " 1", "However, if we check the first one hundred rows, we will find that only 2361 of the 5050 entries are not divisible by 7.", "", @@ -7018,7 +7042,7 @@ "Label the vertices A, B and C. There are 2 ways in which a laser beam may enter vertex C, bounce off 11 surfaces, then exit through the same vertex: one way is shown below; the other is the reverse of that.", "", "", - " ", + "", "", "There are 80840 ways in which a laser beam may enter vertex C, bounce off 1000001 surfaces, then exit through the same vertex.", "", @@ -7609,17 +7633,17 @@ "", "", " A = p · q · r    and  ", - " ", - " ", + "", + "", " 1A", " =", - " ", + "", " 1p", " +", - " ", + "", " 1q", " +", - " ", + "", " 1r", "For example, 630 is an Alexandrian integer (p = 5, q = −7, r = −18).", "In fact, 630 is the 6th Alexandrian integer, the first 6 Alexandrian integers being: 6, 42, 120, 156, 420 and 630.", @@ -7812,7 +7836,7 @@ "", " xk   =  ", " cos( 2k-1/n ×180° )", - " ", + "", " yk   =  ", " sin( 2k-1/n ×180° )", " Each Sn is to be interpreted as a filled shape consisting of all points on the perimeter and in the interior.", @@ -8149,7 +8173,7 @@ " sn+1", " =", " sn2 mod 20300713", - " ", + "", "", "Concatenate these numbers  s0s1s2… to create a string w of infinite length.", "Then, w = 14025256741014958470038053646…", @@ -8623,7 +8647,7 @@ " Tn", " = ", " ( Sn mod 2000 ) − 1000 ", - " ", + "", "", "", "i.e. (527, 144), (−488, 732), (−454, −947), …", @@ -9031,7 +9055,7 @@ "We shall call a number n such that :", "(n-9, n-3), (n-3,n+3), (n+3, n+9) form a triple-pair, and ", "the numbers n-8, n-4, n, n+4 and n+8 are all practical,", - " ", + "", "an engineers’ paradise.", "", "", @@ -11377,12 +11401,12 @@ "", "", "It can be shown that a(n) is of the form ", - " ", + "", " A(n) e + B(n)n!", " for integers A(n) and B(n). ", - " ", + "", "For example a(10) = ", - " ", + "", " 328161643 e − 65269448610!", " .", "", @@ -11529,47 +11553,47 @@ "", "You are given the following sequences:", " t0 = 123456.", - " ", + "", "", " ti = ", - " ", - " ", - " ", - " ", - " ", + "", + "", + "", + "", + "", " ti-12", - " ", + "", " ,", - " ", - " ", - " ", + "", + "", + "", " if ti-1 is even", - " ", - " ", - " ", + "", + "", + "", " ti-12", - " ", - " ", - " ", + "", + "", + "", " 926252, ", - " ", - " ", + "", + "", " if ti-1 is odd", - " ", - " ", "", - " ", - " ", + "", + "", + "", + "", " where ⌊x⌋ is the floor function", - " ", "", - " ", - " ", + "", + "", + "", " and is the bitwise XOR operator.", - " ", + "", "", " bi = ( ti mod 211) + 1.", - " ", + "", "The first two terms of the last sequence are b1 = 289 and b2 = 145.", "If we start with b1 and b2 beans in two adjacent bowls, 3419100 moves would be required to finish the game.", "", @@ -12058,7 +12082,7 @@ "22232 + 663", "18102 + 1253", "11972 + 1563", - " ", + "", "Find the sum of the five smallest such palindromic numbers." ] }, @@ -13048,7 +13072,7 @@ " Sn+1", " = ", " Sn2 mod 50515093", - " ", + "", "", "", "Let A(i, j) be the minimum of the numbers Si, Si+1, ... , Sj for i ≤ j.", @@ -14990,9 +15014,7 @@ "", "euler428();" ], - "description": [ - "" - ] + "description": [] }, { "id": "5900f5191000cf542c51002c", @@ -15084,7 +15106,7 @@ "Quick thinking Quentin explains that when granular materials are delivered from above a conical slope is formed and the natural angle made with the horizontal is called the angle of repose. For example if the angle of repose, $\\alpha = 30$ degrees, and grain is delivered at the centre of the silo then a perfect cone will form towards the top of the cylinder. In the case of this silo, which has a diameter of 6m, the amount of space wasted would be approximately 32.648388556 m3. However, if grain is delivered at a point on the top which has a horizontal distance of $x$ metres from the centre then a cone with a strangely curved and sloping base is formed. He shows Fred a picture.", "", "", - " ", + "", "", "We shall let the amount of space wasted in cubic metres be given by $V(x)$. If $x = 1.114785284$, which happens to have three squared decimal places, then the amount of space wasted, $V(1.114785284) \\approx 36$. Given the range of possible solutions to this problem there is exactly one other option: $V(2.511167869) \\approx 49$. It would be like knowing that the square is king of the silo, sitting in splendid glory on top of your grain.", "", @@ -15475,7 +15497,7 @@ "", " n4567891011121314151617181920...", " g(n)1314161718272829303132333451545560...", - " ", + "", "", "You are given that g(1 000) = 2524 and g(1 000 000) = 2624152.", "", @@ -15548,7 +15570,7 @@ "You are given that", "∑ R(c) for c=C(100 000,k), and 1 ≤ k ≤99 999 ≡628701600 (mod 1 000 000 007).", "(C(n,k) is the binomial coefficient).", - " ", + "", "Find ∑ R(c) for c=C(10 000 000,k), and 1 ≤k≤ 9 999 999.", "Give your answer modulo 1 000 000 007." ] @@ -15612,7 +15634,7 @@ "F(N)=∑R(n) for 2≤n≤N.", "F(107)≡638042271 (mod 1 000 000 007).", "", - " ", + "", "Find F(1014) (mod 1 000 000 007)." ] }, @@ -15670,7 +15692,7 @@ "", "Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick.", "If a=1 mm and b=1 mm, the amount of chocolate required is ", - " ", + "", " 283", " π mm3", "", @@ -19226,7 +19248,7 @@ "", "", "For example, the only fixed point of $M_{91}$ is $n = 91$. In other words, $F_{100,11,10}= \\{91\\}$.", - " ", + "", "", "Now, define $SF(m,k,s)$ as the sum of the elements in $F_{m,k,s}$ and let $S(p,m) = \\displaystyle \\sum_{1 \\leq s < k \\leq p}{SF(m,k,s)}$.", "", @@ -19737,7 +19759,7 @@ "", "", "", - " ", + "", "", "", "Some areas of the snowflake are overlaid repeatedly. In the above picture, blue represents the areas that are one layer thick, red two layers thick, yellow three layers thick, and so on. ", @@ -20702,7 +20724,7 @@ " $C$, $B$, $A$ ", " odd ", " $2/27$ ", - " ", + "", "Therefore, $p(3,160) = 4/15 + 4/27 = 56/135$.", "", "", @@ -20808,4 +20830,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/rosetta-code-problems.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/rosetta-code-problems.json index 721423cc19..8ab06e43ef 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/rosetta-code-problems.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/rosetta-code-problems.json @@ -2107,7 +2107,7 @@ "

    | style=\"text-align:center\"| ] || Jump back to the matching [ if the cell under the pointer is nonzero

    ", "

    |}

    ", "

    Any cell size is allowed, EOF (End-O-File) support is optional, as is whether you have bounded or unbounded memory.

    ", - " " + "" ], "challengeSeed": [ "function brain (prog) {", @@ -2947,7 +2947,6 @@ "title": "Sailors, coconuts and a monkey problem", "type": "Waypoint", "description": [ - " ", "

    ", " Five sailors are shipwrecked on an island and", " collect a large pile of coconuts during the day.", @@ -2972,40 +2971,40 @@ " it is found that the pile of coconuts divides equally amongst the sailors with", " no remainder. (Nothing for the monkey in the morning.)", "

    ", - " ", + "", " The task:", - " ", - " ", + "", + "", " Create a function that returns the", " the minimum possible size", " of the initial pile of coconuts collected during the day for N", " sailors.", - " ", - " ", + "", + "", " Note:", - " ", - " ", + "", + "", " Of course the tale is told in a", " world where the collection of any amount of coconuts in a day and multiple", " divisions of the pile, etc can occur in time fitting the story line, so as", " not to affect the mathematics.", - " ", - " ", - " ", + "", + "", + "", " C.f:", - " ", + "", " ", " Monkeys and Coconuts - Numberphile (Video) Analytical solution.", - " ", - " ", + "", + "", " A002021 Pile of coconuts problem The On-Line", " Encyclopedia of Integer Sequences. (Although some of its references may use", " the alternate form of the tale).", - " ", - " ", - " " + "", + "", + "" ], "challengeSeed": [ "// noprotect", @@ -3033,21 +3032,19 @@ "type": "Waypoint", "null": [], "description": [ - " ", - " ", " Task:", - " ", + "", "

    ", " For each number list of 6-digit ", " SEDOLs,", " calculate and append the checksum digit.", "

    ", - " ", + "", "

    ", " That is, given the input string on the left, your function should return the", " corresponding string on the right:", "

    ", - " ", + "", "
    ",
             "     710889 => 7108899",
             "     B0YBKJ => B0YBKJ7",
    @@ -3061,7 +3058,7 @@
             "     B0YBKT => B0YBKT7",
             "     B00030 => B000300",
             "    
    ", - " ", + "", "

    ", " Check also that each input is correctly formed, especially", " with respect to valid characters allowed in a SEDOL string. Your function", @@ -3334,9 +3331,9 @@ "Note: the above data would be un-orderable if, for example, dw04 is added to the list of dependencies of dw01.", "

    ", "C.f.:", - " ", + "", " Topological sort/Extracted top item.", - " ", + "", "

    There are two popular algorithms for topological sorting:

    ", "

    ", " Kahn's 1962 topological sort, and depth-first search:", @@ -3456,7 +3453,7 @@ "}" ], "solutions": [ - "\nconst collectDept = function (arrOfObj, groupName) {\n const collect = arrOfObj.reduce((rtnObj, obj) => {\n if (rtnObj[obj[groupName]] === undefined) {\n rtnObj[obj[groupName]] = [];\n }\n rtnObj[obj[groupName]].push(obj);\n return rtnObj;\n }, {} // initial value to reduce\n );\n\n return Object.keys(collect).sort().map(key => collect[key]);\n};\n\nconst sortRank = function (arrOfRankArrs, rankName) {\n return arrOfRankArrs.map(item => item.sort((a, b) => {\n if (a[rankName] > b[rankName]) { return -1; }\n if (a[rankName] < b[rankName]) { return 1; }\n return 0;\n }));\n};\n\nfunction topRankPerGroup(n, data, groupName, rankName) {\n if (n < 0) { return; }\n return sortRank(collectDept(data, groupName),\n rankName).map(list => list.slice(0, n));\n}\n" + "const collectDept = function (arrOfObj, groupName) {\n const collect = arrOfObj.reduce((rtnObj, obj) => {\n if (rtnObj[obj[groupName]] === undefined) {\n rtnObj[obj[groupName]] = [];\n }\n rtnObj[obj[groupName]].push(obj);\n return rtnObj;\n }, {} // initial value to reduce\n );\n\n return Object.keys(collect).sort().map(key => collect[key]);\n};\n\nconst sortRank = function (arrOfRankArrs, rankName) {\n return arrOfRankArrs.map(item => item.sort((a, b) => {\n if (a[rankName] > b[rankName]) { return -1; }\n if (a[rankName] < b[rankName]) { return 1; }\n return 0;\n }));\n};\n\nfunction topRankPerGroup(n, data, groupName, rankName) {\n if (n < 0) { return; }\n return sortRank(collectDept(data, groupName),\n rankName).map(list => list.slice(0, n));\n}\n" ], "tail": [ "const testData1 = [", @@ -3552,9 +3549,9 @@ "A vector is defined as having three dimensions as being represented by an ordered collection of three numbers:   (X, Y, Z).", "

    ", "Task:", - " ", + "", " Write a function that takes two vectors (arrays) as input and computes their cross product.", - " ", + "", "Your function should return null on", "invalid inputs (ie vectors of different lengths).", "

    " @@ -3591,9 +3588,9 @@ "

    ", "

    ", "Task:", - " ", + "", " Write a function that takes any numbers of vectors (arrays) as input and computes their dot product.", - " ", + "", "Your function should return null on", "invalid inputs (ie vectors of different lengths).", "

    " @@ -3646,9 +3643,9 @@ "", "

    ", "Task:", - " ", + "", " Write a function that can wrap this text to any number of characters.", - " ", + "", "As an example, the text wrapped to 80 characters should look like the following:", "

    ", "
    ",
    @@ -3711,10 +3708,10 @@
             "fixed-point combinators.",
             "

    ", "Task:", - " ", + "", " Define the stateless Y combinator function and use it to compute", " factorial.", - " ", + "", "factorial(N) function is already given to you.", "See also Jim Weirich: Adventures in Functional Programming." ], @@ -3836,7 +3833,7 @@ "
    ", "It produces the thinned output:", "
    ",
    -        "                                                           ",
    +        "",
             "    # ##########                       #######",
             "     ##        #                   ####       #",
             "     #          #                 ##",
    @@ -3851,7 +3848,7 @@
             "     #                            ##",
             "     #                             ############",
             "                       ###                          ###",
    -        "                                                           ",
    +        "",
             "                                                           
    ", "

    Algorithm

    ", "Assume black pixels are one and white pixels zero, and that the input image is a rectangular N by M array of ones and zeroes.", @@ -3862,12 +3859,12 @@ " P7P6P5", "", "Obviously the boundary pixels of the image cannot have the full eight neighbours.", - " ", + "", " Define $A(P1)$ = the number of transitions from white to black, (0 -> 1) in the sequence P2,P3,P4,P5,P6,P7,P8,P9,P2. (Note the extra P2 at the end - it is circular).", - " ", - " ", + "", + "", " Define $B(P1)$ = the number of black pixel neighbours of P1. ( = sum(P2 .. P9) )", - " ", + "", "

    Step 1:

    ", "All pixels are tested and pixels satisfying all the following conditions (simultaneously) are just noted at this stage.", " (0) The pixel is black and has eight neighbours", @@ -3920,7 +3917,6 @@ "function Point(x, y) {\n this.x = x;\n this.y = y;\n}\n\nconst ZhangSuen = (function () {\n function ZhangSuen() {\n }\n\n ZhangSuen.nbrs = [[0, -1], [1, -1], [1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1]];\n\n ZhangSuen.nbrGroups = [[[0, 2, 4], [2, 4, 6]], [[0, 2, 6], [0, 4, 6]]];\n\n ZhangSuen.toWhite = [];\n\n ZhangSuen.main = function (image) {\n ZhangSuen.grid = new Array(image);\n for (let r = 0; r < image.length; r++) {\n ZhangSuen.grid[r] = image[r].split('');\n }\n ZhangSuen.thinImage();\n return ZhangSuen.getResult();\n };\n\n ZhangSuen.thinImage = function () {\n let firstStep = false;\n let hasChanged;\n do {\n hasChanged = false;\n firstStep = !firstStep;\n for (let r = 1; r < ZhangSuen.grid.length - 1; r++) {\n for (let c = 1; c < ZhangSuen.grid[0].length - 1; c++) {\n if (ZhangSuen.grid[r][c] !== '#') {\n continue;\n }\n const nn = ZhangSuen.numNeighbors(r, c);\n if (nn < 2 || nn > 6) {\n continue;\n }\n if (ZhangSuen.numTransitions(r, c) !== 1) {\n continue;\n }\n if (!ZhangSuen.atLeastOneIsWhite(r, c, firstStep ? 0 : 1)) {\n continue;\n }\n ZhangSuen.toWhite.push(new Point(c, r));\n hasChanged = true;\n }\n }\n for (let i = 0; i < ZhangSuen.toWhite.length; i++) {\n const p = ZhangSuen.toWhite[i];\n ZhangSuen.grid[p.y][p.x] = ' ';\n }\n ZhangSuen.toWhite = [];\n } while ((firstStep || hasChanged));\n };\n\n ZhangSuen.numNeighbors = function (r, c) {\n let count = 0;\n for (let i = 0; i < ZhangSuen.nbrs.length - 1; i++) {\n if (ZhangSuen.grid[r + ZhangSuen.nbrs[i][1]][c + ZhangSuen.nbrs[i][0]] === '#') {\n count++;\n }\n }\n return count;\n };\n\n ZhangSuen.numTransitions = function (r, c) {\n let count = 0;\n for (let i = 0; i < ZhangSuen.nbrs.length - 1; i++) {\n if (ZhangSuen.grid[r + ZhangSuen.nbrs[i][1]][c + ZhangSuen.nbrs[i][0]] === ' ') {\n if (ZhangSuen.grid[r + ZhangSuen.nbrs[i + 1][1]][c + ZhangSuen.nbrs[i + 1][0]] === '#') {\n count++;\n }\n }\n }\n return count;\n };\n\n ZhangSuen.atLeastOneIsWhite = function (r, c, step) {\n let count = 0;\n const group = ZhangSuen.nbrGroups[step];\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < group[i].length; j++) {\n const nbr = ZhangSuen.nbrs[group[i][j]];\n if (ZhangSuen.grid[r + nbr[1]][c + nbr[0]] === ' ') {\n count++;\n break;\n }\n }\n }\n return count > 1;\n };\n\n ZhangSuen.getResult = function () {\n const result = [];\n for (let i = 0; i < ZhangSuen.grid.length; i++) {\n const row = ZhangSuen.grid[i].join('');\n result.push(row);\n }\n return result;\n };\n return ZhangSuen;\n}());\n\nfunction thinImage(image) {\n return ZhangSuen.main(image);\n}\n" ], "tail": [ - "", "const imageForTests = [", " ' ',", " ' ################# ############# ',", @@ -4166,7 +4162,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "4-rings or 4-squares puzzle", @@ -4378,7 +4375,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "A+B", @@ -4484,7 +4482,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Active object", @@ -4572,7 +4571,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "AKS test for primes", @@ -4777,7 +4777,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Amb", @@ -4929,7 +4930,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Anagrams/Deranged anagrams", @@ -5101,7 +5103,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Anagrams", @@ -5191,7 +5194,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Arbitrary-precision integers (included)", @@ -5224,7 +5228,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Arithmetic/Complex", @@ -5324,7 +5329,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Arithmetic-geometric mean", @@ -5423,7 +5429,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Arithmetic/Rational", @@ -5462,7 +5469,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Averages/Simple moving average", @@ -5578,7 +5586,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Best shuffle", @@ -5690,7 +5699,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Bitwise operations", @@ -5733,7 +5743,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Brace expansion", @@ -6226,7 +6237,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Cartesian product of two or more lists", @@ -6503,7 +6515,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Casting out nines", @@ -6710,7 +6723,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Combinations with repetitions", @@ -6934,7 +6948,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Conway's Game of Life", @@ -7403,7 +7418,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Count in factors", @@ -7475,7 +7491,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Cumulative standard deviation", @@ -7566,7 +7583,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Currying", @@ -7799,7 +7817,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "CUSIP", @@ -7857,7 +7876,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Cut a rectangle", @@ -7884,7 +7904,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Deconvolution/2D+", @@ -7974,7 +7995,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Delegates", @@ -8036,7 +8058,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Determine if a string is numeric", @@ -8078,7 +8101,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Digital root", @@ -8155,7 +8179,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Dinesman's multiple-dwelling problem", @@ -8331,7 +8356,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Distributed programming", @@ -8390,7 +8416,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "DNS query", @@ -8417,7 +8444,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Documentation", @@ -8447,7 +8475,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Dot product", @@ -8541,7 +8570,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Doubly-linked list/Definition", @@ -8574,7 +8604,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Doubly-linked list/Element definition", @@ -8634,7 +8665,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Doubly-linked list/Element insertion", @@ -8682,7 +8714,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Doubly-linked list/Traversal", @@ -8742,7 +8775,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Dragon curve", @@ -8994,7 +9028,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Draw a clock", @@ -9084,7 +9119,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Draw a cuboid", @@ -9114,7 +9150,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Draw a rotating cube", @@ -9144,7 +9181,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Draw a sphere", @@ -9243,7 +9281,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Dutch national flag problem", @@ -9277,7 +9316,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Dynamic variable names", @@ -9318,7 +9358,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Euler's sum of powers conjecture", @@ -9535,7 +9576,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Evolutionary algorithm", @@ -9822,7 +9864,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Execute HQ9+", @@ -9878,7 +9921,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Execute SNUSP", @@ -9910,7 +9954,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "FASTA format", @@ -9951,7 +9996,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Fast Fourier transform", @@ -10108,7 +10154,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Filter", @@ -10189,7 +10236,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Find common directory path", @@ -10222,7 +10270,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Find largest left truncatable prime in a given base", @@ -10250,7 +10299,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Find palindromic numbers in both binary and ternary bases", @@ -10418,7 +10468,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Find the last Sunday of each month", @@ -10650,7 +10701,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Find the missing permutation", @@ -10931,7 +10983,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "First class environments", @@ -10958,7 +11011,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "First-class functions", @@ -11045,7 +11099,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "First-class functions/Use numbers analogously", @@ -11082,7 +11137,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Five weekends", @@ -11421,7 +11477,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "FizzBuzz", @@ -11535,7 +11592,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Flatten a list", @@ -11652,7 +11710,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Floyd's triangle", @@ -12030,7 +12089,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Floyd-Warshall algorithm", @@ -12101,7 +12161,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Formal power series", @@ -12128,7 +12189,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Formatted numeric output", @@ -12168,7 +12230,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Forward difference", @@ -12294,7 +12357,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Four bit adder", @@ -12461,7 +12525,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Fractran", @@ -12549,7 +12614,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Gamma function", @@ -12605,7 +12671,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Gaussian elimination", @@ -12759,7 +12826,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "General FizzBuzz", @@ -12948,7 +13016,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Generate Chess960 starting position", @@ -13025,7 +13094,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Generate lower case ASCII alphabet", @@ -13186,7 +13256,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Generator/Exponential", @@ -13301,7 +13372,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Gray code", @@ -13333,7 +13405,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Greatest common divisor", @@ -13409,7 +13482,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Greatest subsequential sum", @@ -13468,7 +13542,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Guess the number/With feedback (player)", @@ -13588,7 +13663,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Hamming numbers", @@ -13826,7 +13902,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "IBAN", @@ -13898,7 +13975,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "I before E except after C", @@ -13939,7 +14017,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Identity matrix", @@ -14023,7 +14102,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Iterated digits squaring", @@ -14062,7 +14142,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Jaro distance", @@ -14103,7 +14184,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "JortSort", @@ -14149,7 +14231,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Josephus problem", @@ -14238,7 +14321,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Kaprekar numbers", @@ -14344,7 +14428,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "K-d tree", @@ -14383,7 +14468,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knapsack problem/0-1", @@ -14678,7 +14764,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knapsack problem/Bounded", @@ -14912,7 +14999,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knapsack problem/Continuous", @@ -14972,7 +15060,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knapsack problem/Unbounded", @@ -15108,7 +15197,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knight's tour", @@ -15144,7 +15234,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knuth's algorithm S", @@ -15184,7 +15275,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Knuth shuffle", @@ -15387,7 +15479,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Kronecker product based fractals", @@ -15552,7 +15645,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Kronecker product", @@ -15835,7 +15929,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Langton's ant", @@ -16105,7 +16200,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Largest int from concatenated ints", @@ -16189,7 +16285,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Last Friday of each month", @@ -16236,7 +16333,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Last letter-first letter", @@ -16283,7 +16381,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Leap year", @@ -16319,7 +16418,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Least common multiple", @@ -16405,7 +16505,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Left factorials", @@ -16455,7 +16556,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Letter frequency", @@ -16530,7 +16632,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Levenshtein distance", @@ -16685,7 +16788,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Linear congruential generator", @@ -16722,7 +16826,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "List comprehensions", @@ -16873,7 +16978,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Longest common subsequence", @@ -17049,7 +17155,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Longest increasing subsequence", @@ -17134,7 +17241,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Longest string challenge", @@ -17193,7 +17301,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Long multiplication", @@ -17366,7 +17475,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Look-and-say sequence", @@ -17450,7 +17560,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Loop over multiple arrays simultaneously", @@ -17613,7 +17724,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Loops/Do-while", @@ -17784,7 +17896,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Loops/Nested", @@ -17903,7 +18016,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Lucas-Lehmer test", @@ -17933,7 +18047,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "LU decomposition", @@ -18059,7 +18174,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ludic numbers", @@ -18199,7 +18315,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Luhn test of credit card numbers", @@ -18310,7 +18427,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Lychrel numbers", @@ -18370,7 +18488,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "LZW compression", @@ -18486,7 +18605,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Magic squares of doubly even order", @@ -18731,7 +18851,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Magic squares of odd order", @@ -19207,7 +19328,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Magic squares of singly even order", @@ -19241,7 +19363,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Main step of GOST 28147-89", @@ -19300,7 +19423,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Make directory path", @@ -19365,7 +19489,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Mandelbrot set", @@ -19504,7 +19629,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Man or boy test", @@ -19761,7 +19887,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Map range", @@ -19841,7 +19968,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Matrix arithmetic", @@ -19873,7 +20001,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Matrix-exponentiation operator", @@ -19953,7 +20082,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Matrix multiplication", @@ -20145,7 +20275,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Matrix transposition", @@ -20266,7 +20397,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Maximum triangle path sum", @@ -20323,7 +20455,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Maze solving", @@ -20503,7 +20636,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "MD4", @@ -20532,7 +20666,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "MD5/Implementation", @@ -20573,7 +20708,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "MD5", @@ -20603,7 +20739,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Median filter", @@ -20630,7 +20767,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Metaprogramming", @@ -20657,7 +20795,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Metered concurrency", @@ -20684,7 +20823,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Metronome", @@ -20712,7 +20852,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Middle three digits", @@ -20777,7 +20918,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Miller–Rabin primality test", @@ -20858,7 +21000,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Modular exponentiation", @@ -20887,7 +21030,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Modular inverse", @@ -20930,7 +21074,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Monte Carlo methods", @@ -21036,7 +21181,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Monty Hall problem", @@ -21183,7 +21329,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Morse code", @@ -21318,7 +21465,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Move-to-front algorithm", @@ -21471,7 +21619,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multifactorial", @@ -21570,7 +21719,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multiple distinct objects", @@ -21630,7 +21780,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multiple regression", @@ -21721,7 +21872,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multiplication tables", @@ -21910,7 +22062,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multiplicative order", @@ -21955,7 +22108,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Multisplit", @@ -22006,7 +22160,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Munching squares", @@ -22033,7 +22188,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Mutual recursion", @@ -22117,7 +22273,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Narcissistic decimal number", @@ -22349,7 +22506,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Narcissist", @@ -22410,7 +22568,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Natural sorting", @@ -22500,7 +22659,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Nautical bell", @@ -22529,7 +22689,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Non-continuous subsequences", @@ -22596,7 +22757,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Non-decimal radices/Convert", @@ -22805,7 +22967,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Non-decimal radices/Input", @@ -22888,7 +23051,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Non-decimal radices/Output", @@ -22968,7 +23132,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Nonoblock", @@ -23021,7 +23186,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Nonogram solver", @@ -23087,7 +23253,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "N-queens problem", @@ -23123,7 +23290,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "N'th", @@ -23235,7 +23403,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Nth root", @@ -23279,7 +23448,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Number names", @@ -23307,7 +23477,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Numerical integration/Gauss-Legendre Quadrature", @@ -23366,7 +23537,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Numerical integration", @@ -23414,7 +23586,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Numeric error propagation", @@ -23462,7 +23635,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Odd word problem", @@ -23506,7 +23680,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Old lady swallowed a fly", @@ -23536,7 +23711,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Optional parameters", @@ -23591,7 +23767,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Order disjoint list items", @@ -23807,7 +23984,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ordered Partitions", @@ -23930,7 +24108,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ordered words", @@ -24007,7 +24186,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Order two numerical lists", @@ -24068,7 +24248,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Palindrome detection", @@ -24149,7 +24330,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pangram checker", @@ -24223,7 +24405,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Paraffins", @@ -24292,7 +24475,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parallel Brute Force", @@ -24321,7 +24505,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parallel calculations", @@ -24428,7 +24613,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parse an IP Address", @@ -24475,7 +24661,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parsing/RPN calculator algorithm", @@ -24601,7 +24788,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parsing/RPN to infix conversion", @@ -24754,7 +24942,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Parsing/Shunting-yard algorithm", @@ -24885,7 +25074,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pascal matrix generation", @@ -24917,7 +25107,7 @@ "

    Write functions capable of generating each of the three forms of n-by-n matrices.

    Use those functions to display upper, lower, and symmetric Pascal 5-by-5 matrices on this page.

    The output should distinguish between different matrices and the rows of each matrix (no showing a list of 25 numbers assuming the reader should split it into rows).

    ", "Note: ", "

    The Cholesky decomposition of a Pascal symmetric matrix is the Pascal lower-triangle matrix of the same size.

    ", - " " + "" ], "challengeSeed": [ "function replaceMe (foo) {", @@ -25096,7 +25286,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pascal's triangle/Puzzle", @@ -25135,7 +25326,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pascal's triangle", @@ -25474,7 +25666,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pathological floating point problems", @@ -25542,7 +25735,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pattern matching", @@ -25569,7 +25763,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Penney's game", @@ -25610,7 +25805,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pentagram", @@ -25641,7 +25837,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Percolation/Bond percolation", @@ -25671,7 +25868,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Percolation/Mean cluster density", @@ -25706,7 +25904,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Percolation/Mean run density", @@ -25745,7 +25944,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Percolation/Site percolation", @@ -25775,7 +25975,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Perfect numbers", @@ -25978,7 +26179,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Perfect shuffle", @@ -26208,7 +26410,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Permutations by swapping", @@ -26243,7 +26446,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Permutations/Derangements", @@ -26280,7 +26484,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Permutations/Rank of a permutation", @@ -26341,7 +26546,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Permutations", @@ -26522,7 +26728,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Permutation test", @@ -26590,7 +26797,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pernicious numbers", @@ -26625,7 +26833,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Phrase reversals", @@ -26753,7 +26962,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Polynomial long division", @@ -26816,7 +27026,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Polynomial regression", @@ -26849,7 +27060,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Polyspiral", @@ -26896,7 +27108,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Population count", @@ -26932,7 +27145,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Power set", @@ -27057,7 +27271,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Price fraction", @@ -27127,7 +27342,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Primality by trial division", @@ -27183,7 +27399,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Prime decomposition", @@ -27383,7 +27600,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Primes - allocate descendants to their ancestors", @@ -27426,7 +27644,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Primorial numbers", @@ -27476,7 +27695,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Problem of Apollonius", @@ -27504,7 +27724,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pythagoras tree", @@ -27535,7 +27756,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Pythagorean triples", @@ -27622,7 +27844,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "QR decomposition", @@ -27665,7 +27888,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Quaternion type", @@ -27817,7 +28041,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Queue/Definition", @@ -27874,7 +28099,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Queue/Usage", @@ -27928,7 +28154,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Quickselect algorithm", @@ -27957,7 +28184,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Quine", @@ -28045,7 +28273,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Random number generator (device)", @@ -28073,7 +28302,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Random number generator (included)", @@ -28107,7 +28337,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Range expansion", @@ -28276,7 +28507,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Range extraction", @@ -28484,7 +28716,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ranking methods", @@ -28717,7 +28950,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rate counter", @@ -28766,7 +29000,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ray-casting algorithm", @@ -28837,7 +29072,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "RCRPG", @@ -28868,7 +29104,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Real constants and functions", @@ -28920,7 +29157,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Reduced row echelon form", @@ -29054,7 +29292,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Regular expressions", @@ -29110,7 +29349,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Remove duplicate elements", @@ -29261,7 +29501,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rendezvous", @@ -29296,7 +29537,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rep-string", @@ -29465,7 +29707,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Resistor mesh", @@ -29496,7 +29739,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Retrieve and search chat history", @@ -29529,7 +29773,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Reverse words in a string", @@ -29617,7 +29862,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "RIPEMD-160", @@ -29647,7 +29893,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Roman numerals/Decode", @@ -29903,7 +30150,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Roman numerals/Encode", @@ -30095,7 +30343,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Roots of a function", @@ -30163,7 +30412,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Roots of a quadratic function", @@ -30210,7 +30460,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Roots of unity", @@ -30270,7 +30521,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rosetta Code/Find bare lang tags", @@ -30299,7 +30551,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rosetta Code/Fix code tags", @@ -30353,7 +30606,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Rot-13", @@ -30462,7 +30716,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "RSA code", @@ -30502,7 +30757,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Runge-Kutta method", @@ -30602,7 +30858,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Run-length encoding", @@ -30664,7 +30921,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Safe addition", @@ -30693,7 +30951,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Same Fringe", @@ -30720,7 +30979,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Search a list of records", @@ -30880,7 +31140,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Search a list", @@ -31026,7 +31287,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Self-describing numbers", @@ -31100,7 +31362,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Self-referential sequence", @@ -31150,7 +31413,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Semiprime", @@ -31191,7 +31455,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Semordnilap", @@ -31199,10 +31464,10 @@ "description": [ "

    A semordnilap is a word (or phrase) that spells a different word (or phrase) backward.

    ", "

    \"Semordnilap\" is a word that itself is a semordnilap.

    Example: lager and regal

    ", - " ", + "", "Task", "

    Using only words from the unixdict, report the total number of unique semordnilap pairs, and print 5 examples. (Note that lager/regal and regal/lager should be counted as one unique pair.)

    ", - " ", + "", "Related tasks", "Palindrome detection" ], @@ -31320,7 +31585,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sequence of non-squares", @@ -31416,7 +31682,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sequence of primes by Trial Division", @@ -31454,7 +31721,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Set consolidation", @@ -31497,7 +31765,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Set of real numbers", @@ -31547,7 +31816,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Set puzzle", @@ -31586,7 +31856,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Set", @@ -31655,7 +31926,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Seven-sided dice from five-sided dice", @@ -31727,7 +31999,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "SHA-1", @@ -31761,7 +32034,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "SHA-256", @@ -31788,7 +32062,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Shell one-liner", @@ -31823,7 +32098,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Short-circuit evaluation", @@ -31897,7 +32173,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sieve of Eratosthenes", @@ -32121,7 +32398,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Singleton", @@ -32172,7 +32450,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Singly-linked list/Element definition", @@ -32233,7 +32512,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Singly-linked list/Element insertion", @@ -32277,7 +32557,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Singly-linked list/Traversal", @@ -32372,7 +32653,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Smith numbers", @@ -32521,7 +32803,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "SOAP", @@ -32548,7 +32831,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sokoban", @@ -32583,7 +32867,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Solve a Hidato puzzle", @@ -32630,7 +32915,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Solve a Holy Knight's tour", @@ -33151,7 +33437,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Solve a Hopido puzzle", @@ -33192,7 +33479,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Solve a Numbrix puzzle", @@ -33284,7 +33572,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Solve the no connection puzzle", @@ -33484,7 +33773,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort a list of object identifiers", @@ -33538,7 +33828,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort an array of composite structures", @@ -33771,7 +34062,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort an integer array", @@ -33813,7 +34105,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort disjoint sublist", @@ -33931,7 +34224,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Bead sort", @@ -33960,7 +34254,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Bogosort", @@ -34018,7 +34313,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Bubble sort", @@ -34104,7 +34400,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Cocktail sort", @@ -34197,7 +34494,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Comb sort", @@ -34312,7 +34610,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Counting sort", @@ -34392,7 +34691,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Gnome sort", @@ -34453,7 +34753,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Heapsort", @@ -34513,7 +34814,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Insertion sort", @@ -34572,7 +34874,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Merge sort", @@ -34670,7 +34973,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Pancake sort", @@ -34741,7 +35045,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Permutation sort", @@ -34773,7 +35078,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Quicksort", @@ -34987,7 +35293,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Radix sort", @@ -35015,7 +35322,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Selection sort", @@ -35069,7 +35377,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Shell sort", @@ -35121,7 +35430,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Sleep sort", @@ -35172,7 +35482,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Stooge sort", @@ -35241,7 +35552,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sorting algorithms/Strand sort", @@ -35269,7 +35581,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort stability", @@ -35332,7 +35645,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort three variables", @@ -35381,7 +35695,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sort using a custom comparator", @@ -35757,7 +36072,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Soundex", @@ -36068,7 +36384,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Spiral matrix", @@ -36315,7 +36632,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Split a character string based on change of character", @@ -36416,7 +36734,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stable marriage problem", @@ -36617,7 +36936,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stack", @@ -36696,7 +37016,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stair-climbing puzzle", @@ -36744,7 +37065,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "State name puzzle", @@ -36798,7 +37120,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stem-and-leaf plot", @@ -36913,7 +37236,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stern-Brocot sequence", @@ -36967,7 +37291,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Straddling checkerboard", @@ -37043,7 +37368,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Stream Merge", @@ -37075,7 +37401,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "String interpolation (included)", @@ -37119,7 +37446,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "String matching", @@ -37190,7 +37518,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Strip a set of characters from a string", @@ -37296,7 +37625,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Strip block comments", @@ -37347,7 +37677,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Strip comments from a string", @@ -37411,7 +37742,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Strip control codes and extended characters from a string", @@ -37464,7 +37796,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Subleq", @@ -37507,7 +37840,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Substring", @@ -37639,7 +37973,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Substring/Top and tail", @@ -37677,7 +38012,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sudoku", @@ -38043,7 +38379,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum and product of an array", @@ -38123,7 +38460,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum and Product Puzzle", @@ -38372,7 +38710,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum digits of an integer", @@ -38466,7 +38805,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum multiples of 3 and 5", @@ -38666,7 +39006,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum of a series", @@ -38766,7 +39107,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum of squares", @@ -38860,7 +39202,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sum to 100", @@ -39552,7 +39895,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Superellipse", @@ -39611,7 +39955,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Sutherland-Hodgman polygon clipping", @@ -39723,7 +40068,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Symmetric difference", @@ -39892,7 +40238,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Synchronous concurrency", @@ -39919,7 +40266,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Temperature conversion", @@ -40031,7 +40379,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ternary logic", @@ -40189,7 +40538,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "The Twelve Days of Christmas", @@ -40415,7 +40765,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Thue-Morse", @@ -40481,7 +40832,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Trabb Pardo–Knuth algorithm", @@ -40592,7 +40944,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Tree traversal", @@ -41052,7 +41405,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Truth table", @@ -41168,7 +41522,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Ulam spiral (for primes)", @@ -41262,7 +41617,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Universal Turing machine", @@ -41390,7 +41746,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Vector products", @@ -41527,7 +41884,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Verify distribution uniformity/Naive", @@ -41623,7 +41981,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Vigenère cipher", @@ -41686,7 +42045,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Water collected between towers", @@ -41925,7 +42285,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] }, { "title": "Wireworld", @@ -42094,7 +42455,8 @@ ], "betaTests": [ "assert(typeof replaceMe === 'function', 'message: replaceMe is a function.');" - ] + ], + "tests": [] } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/system-design-and-concept-questions.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/system-design-and-concept-questions.json index ddf523f207..94de3168b1 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/system-design-and-concept-questions.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/system-design-and-concept-questions.json @@ -262,124 +262,123 @@ "id": "5a91690fa9178457a6f12820", "title": "CSS questions part 1", "description": [ - { - "subtitle": "Elements properties", - "question": "Which properties do inline elements not possess under normal document flow.", - "choices": [ - "
    overflow, left or right margins
    ", - "
    border-radius, z-index
    ", - "
    font-size, animation
    ", - "
    width, top or bottom margins
    " - ], - "answer": 3, - "explanation": "An inline element will only take up the width of the inner content." - }, - { - "subtitle": "CSS rules", - "question": "What will the following css rule select?\n
    .test > div {\n...\n}
    " - , - "choices": [ - "
    Selects all divs within elements with the class of test.
    ", - "
    Selects all divs outside of elements with the class of test.
    ", - "
    Selects only divs that are immediate children of elements with the class of test.
    ", - "
    This would not be considered a valid selector.
    " - ], - "answer": 2, - "explanation": "eg: \n
    <div class='test'>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n</div>
    \n\nWould target only the elements with a class of 'box' as these are the direct children of 'test'." - }, - { - "subtitle": "Overriding properties", - "question": "Which keyword would you add to the end of a style rule to override another Css style for a specific element ?", - "choices": [ - "
    *override
    ", - "
    *overrideAll
    ", - "
    !vital
    ", - "
    !important
    " - ], - "answer": 3, - "explanation": "For example if you wanted all the paragraph tags in a specific class to have the colour blue instead of black\n
    .myClass p  {\ncolor: blue !important\n}
    " - }, - { - "subtitle": "Preprocessor CSS", - "question": "Which is not considered a Css preprocessor?", - "choices": [ - "
    Less
    ", - "
    Sass
    ", - "
    Stylus
    ", - "
    Express
    " - ], - "answer": 3, - "explanation": "Express is an application framework for Node.js" - }, - { - "subtitle": "CSS Box Model", - "question": "Which is not a property of the Css 'Box Model'?", - "choices": [ - "
    Border
    ", - "
    Padding
    ", - "
    Margin
    ", - "
    Outline
    " - ], - "answer": 3, - "explanation": "Content is the fourth property of the box model not outline." - }, - { - "subtitle": "CSS positioning", - "question": "Absolute positioning in Css removes an element from the normal document flow true/false?", - "choices": [ - "
    true
    ", - "
    false
    " - ], - "answer": 0, - "explanation": "Giving an element absolute positioning removes it from the normal document flow completely allowing positioning attributes top, left, bottom." - }, - { - "subtitle": "CSS selector", - "question": "With this Css Selector it is possible to select every element in a document.", - "choices": [ - "
    Body
    ", - "
    Universal
    ", - "
    Wildcard
    ", - "
    SelectAll
    " - ], - "answer": 1, - "explanation": "The Universal selector will select every element on a page and is denoted by *{}. note: The rule of specificity still applies, so a more specific selector can override the universal selector in a Css document." - }, - { - "subtitle": "Font size in CSS", - "question": "Which is not a valid Css font size?", - "choices": [ - "
    em
    ", - "
    %
    ", - "
    tp
    ", - "
    px
    " - ], - "answer": 2, - "explanation": "tp is not valid this should be pt." - }, - { - "subtitle": "CSS clear property", - "question": "The Css 'clear' property fulfills which task?", - "choices": [ - "
    Allows transparency of an element.
    ", - "
    Prevents prior properties of the selector from taking effect.
    ", - "
    Positions an element clear of a siblings margins and borders.
    ", - "
    Sets which sides of an element floating elements are not allowed to be floated.
    " - ], - "answer": 3, - "explanation": "The clear property has the following values available: both, left, right, inherit, initial and none." - }, - { - "subtitle": "CSS sudo-class", - "question": "An example of a sudo-class of a ul element written in Css would be defined?", - "choices": [ - "
    ul:first-child
    ", - "
    ul..first-child
    ", - "
    ul::first-child
    ", - "
    ul first-child
    " - ], - "answer": 0, - "explanation": "First answer : Would be correct of a sudo-class.
    Second answer : Would be an error of syntax.
    Third answer: The double colon would be an example of a sudo element used with the likes of ::before and ::after which are examples of content.
    Fourth answer : This would relate to html tag elements of which there is no first-child tag." + { + "subtitle": "Elements properties", + "question": "Which properties do inline elements not possess under normal document flow.", + "choices": [ + "
    overflow, left or right margins
    ", + "
    border-radius, z-index
    ", + "
    font-size, animation
    ", + "
    width, top or bottom margins
    " + ], + "answer": 3, + "explanation": "An inline element will only take up the width of the inner content." + }, + { + "subtitle": "CSS rules", + "question": "What will the following css rule select?\n
    .test > div {\n...\n}
    ", + "choices": [ + "
    Selects all divs within elements with the class of test.
    ", + "
    Selects all divs outside of elements with the class of test.
    ", + "
    Selects only divs that are immediate children of elements with the class of test.
    ", + "
    This would not be considered a valid selector.
    " + ], + "answer": 2, + "explanation": "eg: \n
    <div class='test'>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n</div>
    \n\nWould target only the elements with a class of 'box' as these are the direct children of 'test'." + }, + { + "subtitle": "Overriding properties", + "question": "Which keyword would you add to the end of a style rule to override another Css style for a specific element ?", + "choices": [ + "
    *override
    ", + "
    *overrideAll
    ", + "
    !vital
    ", + "
    !important
    " + ], + "answer": 3, + "explanation": "For example if you wanted all the paragraph tags in a specific class to have the colour blue instead of black\n
    .myClass p  {\ncolor: blue !important\n}
    " + }, + { + "subtitle": "Preprocessor CSS", + "question": "Which is not considered a Css preprocessor?", + "choices": [ + "
    Less
    ", + "
    Sass
    ", + "
    Stylus
    ", + "
    Express
    " + ], + "answer": 3, + "explanation": "Express is an application framework for Node.js" + }, + { + "subtitle": "CSS Box Model", + "question": "Which is not a property of the Css 'Box Model'?", + "choices": [ + "
    Border
    ", + "
    Padding
    ", + "
    Margin
    ", + "
    Outline
    " + ], + "answer": 3, + "explanation": "Content is the fourth property of the box model not outline." + }, + { + "subtitle": "CSS positioning", + "question": "Absolute positioning in Css removes an element from the normal document flow true/false?", + "choices": [ + "
    true
    ", + "
    false
    " + ], + "answer": 0, + "explanation": "Giving an element absolute positioning removes it from the normal document flow completely allowing positioning attributes top, left, bottom." + }, + { + "subtitle": "CSS selector", + "question": "With this Css Selector it is possible to select every element in a document.", + "choices": [ + "
    Body
    ", + "
    Universal
    ", + "
    Wildcard
    ", + "
    SelectAll
    " + ], + "answer": 1, + "explanation": "The Universal selector will select every element on a page and is denoted by *{}. note: The rule of specificity still applies, so a more specific selector can override the universal selector in a Css document." + }, + { + "subtitle": "Font size in CSS", + "question": "Which is not a valid Css font size?", + "choices": [ + "
    em
    ", + "
    %
    ", + "
    tp
    ", + "
    px
    " + ], + "answer": 2, + "explanation": "tp is not valid this should be pt." + }, + { + "subtitle": "CSS clear property", + "question": "The Css 'clear' property fulfills which task?", + "choices": [ + "
    Allows transparency of an element.
    ", + "
    Prevents prior properties of the selector from taking effect.
    ", + "
    Positions an element clear of a siblings margins and borders.
    ", + "
    Sets which sides of an element floating elements are not allowed to be floated.
    " + ], + "answer": 3, + "explanation": "The clear property has the following values available: both, left, right, inherit, initial and none." + }, + { + "subtitle": "CSS sudo-class", + "question": "An example of a sudo-class of a ul element written in Css would be defined?", + "choices": [ + "
    ul:first-child
    ", + "
    ul..first-child
    ", + "
    ul::first-child
    ", + "
    ul first-child
    " + ], + "answer": 0, + "explanation": "First answer : Would be correct of a sudo-class.
    Second answer : Would be an error of syntax.
    Third answer: The double colon would be an example of a sudo element used with the likes of ::before and ::after which are examples of content.
    Fourth answer : This would relate to html tag elements of which there is no first-child tag." } ], "tests": [], @@ -389,126 +388,125 @@ "id": "5a91a167a9178457a6f12821", "title": "CSS questions part 2", "description": [ - { - "subtitle": "CSS selector", - "question": "An entire Css selector and declaration block whithin a Css document eg:
    .container div p {
    position: relative;
    width: 300px;
    margin: auto;
    color: #ffffff;
    }

    is referred to as?", - "choices": [ - "
    Base-Block
    ", - "
    Selection Properties
    ", - "
    Selector Group
    ", - "
    Ruleset
    " - ], - "answer": 3, - "explanation": "The selectors name and properties are collectively called a Ruleset." - }, - { - "subtitle": "CSS Browser compatibility", - "question": "Which is not a valid Css prefix to ensure browser compatibility?" - , - "choices": [ - "
    -webkit-
    ", - "
    -win-
    ", - "
    -moz-
    ", - "
    -o-
    " - ], - "answer": 1, - "explanation": "-win- is incorrect, -webkit- (Chrome, Safari, ioS and modern versions of Opera), -moz- (Firefox), -o- (Older versions of Opera), the other would be -ms- used for (IE and Microsoft Edge)." - }, - { - "subtitle": "CSS 'text-transform' property", - "question": "The Css property 'text-transform' is mainly used for?", - "choices": [ - "
    Alteration of text letter case.
    ", - "
    Changing the alignment of text.
    ", - "
    Increase/Decrease font size.
    ", - "
    Transformation of font family.
    " - ], - "answer": 0, - "explanation": "The values for the property 'text-transform' are, capitalize, full-width, inherit, lowercase, none and uppercase." - }, - { - "subtitle": "CSS font-sizes", - "question": "If the default font size for a page is 12px, What is the pixel equivalent of 1.5em?", - "choices": [ - "
    12.5px
    ", - "
    9px
    ", - "
    18px
    ", - "
    6px
    " - ], - "answer": 2, - "explanation": "1em is equivalent to the base or default font size therefore (12 * 1.5 = 18)." - }, - { - "subtitle": "CCSS font weight", - "question": "In Css 'font-weight: bold;' is the same as?", - "choices": [ - "
    font-weight: 400;
    ", - "
    font-weight: 900
    ", - "
    font-weight: 700
    ", - "
    font-weight: 500
    " - ], - "answer": 2, - "explanation": "The keyword 'bold' is the same as the numerical value 700." - }, - { - "subtitle": "CSS ruleset", - "question": "Given this ruleset
    .testDiv {
    width: 20%;
    height: 20%;
    content: 'add this text'
    }

    What would happen with the content properties text?", - "choices": [ - "
    Nothing
    ", - "
    Appended to any text contained in element with class of testDiv.
    ", - "
    Prepended to any text contained in element with class of testDiv.
    ", - "
    Overwrite any text contained in element with class of testDiv.
    " - ], - "answer": 0, - "explanation": "Nothing would appear on the page, the content property needs to be used with sudo elements like ::after or ::before eg:
    .testDiv {
    width: 20%;
    height: 20%;\n}\n.testDiv::after {\ncontent: 'add this text'\n}
    " - }, - { - "subtitle": "CSS match selector", - "question": "What would the following Css selector match?
    section + p", - "choices": [ - "
    All <section> and <p> tags.
    ", - "
    All <p> tags within a <section> tag.
    ", - "
    All <p> tags placed immediately after a <section> tag.
    ", - "
    Not a valid selector.
    " - ], - "answer": 2, - "explanation": "
    <p>First Paragraph</p>
    <section>...</section>
    <p>Second Paragraph</p>
    <p>Third Paragraph</p>

    Only the second paragraph tag will be selected and matched." - }, - { - "subtitle": "How to incorporte CSS into web document", - "question": "How many different ways is it possible to incorporate Css into a web document?", - "choices": [ - "
    1
    ", - "
    2
    ", - "
    3
    ", - "
    4
    " - ], - "answer": 2, - "explanation": "Currently Css can be used 'Inline' as a style attribute of an Html element, 'Embedded' in a style tag of a document and 'Imported' as an external file with the link tag element." - }, - { - "subtitle": "Using target in css", - "question": "What would [role=contentinfo] {...} target in Css?", - "choices": [ - "
    Any element with the role attribute of contentinfo.
    ", - "
    Any element within a <span> tag.
    ", - "
    Any element within a <span> tag with the role attribute of contentinfo.
    ", - "
    This would only be valid using Sass or Scss.
    " - ], - "answer": 0, - "explanation": "The square bracket notation is used to target elements with specific attributes." - }, - { - "subtitle": "CSS positioning", - "question": "Which is not a value for 'position' in css?", - "choices": [ - "
    Absolute
    ", - "
    Static
    ", - "
    Responsive
    ", - "
    inherit
    " - ], - "answer": 2, - "explanation": "There is no such positioning as responsive, currently there is (absolute, fixed, inherit, relative and static)." + { + "subtitle": "CSS selector", + "question": "An entire Css selector and declaration block whithin a Css document eg:
    .container div p {
    position: relative;
    width: 300px;
    margin: auto;
    color: #ffffff;
    }

    is referred to as?", + "choices": [ + "
    Base-Block
    ", + "
    Selection Properties
    ", + "
    Selector Group
    ", + "
    Ruleset
    " + ], + "answer": 3, + "explanation": "The selectors name and properties are collectively called a Ruleset." + }, + { + "subtitle": "CSS Browser compatibility", + "question": "Which is not a valid Css prefix to ensure browser compatibility?", + "choices": [ + "
    -webkit-
    ", + "
    -win-
    ", + "
    -moz-
    ", + "
    -o-
    " + ], + "answer": 1, + "explanation": "-win- is incorrect, -webkit- (Chrome, Safari, ioS and modern versions of Opera), -moz- (Firefox), -o- (Older versions of Opera), the other would be -ms- used for (IE and Microsoft Edge)." + }, + { + "subtitle": "CSS 'text-transform' property", + "question": "The Css property 'text-transform' is mainly used for?", + "choices": [ + "
    Alteration of text letter case.
    ", + "
    Changing the alignment of text.
    ", + "
    Increase/Decrease font size.
    ", + "
    Transformation of font family.
    " + ], + "answer": 0, + "explanation": "The values for the property 'text-transform' are, capitalize, full-width, inherit, lowercase, none and uppercase." + }, + { + "subtitle": "CSS font-sizes", + "question": "If the default font size for a page is 12px, What is the pixel equivalent of 1.5em?", + "choices": [ + "
    12.5px
    ", + "
    9px
    ", + "
    18px
    ", + "
    6px
    " + ], + "answer": 2, + "explanation": "1em is equivalent to the base or default font size therefore (12 * 1.5 = 18)." + }, + { + "subtitle": "CCSS font weight", + "question": "In Css 'font-weight: bold;' is the same as?", + "choices": [ + "
    font-weight: 400;
    ", + "
    font-weight: 900
    ", + "
    font-weight: 700
    ", + "
    font-weight: 500
    " + ], + "answer": 2, + "explanation": "The keyword 'bold' is the same as the numerical value 700." + }, + { + "subtitle": "CSS ruleset", + "question": "Given this ruleset
    .testDiv {
    width: 20%;
    height: 20%;
    content: 'add this text'
    }

    What would happen with the content properties text?", + "choices": [ + "
    Nothing
    ", + "
    Appended to any text contained in element with class of testDiv.
    ", + "
    Prepended to any text contained in element with class of testDiv.
    ", + "
    Overwrite any text contained in element with class of testDiv.
    " + ], + "answer": 0, + "explanation": "Nothing would appear on the page, the content property needs to be used with sudo elements like ::after or ::before eg:
    .testDiv {
    width: 20%;
    height: 20%;\n}\n.testDiv::after {\ncontent: 'add this text'\n}
    " + }, + { + "subtitle": "CSS match selector", + "question": "What would the following Css selector match?
    section + p", + "choices": [ + "
    All <section> and <p> tags.
    ", + "
    All <p> tags within a <section> tag.
    ", + "
    All <p> tags placed immediately after a <section> tag.
    ", + "
    Not a valid selector.
    " + ], + "answer": 2, + "explanation": "
    <p>First Paragraph</p>
    <section>...</section>
    <p>Second Paragraph</p>
    <p>Third Paragraph</p>

    Only the second paragraph tag will be selected and matched." + }, + { + "subtitle": "How to incorporte CSS into web document", + "question": "How many different ways is it possible to incorporate Css into a web document?", + "choices": [ + "
    1
    ", + "
    2
    ", + "
    3
    ", + "
    4
    " + ], + "answer": 2, + "explanation": "Currently Css can be used 'Inline' as a style attribute of an Html element, 'Embedded' in a style tag of a document and 'Imported' as an external file with the link tag element." + }, + { + "subtitle": "Using target in css", + "question": "What would [role=contentinfo] {...} target in Css?", + "choices": [ + "
    Any element with the role attribute of contentinfo.
    ", + "
    Any element within a <span> tag.
    ", + "
    Any element within a <span> tag with the role attribute of contentinfo.
    ", + "
    This would only be valid using Sass or Scss.
    " + ], + "answer": 0, + "explanation": "The square bracket notation is used to target elements with specific attributes." + }, + { + "subtitle": "CSS positioning", + "question": "Which is not a value for 'position' in css?", + "choices": [ + "
    Absolute
    ", + "
    Static
    ", + "
    Responsive
    ", + "
    inherit
    " + ], + "answer": 2, + "explanation": "There is no such positioning as responsive, currently there is (absolute, fixed, inherit, relative and static)." } ], "tests": [], @@ -877,10 +875,10 @@ "subtitle": "Default port for FTP", "question": "In attempting to connect to an FTP (File Transfer Protocol) server and failing, which port can you check is open to troubleshoot the connection issue?", "choices": [ - "
    25
    ", - "
    443
    ", - "
    23
    ", - "
    21
    " + "
    25
    ", + "
    443
    ", + "
    23
    ", + "
    21
    " ], "answer": 3, "explanation": "Port 21 is traditionally used as the default port on a system for FTP." @@ -889,10 +887,10 @@ "subtitle": "Network types", "question": "Which of the following is not a type of network?", "choices": [ - "
    LAN
    ", - "
    MAN
    ", - "
    PAN
    ", - "
    NAN
    " + "
    LAN
    ", + "
    MAN
    ", + "
    PAN
    ", + "
    NAN
    " ], "answer": 3, "explanation": "NAN is not a current network type. LAN (Local Area Network), MAN (Metropolitan Area Network), PAN (Personal Area Network)." @@ -901,10 +899,10 @@ "subtitle": "Subnet mask usage", "question": "What is a subnet mask used for?", "choices": [ - "
    To hide the id of a wireless access point.
    ", - "
    To identyfy the extended and host address.
    ", - "
    To encrypt the broadcasting of ip addresses.
    ", - "
    To connect to a vpn.
    " + "
    To hide the id of a wireless access point.
    ", + "
    To identyfy the extended and host address.
    ", + "
    To encrypt the broadcasting of ip addresses.
    ", + "
    To connect to a vpn.
    " ], "answer": 1, "explanation": "A subnet mask is used along side an IP address in order to isolate the extended or 'subnet' of the network address and the host machine address." @@ -913,10 +911,10 @@ "subtitle": "Network acronym", "question": "What does NIC stand for?", "choices": [ - "
    Network Isolated Connection
    ", - "
    Network Interconnect Cables
    ", - "
    Network Interface Card
    ", - "
    Network Interference Cause
    " + "
    Network Isolated Connection
    ", + "
    Network Interconnect Cables
    ", + "
    Network Interface Card
    ", + "
    Network Interference Cause
    " ], "answer": 2, "explanation": "A Network Interface Card or (Network Interface Controller) is a hardware component that connects to a Pc or printer in order to\nconnect and be identified on a network." @@ -925,8 +923,8 @@ "subtitle": "Default gateway", "question": "A 'default gateway' provides a way for a local network to connect to a larger external network true or false?", "choices": [ - "
    true
    ", - "
    false
    " + "
    true
    ", + "
    false
    " ], "answer": 0, "explanation": "True this is usually the address of of an external router or switch." @@ -935,10 +933,10 @@ "subtitle": "The ipconfig commad", "question": "'ipconfig' is used for?", "choices": [ - "
    Reassigning ip addresses.
    ", - "
    Tool for masking ip adresses.
    ", - "
    Monitoring network traffic.
    ", - "
    Identify address information of a machine on a network.
    " + "
    Reassigning ip addresses.
    ", + "
    Tool for masking ip adresses.
    ", + "
    Monitoring network traffic.
    ", + "
    Identify address information of a machine on a network.
    " ], "answer": 3, "explanation": "ipconfig or ifconfig(linux) is a utility for gaining various address information of a computer on a network." @@ -947,10 +945,10 @@ "subtitle": "Network terminology", "question": "The term 'Latency' refers to?", "choices": [ - "
    The logical state of a network.
    ", - "
    A loss of data expected in transfer over a network.
    ", - "
    A measure of time delay between request and response experienced by a system.
    ", - "
    The scope for expanding a network.
    " + "
    The logical state of a network.
    ", + "
    A loss of data expected in transfer over a network.
    ", + "
    A measure of time delay between request and response experienced by a system.
    ", + "
    The scope for expanding a network.
    " ], "answer": 2, "explanation": "Latency can affect host to host transfers http requests etc." @@ -959,10 +957,10 @@ "subtitle": "Network terminology, again", "question": "The term 'full duplex' refers to?", "choices": [ - "
    Two way data transfer but not at the same time.
    ", - "
    Two way data transfer simultaneously.
    ", - "
    One way data transfer at high speed.
    ", - "
    One way data transfer with encryption
    " + "
    Two way data transfer but not at the same time.
    ", + "
    Two way data transfer simultaneously.
    ", + "
    One way data transfer at high speed.
    ", + "
    One way data transfer with encryption
    " ], "answer": 1, "explanation": "An example of full duplex would be like a telephone conversation between two people." @@ -972,4 +970,4 @@ "challengeType": 8 } ] -} +} \ No newline at end of file diff --git a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/take-home-interview-projects.json b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/take-home-interview-projects.json index 8e18593f90..f7144cc549 100644 --- a/seed/challenges/08-coding-interview-questions-and-take-home-assignments/take-home-interview-projects.json +++ b/seed/challenges/08-coding-interview-questions-and-take-home-assignments/take-home-interview-projects.json @@ -371,7 +371,7 @@ "Вы можете получить отзыв о вашем проекте от коллег, поделившись ссылкой на него в нашем чате для рассмотрения кода. Также вы можете поделиться ею через Twitter и на странице Free Code Camp вашего города на Facebook." ] }, - "es":{ + "es": { "title": "Crea una caja de recetas", "description": [ "Objetivo: Construye una aplicación en CodePen.io que funcione de forma similar al siguiente ejemplo: https://codepen.io/freeCodeCamp/full/dNVazZ/.", @@ -415,25 +415,25 @@ "type": "zipline", "isRequired": false, "challengeType": 3, - "translations":{ + "translations": { "ru": { "title": "Создайте игру \"Жизнь\"", "description": [ "Задание: Создайте приложение CodePen.io, функционал которого схож с этим: https://codepen.io/freeCodeCamp/full/BpwMZv/.", "Правило #1: Не подсматривайте код приложения-примера. Напишите его самостоятельно.", - "Правило #2: Приложение должно удовлетворять нижеприведённым пользовательским историям. Используйте любые библиотеки или API, которые потребуются. Придайте ему свой личный стиль.", - "Правило #3: Для создания этого проекта вы должны использовать Sass и React.", - "Пользовательская история: Когда я впервые запускаю игру, она генерирует доску случайным образом и начинает игру.", - "Пользовательская история: Я могу запустить и остановить игру.", - "Пользовательская история: Я могу настроить доску.", - "Пользовательская история: Я могу очистить доску.", - "Пользовательская история: Когда я нажимаю начать, игра начинает воспроизведение.", - "Пользовательская история: Каждый раз, когда доска меняется, я могу видеть сколько поколений прошло.", - "Подсказка: Вот объяснение игры \"Жизнь\" от её создателя Джона Конвея: https://www.youtube.com/watch?v=E8kUJL04ELA", - "Подсказка: Вот обзор правил игры \"Жизнь\" для вашего сведения: https://ru.wikipedia.org/wiki/Жизнь_(игра)", - "Если что-то не получается, не забывайте пользоваться методом Читай-Ищи-Спрашивай.", - "Когда закончите, нажмите кнопку \"I've completed this challenge\" и укажите ссылку на вашу работу на CodePen.", - "Вы можете получить отзыв о вашем проекте от коллег, поделившись ссылкой на него в нашем чате для рассмотрения кода. Также вы можете поделиться ею через Twitter и на странице Free Code Camp вашего города на Facebook." + "Правило #2: Приложение должно удовлетворять нижеприведённым пользовательским историям. Используйте любые библиотеки или API, которые потребуются. Придайте ему свой личный стиль.", + "Правило #3: Для создания этого проекта вы должны использовать Sass и React.", + "Пользовательская история: Когда я впервые запускаю игру, она генерирует доску случайным образом и начинает игру.", + "Пользовательская история: Я могу запустить и остановить игру.", + "Пользовательская история: Я могу настроить доску.", + "Пользовательская история: Я могу очистить доску.", + "Пользовательская история: Когда я нажимаю начать, игра начинает воспроизведение.", + "Пользовательская история: Каждый раз, когда доска меняется, я могу видеть сколько поколений прошло.", + "Подсказка: Вот объяснение игры \"Жизнь\" от её создателя Джона Конвея: https://www.youtube.com/watch?v=E8kUJL04ELA", + "Подсказка: Вот обзор правил игры \"Жизнь\" для вашего сведения: https://ru.wikipedia.org/wiki/Жизнь_(игра)", + "Если что-то не получается, не забывайте пользоваться методом Читай-Ищи-Спрашивай.", + "Когда закончите, нажмите кнопку \"I've completed this challenge\" и укажите ссылку на вашу работу на CodePen.", + "Вы можете получить отзыв о вашем проекте от коллег, поделившись ссылкой на него в нашем чате для рассмотрения кода. Также вы можете поделиться ею через Twitter и на странице Free Code Camp вашего города на Facebook." ] }, "es": { @@ -648,7 +648,7 @@ "type": "basejump", "challengeType": 4, "translations": { - "es":{ + "es": { "description": [ "Objetivo: Construye una aplicación de pila completa (full stack) en JavaScript que funcione de forma similar al siguiente proyecto: http://bookjump.herokuapp.com/ y despliégalo en Heroku.", "Ten en cuenta que para cada proyecto, debes crear un nuevo repositorio en GitHub y un nuevo proyecto en Heroku. Si no recuerdas cómo hacerlo, visita de nuevo https://freecodecamp.org/challenges/get-set-for-our-dynamic-web-application-projects.", @@ -685,7 +685,7 @@ "type": "basejump", "challengeType": 4, "translations": { - "es":{ + "es": { "description": [ "Objetivo: Construye una aplicación de pila completa (full stack) en JavaScript que funcione de forma similar al siguiente proyecto: https://midnight-dust.glitch.me/ y despliégalo en Heroku.", "Ten en cuenta que para cada proyecto, debes crear un nuevo repositorio en GitHub y un nuevo proyecto en Heroku. Si no recuerdas cómo hacerlo, visita de nuevo https://freecodecamp.org/challenges/get-set-for-our-dynamic-web-application-projects.",