fix: Formatting for Zig Zag Matrix challenge (#35403)
* fix: Formatting for Zig Zag Matrix challenge * Remove non-breaking spaces and replace them with normal spaces * Update zig-zag-matrix.english.md * Move instructions to instructions section from description * Update zig-zag-matrix.english.mdpull/33514/head^2
parent
8bac073687
commit
081284c2d3
|
@ -6,11 +6,9 @@ challengeType: 5
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
A ''zig-zag'' array is a square arrangement of the first
|
A 'zig-zag' array is a square arrangement of the first $N^2$ integers, where the numbers increase sequentially as you zig-zag along the array's <a href="https://en.wiktionary.org/wiki/antidiagonal">anti-diagonals</a>.
|
||||||
$N^2$ integers, where the
|
|
||||||
numbers increase sequentially as you zig-zag along the array's
|
For example, for the input <code>5</code>, the following result should be produced:
|
||||||
<a href="https://en.wiktionary.org/wiki/antidiagonal">anti-diagonals</a>.
|
|
||||||
For example, given '''5''', produce this array:
|
|
||||||
<pre>
|
<pre>
|
||||||
0 1 5 6 14
|
0 1 5 6 14
|
||||||
2 4 7 13 15
|
2 4 7 13 15
|
||||||
|
@ -18,13 +16,11 @@ For example, given '''5''', produce this array:
|
||||||
9 11 17 20 22
|
9 11 17 20 22
|
||||||
10 18 19 23 24
|
10 18 19 23 24
|
||||||
</pre>
|
</pre>
|
||||||
Write a function that takes the size of the zig-zag matrix, and returns the
|
|
||||||
corresponding matrix as two-dimensional array.
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
<section id='instructions'>
|
<section id='instructions'>
|
||||||
|
Write a function that takes the size of the zig-zag matrix, and returns the corresponding matrix as two-dimensional array.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
@ -33,17 +29,17 @@ corresponding matrix as two-dimensional array.
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ZigZagMatrix must be a function
|
- text: ZigZagMatrix must be a function
|
||||||
testString: assert.equal(typeof ZigZagMatrix, 'function', 'ZigZagMatrix must be a function');
|
testString: assert.equal(typeof ZigZagMatrix, 'function');
|
||||||
- text: ZigZagMatrix should return array
|
- text: ZigZagMatrix should return array
|
||||||
testString: assert.equal(typeof ZigZagMatrix(1), 'object', 'ZigZagMatrix should return array');
|
testString: assert.equal(typeof ZigZagMatrix(1), 'object');
|
||||||
- text: ZigZagMatrix should return an array of nestes arrays
|
- text: ZigZagMatrix should return an array of nested arrays
|
||||||
testString: assert.equal(typeof ZigZagMatrix(1)[0], 'object', 'ZigZagMatrix should return an array of nestes arrays');
|
testString: assert.equal(typeof ZigZagMatrix(1)[0], 'object');
|
||||||
- text: ZigZagMatrix(1) should return [[0]]
|
- text: ZigZagMatrix(1) should return [[0]]
|
||||||
testString: assert.deepEqual(ZigZagMatrix(1), zm1, 'ZigZagMatrix(1) should return [[0]]');
|
testString: assert.deepEqual(ZigZagMatrix(1), zm1);
|
||||||
- text: ZigZagMatrix(2) should return [[0, 1], [2, 3]]
|
- text: ZigZagMatrix(2) should return [[0, 1], [2, 3]]
|
||||||
testString: assert.deepEqual(ZigZagMatrix(2), zm2, 'ZigZagMatrix(2) should return [[0, 1], [2, 3]]');
|
testString: assert.deepEqual(ZigZagMatrix(2), zm2);
|
||||||
- text: ZigZagMatrix(5) must return specified matrix
|
- text: ZigZagMatrix(5) must return specified matrix
|
||||||
testString: assert.deepEqual(ZigZagMatrix(5), zm5, 'ZigZagMatrix(5) must return specified matrix');
|
testString: assert.deepEqual(ZigZagMatrix(5), zm5);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue