fix(challenge-md): Fix formatting errors
This commit is contained in:
parent
e0e8ab8409
commit
ac1ea780fc
@ -2,7 +2,7 @@
|
||||
id: 587d781b367417b2b2512aba
|
||||
title: Use the s Tag to Strikethrough Text
|
||||
challengeType: 0
|
||||
videoUrl: "
|
||||
videoUrl: ''
|
||||
---
|
||||
|
||||
## Description
|
||||
|
@ -2,7 +2,7 @@
|
||||
id: 5b7d72c338cd7e35b63f3e14
|
||||
title: Improve Compatibility with Browser Fallbacks
|
||||
challengeType: 0
|
||||
videoUrl: "
|
||||
videoUrl: ''
|
||||
---
|
||||
|
||||
## Description
|
||||
|
@ -23,29 +23,29 @@ Start this project on Glitch using <a href='https://glitch.com/#!/import/github/
|
||||
```yml
|
||||
tests:
|
||||
- text: Only allow your site to be loading in an iFrame on your own pages.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: Do not allow DNS prefetching.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: Only allow your site to send the referrer for your own pages.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can POST a thread to a specific message board by passing form data text and deletepassword_ to /api/threads/{board}.(Recommend res.redirect to board page /b/{board}) Saved will be at least _id, text, createdon_(date&time), bumpedon_(date&time, starts same as created_on), reported(boolean), deletepassword_, & replies(array).'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can POST a reply to a thread on a specific board by passing form data text, deletepassword_, & threadid_ to /api/replies/{board} and it will also update the bumped_on date to the comments date.(Recommend res.redirect to thread page /b/{board}/{thread_id}) In the thread"s replies array will be saved _id, text, createdon_, deletepassword_, & reported.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can GET an array of the most recent 10 bumped threads on the board with only the most recent 3 replies each from /api/threads/{board}. The reported and deletepasswords_ fields will not be sent to the client.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can GET an entire thread with all its replies from /api/replies/{board}?thread_id={thread_id}. Also hiding the same fields the client should be see.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can delete a thread completely if I send a DELETE request to /api/threads/{board} and pass along the threadid_ & deletepassword_. (Text response will be "incorrect password" or "success")'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can delete a post(just changing the text to "[deleted]" instead of removing completely like a thread) if I send a DELETE request to /api/replies/{board} and pass along the threadid_, replyid_, & deletepassword_. (Text response will be "incorrect password" or "success")'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can report a thread and change its reported value to true by sending a PUT request to /api/threads/{board} and pass along the threadid_. (Text response will be "success")'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can report a reply and change its reported value to true by sending a PUT request to /api/replies/{board} and pass along the threadid_ & replyid_. (Text response will be "success")'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: Complete functional tests that wholly test routes and pass.
|
||||
testString: "
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,21 +23,21 @@ Start this project on Glitch using <a href='https://glitch.com/#!/import/github/
|
||||
```yml
|
||||
tests:
|
||||
- text: Prevent cross site scripting (XSS) attacks.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can POST /api/issues/{projectname} with form data containing required issue_title, issue_text, created_by, and optional assigned_to and status_text.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'The object saved (and returned) will include all of those fields (blank for optional no input) and also include created_on(date/time), updated_on(date/time), open(boolean, true for open, false for closed), and _id.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can PUT /api/issues/{projectname} with a id and any fields in the object with a value to object said object. Returned will be "successfully updated" or "could not update "+id. This should always update updated_on. If no fields are sent return "no updated field sent".'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can DELETE /api/issues/{projectname} with a id to completely delete an issue. If no _id is sent return "id error", success: "deleted "+id, failed: "could not delete "+id.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can GET /api/issues/{projectname} for an array of all issues on that specific project with all the information for each issue as was returned when posted.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can filter my get request by also passing along any field and value in the query(ie. /api/issues/{project}?open=false). I can pass along as many fields/values as I want.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: All 11 functional tests are complete and passing.
|
||||
testString: "
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,31 +23,31 @@ Start this project on Glitch using <a href='https://glitch.com/#!/import/github/
|
||||
```yml
|
||||
tests:
|
||||
- text: I will prevent the client from trying to guess(sniff) the MIME type.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I will prevent cross-site scripting (XSS) attacks.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can GET /api/convert with a single parameter containing an accepted number and unit and have it converted. (Hint: Split the input by looking for the index of the first character which will mark the start of the unit)'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can convert 'gal' to 'L' and vice versa. (1 gal to 3.78541 L)
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can convert 'lbs' to 'kg' and vice versa. (1 lbs to 0.453592 kg)
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can convert 'mi' to 'km' and vice versa. (1 mi to 1.60934 km)
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'If my unit of measurement is invalid, returned will be "invalid unit".'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'If my number is invalid, returned with will "invalid number".'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'If both are invalid, return will be "invalid number and unit".'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can use fractions, decimals or both in my parameter(ie. 5, 1/2, 2.5/6), but if nothing is provided it will default to 1.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'My return will consist of the initNum, initUnit, returnNum, returnUnit, and string spelling out units in format "{initNum} {initial_Units} converts to {returnNum} {return_Units}" with the result rounded to 5 decimals in the string.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: All 16 unit tests are complete and passing.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: All 5 functional tests are complete and passing.
|
||||
testString: "
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,25 +23,25 @@ Start this project on Glitch using <a href='https://glitch.com/#!/import/github/
|
||||
```yml
|
||||
tests:
|
||||
- text: Nothing from my website will be cached in my client.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: The headers will say that the site is powered by 'PHP 4.2.0' even though it isn't (as a security measure).
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can post a title to /api/books to add a book and returned will be the object with the title and a unique _id.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can get /api/books to retrieve an array of all books containing title, _id, and commentcount.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can get /api/books/{id} to retrieve a single object of a book containing _title, _id, & an array of comments (empty array if no comments present).'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can post a comment to /api/books/{id} to add a comment to a book and returned will be the books object similar to get /api/books/{id} including the new comment.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'I can delete /api/books/{_id} to delete a book from the collection. Returned will be "delete successful" if successful.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: If I try to request a book that doesn't exist I will be returned 'no book exists'.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can send a delete request to /api/books to delete all books in the database. Returned will be 'complete delete successful' if successful.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: All 6 functional tests required are complete and passing.
|
||||
testString: "
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,19 +23,19 @@ Start this project on Glitch using <a href='https://glitch.com/#!/import/github/
|
||||
```yml
|
||||
tests:
|
||||
- text: Set the content security policies to only allow loading of scripts and css from your server.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can GET /api/stock-prices with form data containing a Nasdaq stock ticker and receive back an object stockData.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'In stockData, I can see the stock(string, the ticker), price(decimal in string format), and likes(int).'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: I can also pass along field like as true(boolean) to have my like added to the stock(s). Only 1 like per ip should be accepted.
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'If I pass along 2 stocks, the return object will be an array with both stock"s info. Instead of likes, it will display rel_likes(the difference between the likes on both stocks) on both.'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: 'A good way to receive current price is the following external API(replacing "GOOG" with your stock): https://finance.google.com/finance/info?q=NASDAQ%3aGOOG'
|
||||
testString: "
|
||||
testString: ''
|
||||
- text: All 5 functional tests are complete and passing.
|
||||
testString: "
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
|
@ -19,19 +19,19 @@ Write a function to solve \(A.x = b\) using Gaussian elimination then backwards
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>gaussianElimination</code> should be a function."'
|
||||
- text: <code>gaussianElimination</code> should be a function.
|
||||
testString: 'assert(typeof gaussianElimination=="function","<code>gaussianElimination</code> should be a function.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return an array."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return an array.
|
||||
testString: 'assert(Array.isArray(gaussianElimination(tests[0][0],tests[0][1])),"<code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return an array.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>.
|
||||
testString: 'assert.deepEqual(gaussianElimination(tests[0][0],tests[0][1]),results[0],"<code>gaussianElimination("+JSON.stringify(tests[0][0])+","+JSON.stringify(tests[0][1])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[1][0])+","+JSON.stringify(tests[1][1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[1][0])+","+JSON.stringify(tests[1][1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>.
|
||||
testString: 'assert.deepEqual(gaussianElimination(tests[1][0],tests[1][1]),results[1],"<code>gaussianElimination("+JSON.stringify(tests[1][0])+","+JSON.stringify(tests[1][1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[2][0])+","+JSON.stringify(tests[2][1])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[2][0])+","+JSON.stringify(tests[2][1])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>.
|
||||
testString: 'assert.deepEqual(gaussianElimination(tests[2][0],tests[2][1]),results[2],"<code>gaussianElimination("+JSON.stringify(tests[2][0])+","+JSON.stringify(tests[2][1])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[3][0])+","+JSON.stringify(tests[3][1])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[3][0])+","+JSON.stringify(tests[3][1])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>.
|
||||
testString: 'assert.deepEqual(gaussianElimination(tests[3][0],tests[3][1]),results[3],"<code>gaussianElimination("+JSON.stringify(tests[3][0])+","+JSON.stringify(tests[3][1])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>.");'
|
||||
- text: "'<code>gaussianElimination("+JSON.stringify(tests[4][0])+","+JSON.stringify(tests[4][1])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>."'
|
||||
- text: <code>gaussianElimination("+JSON.stringify(tests[4][0])+","+JSON.stringify(tests[4][1])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>.
|
||||
testString: 'assert.deepEqual(gaussianElimination(tests[4][0],tests[4][1]),results[4],"<code>gaussianElimination("+JSON.stringify(tests[4][0])+","+JSON.stringify(tests[4][1])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>.");'
|
||||
|
||||
```
|
||||
|
@ -23,23 +23,23 @@ The second parameter is the number for which the function should return a string
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>genFizzBuzz</code> should be a function."'
|
||||
- text: <code>genFizzBuzz</code> should be a function.
|
||||
testString: 'assert(typeof genFizzBuzz=="function","<code>genFizzBuzz</code> should be a function.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return a type."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return a type.
|
||||
testString: 'assert(typeof genFizzBuzz(tests[0][0],tests[0][1])=="string","<code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return a type.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return <code>""+results[0]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return <code>""+results[0]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[0][0],tests[0][1]),results[0],"<code>genFizzBuzz("+JSON.stringify(tests[0][0])+","+tests[0][1]+")</code> should return <code>""+results[0]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")</code> should return <code>""+results[1]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")</code> should return <code>""+results[1]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[1][0],tests[1][1]),results[1],"<code>genFizzBuzz("+JSON.stringify(tests[1][0])+","+tests[1][1]+")</code> should return <code>""+results[1]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")</code> should return <code>""+results[2]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")</code> should return <code>""+results[2]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[2][0],tests[2][1]),results[2],"<code>genFizzBuzz("+JSON.stringify(tests[2][0])+","+tests[2][1]+")</code> should return <code>""+results[2]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")</code> should return <code>""+results[3]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")</code> should return <code>""+results[3]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[3][0],tests[3][1]),results[3],"<code>genFizzBuzz("+JSON.stringify(tests[3][0])+","+tests[3][1]+")</code> should return <code>""+results[3]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")</code> should return <code>""+results[4]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")</code> should return <code>""+results[4]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[4][0],tests[4][1]),results[4],"<code>genFizzBuzz("+JSON.stringify(tests[4][0])+","+tests[4][1]+")</code> should return <code>""+results[4]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")</code> should return <code>""+results[5]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")</code> should return <code>""+results[5]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[5][0],tests[5][1]),results[5],"<code>genFizzBuzz("+JSON.stringify(tests[5][0])+","+tests[5][1]+")</code> should return <code>""+results[5]+""</code>.");'
|
||||
- text: "'<code>genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")</code> should return <code>""+results[6]+""</code>."'
|
||||
- text: <code>genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")</code> should return <code>""+results[6]+""</code>.
|
||||
testString: 'assert.equal(genFizzBuzz(tests[6][0],tests[6][1]),results[6],"<code>genFizzBuzz("+JSON.stringify(tests[6][0])+","+tests[6][1]+")</code> should return <code>""+results[6]+""</code>.");'
|
||||
|
||||
```
|
||||
|
@ -19,9 +19,9 @@ Write a function to generate an array of lower case ASCII characters, for a give
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>lascii</code> should be a function."'
|
||||
- text: <code>lascii</code> should be a function.
|
||||
testString: 'assert(typeof lascii=="function","<code>lascii</code> should be a function.");'
|
||||
- text: "'<code>lascii("a","d")</code> should return an array."'
|
||||
- text: <code>lascii("a","d")</code> should return an array.
|
||||
testString: 'assert(Array.isArray(lascii("a","d")),"<code>lascii("a","d")</code> should return an array.");'
|
||||
- text: '"<code>lascii("a","d")</code> should return <code>[ "a", "b", "c", "d" ]</code>."'
|
||||
testString: 'assert.deepEqual(lascii("a","d"),results[0],"<code>lascii("a","d")</code> should return <code>[ "a", "b", "c", "d" ]</code>.");'
|
||||
|
@ -24,19 +24,19 @@ For example for \(n=7\), the function should return 81 as the sequence would be
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>exponentialGenerator</code> should be a function."'
|
||||
- text: <code>exponentialGenerator</code> should be a function.
|
||||
testString: 'assert(typeof exponentialGenerator=="function","<code>exponentialGenerator</code> should be a function.");'
|
||||
- text: "'<code>exponentialGenerator()</code> should return a number."'
|
||||
- text: <code>exponentialGenerator()</code> should return a number.
|
||||
testString: 'assert(typeof exponentialGenerator(10)=="number","<code>exponentialGenerator()</code> should return a number.");'
|
||||
- text: "'<code>exponentialGenerator(10)</code> should return <code>144</code>."'
|
||||
- text: <code>exponentialGenerator(10)</code> should return <code>144</code>.
|
||||
testString: 'assert.equal(exponentialGenerator(10),144,"<code>exponentialGenerator(10)</code> should return <code>144</code>.");'
|
||||
- text: "'<code>exponentialGenerator(12)</code> should return <code>196</code>."'
|
||||
- text: <code>exponentialGenerator(12)</code> should return <code>196</code>.
|
||||
testString: 'assert.equal(exponentialGenerator(12),196,"<code>exponentialGenerator(12)</code> should return <code>196</code>.");'
|
||||
- text: "'<code>exponentialGenerator(14)</code> should return <code>256</code>."'
|
||||
- text: <code>exponentialGenerator(14)</code> should return <code>256</code>.
|
||||
testString: 'assert.equal(exponentialGenerator(14),256,"<code>exponentialGenerator(14)</code> should return <code>256</code>.");'
|
||||
- text: "'<code>exponentialGenerator(20)</code> should return <code>484</code>."'
|
||||
- text: <code>exponentialGenerator(20)</code> should return <code>484</code>.
|
||||
testString: 'assert.equal(exponentialGenerator(20),484,"<code>exponentialGenerator(20)</code> should return <code>484</code>.");'
|
||||
- text: "'<code>exponentialGenerator(25)</code> should return <code>784</code>."'
|
||||
- text: <code>exponentialGenerator(25)</code> should return <code>784</code>.
|
||||
testString: 'assert.equal(exponentialGenerator(25),784,"<code>exponentialGenerator(25)</code> should return <code>784</code>.");'
|
||||
|
||||
```
|
||||
|
@ -28,21 +28,21 @@ There are many possible Gray codes. The following encodes what is called "binary
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>gray</code> should be a function."'
|
||||
- text: <code>gray</code> should be a function.
|
||||
testString: 'assert(typeof gray=="function","<code>gray</code> should be a function.");'
|
||||
- text: "'<code>gray(true,177)</code> should return a number."'
|
||||
- text: <code>gray(true,177)</code> should return a number.
|
||||
testString: 'assert(typeof gray(true,177)=="number","<code>gray(true,177)</code> should return a number.");'
|
||||
- text: "'<code>gray(true,177)</code> should return <code>233</code>."'
|
||||
- text: <code>gray(true,177)</code> should return <code>233</code>.
|
||||
testString: 'assert.equal(gray(true,177),233,"<code>gray(true,177)</code> should return <code>233</code>.");'
|
||||
- text: "'<code>gray(true,425)</code> should return <code>381</code>."'
|
||||
- text: <code>gray(true,425)</code> should return <code>381</code>.
|
||||
testString: 'assert.equal(gray(true,425),381,"<code>gray(true,425)</code> should return <code>381</code>.");'
|
||||
- text: "'<code>gray(true,870)</code> should return <code>725</code>."'
|
||||
- text: <code>gray(true,870)</code> should return <code>725</code>.
|
||||
testString: 'assert.equal(gray(true,870),725,"<code>gray(true,870)</code> should return <code>725</code>.");'
|
||||
- text: "'<code>gray(false,233)</code> should return <code>177</code>."'
|
||||
- text: <code>gray(false,233)</code> should return <code>177</code>.
|
||||
testString: 'assert.equal(gray(false,233),177,"<code>gray(false,233)</code> should return <code>177</code>.");'
|
||||
- text: "'<code>gray(false,381)</code> should return <code>425</code>."'
|
||||
- text: <code>gray(false,381)</code> should return <code>425</code>.
|
||||
testString: 'assert.equal(gray(false,381),425,"<code>gray(false,381)</code> should return <code>425</code>.");'
|
||||
- text: "'<code>gray(false,725)</code> should return <code>870</code>."'
|
||||
- text: <code>gray(false,725)</code> should return <code>870</code>.
|
||||
testString: 'assert.equal(gray(false,725),870,"<code>gray(false,725)</code> should return <code>870</code>.");'
|
||||
|
||||
```
|
||||
|
@ -19,21 +19,21 @@ Write a function that returns the greatest common divisor of two integers.
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>gcd</code> should be a function."'
|
||||
- text: <code>gcd</code> should be a function.
|
||||
testString: 'assert(typeof gcd=="function","<code>gcd</code> should be a function.");'
|
||||
- text: "'<code>gcd(24,36)</code> should return a number."'
|
||||
- text: <code>gcd(24,36)</code> should return a number.
|
||||
testString: 'assert(typeof gcd(24,36)=="number","<code>gcd(24,36)</code> should return a number.");'
|
||||
- text: "'<code>gcd(24,36)</code> should return <code>12</code>."'
|
||||
- text: <code>gcd(24,36)</code> should return <code>12</code>.
|
||||
testString: 'assert.equal(gcd(24,36),12,"<code>gcd(24,36)</code> should return <code>12</code>.");'
|
||||
- text: "'<code>gcd(30,48)</code> should return <code>6</code>."'
|
||||
- text: <code>gcd(30,48)</code> should return <code>6</code>.
|
||||
testString: 'assert.equal(gcd(30,48),6,"<code>gcd(30,48)</code> should return <code>6</code>.");'
|
||||
- text: "'<code>gcd(10,15)</code> should return <code>5</code>."'
|
||||
- text: <code>gcd(10,15)</code> should return <code>5</code>.
|
||||
testString: 'assert.equal(gcd(10,15),5,"<code>gcd(10,15)</code> should return <code>5</code>.");'
|
||||
- text: "'<code>gcd(100,25)</code> should return <code>25</code>."'
|
||||
- text: <code>gcd(100,25)</code> should return <code>25</code>.
|
||||
testString: 'assert.equal(gcd(100,25),25,"<code>gcd(100,25)</code> should return <code>25</code>.");'
|
||||
- text: "'<code>gcd(13,250)</code> should return <code>1</code>."'
|
||||
- text: <code>gcd(13,250)</code> should return <code>1</code>.
|
||||
testString: 'assert.equal(gcd(13,250),1,"<code>gcd(13,250)</code> should return <code>1</code>.");'
|
||||
- text: "'<code>gcd(1300,250)</code> should return <code>50</code>."'
|
||||
- text: <code>gcd(1300,250)</code> should return <code>50</code>.
|
||||
testString: 'assert.equal(gcd(1300,250),50,"<code>gcd(1300,250)</code> should return <code>50</code>.");'
|
||||
|
||||
```
|
||||
|
@ -20,21 +20,21 @@ An empty subsequence is considered to have the sum of \( 0 \); thus if all elem
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>maximumSubsequence</code> should be a function."'
|
||||
- text: <code>maximumSubsequence</code> should be a function.
|
||||
testString: 'assert(typeof maximumSubsequence=="function","<code>maximumSubsequence</code> should be a function.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return an array."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return an array.
|
||||
testString: 'assert(Array.isArray(maximumSubsequence(tests[0])),"<code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return an array.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[0]),results[0],"<code>maximumSubsequence("+JSON.stringify(tests[0])+")</code> should return <code>"+JSON.stringify(results[0])+"</code>.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[1]),results[1],"<code>maximumSubsequence("+JSON.stringify(tests[1])+")</code> should return <code>"+JSON.stringify(results[1])+"</code>.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[2])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[2])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[2]),results[2],"<code>maximumSubsequence("+JSON.stringify(tests[2])+")</code> should return <code>"+JSON.stringify(results[2])+"</code>.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[3])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[3])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[3]),results[3],"<code>maximumSubsequence("+JSON.stringify(tests[3])+")</code> should return <code>"+JSON.stringify(results[3])+"</code>.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[4])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[4])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[4]),results[4],"<code>maximumSubsequence("+JSON.stringify(tests[4])+")</code> should return <code>"+JSON.stringify(results[4])+"</code>.");'
|
||||
- text: "'<code>maximumSubsequence("+JSON.stringify(tests[5])+")</code> should return <code>"+JSON.stringify(results[5])+"</code>."'
|
||||
- text: <code>maximumSubsequence("+JSON.stringify(tests[5])+")</code> should return <code>"+JSON.stringify(results[5])+"</code>.
|
||||
testString: 'assert.deepEqual(maximumSubsequence(tests[5]),results[5],"<code>maximumSubsequence("+JSON.stringify(tests[5])+")</code> should return <code>"+JSON.stringify(results[5])+"</code>.");'
|
||||
|
||||
```
|
||||
|
@ -23,21 +23,21 @@ Write a function that accepts a word and check if the word follows this rule. Th
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>IBeforeExceptC</code> should be a function."'
|
||||
- text: <code>IBeforeExceptC</code> should be a function.
|
||||
testString: 'assert(typeof IBeforeExceptC=="function","<code>IBeforeExceptC</code> should be a function.");'
|
||||
- text: "'<code>IBeforeExceptC("receive")</code> should return a boolean."'
|
||||
- text: <code>IBeforeExceptC("receive")</code> should return a boolean.
|
||||
testString: 'assert(typeof IBeforeExceptC("receive")=="boolean","<code>IBeforeExceptC("receive")</code> should return a boolean.");'
|
||||
- text: "'<code>IBeforeExceptC("receive")</code> should return <code>true</code>."'
|
||||
- text: <code>IBeforeExceptC("receive")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("receive"),true,"<code>IBeforeExceptC("receive")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>IBeforeExceptC("science")</code> should return <code>false</code>."'
|
||||
- text: <code>IBeforeExceptC("science")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("science"),false,"<code>IBeforeExceptC("science")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>IBeforeExceptC("imperceivable")</code> should return <code>true</code>."'
|
||||
- text: <code>IBeforeExceptC("imperceivable")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("imperceivable"),true,"<code>IBeforeExceptC("imperceivable")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>IBeforeExceptC("inconceivable")</code> should return <code>true</code>."'
|
||||
- text: <code>IBeforeExceptC("inconceivable")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("inconceivable"),true,"<code>IBeforeExceptC("inconceivable")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>IBeforeExceptC("insufficient")</code> should return <code>false</code>."'
|
||||
- text: <code>IBeforeExceptC("insufficient")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("insufficient"),false,"<code>IBeforeExceptC("insufficient")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>IBeforeExceptC("omniscient")</code> should return <code>false</code>."'
|
||||
- text: <code>IBeforeExceptC("omniscient")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(IBeforeExceptC("omniscient"),false,"<code>IBeforeExceptC("omniscient")</code> should return <code>false</code>.");'
|
||||
|
||||
```
|
||||
|
@ -27,19 +27,19 @@ Write a function that takes IBAN string as parameter. If it is valid return true
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>isValid</code> should be a function."'
|
||||
- text: <code>isValid</code> should be a function.
|
||||
testString: 'assert(typeof isValid=="function","<code>isValid</code> should be a function.");'
|
||||
- text: "'<code>isValid(""+tests[0]+"")</code> should return a boolean."'
|
||||
- text: <code>isValid(""+tests[0]+"")</code> should return a boolean.
|
||||
testString: 'assert(typeof isValid(tests[0])=="boolean","<code>isValid(""+tests[0]+"")</code> should return a boolean.");'
|
||||
- text: "'<code>isValid(""+tests[0]+"")</code> should return <code>true</code>."'
|
||||
- text: <code>isValid(""+tests[0]+"")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(isValid(tests[0]),true,"<code>isValid(""+tests[0]+"")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>isValid(""+tests[1]+"")</code> should return <code>false</code>."'
|
||||
- text: <code>isValid(""+tests[1]+"")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(isValid(tests[1]),false,"<code>isValid(""+tests[1]+"")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>isValid(""+tests[2]+"")</code> should return <code>false</code>."'
|
||||
- text: <code>isValid(""+tests[2]+"")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(isValid(tests[2]),false,"<code>isValid(""+tests[2]+"")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>isValid(""+tests[3]+"")</code> should return <code>false</code>."'
|
||||
- text: <code>isValid(""+tests[3]+"")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(isValid(tests[3]),false,"<code>isValid(""+tests[3]+"")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>isValid(""+tests[4]+"")</code> should return <code>true</code>."'
|
||||
- text: <code>isValid(""+tests[4]+"")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(isValid(tests[4]),true,"<code>isValid(""+tests[4]+"")</code> should return <code>true</code>.");'
|
||||
|
||||
```
|
||||
|
@ -23,17 +23,17 @@ Write a function that takes a number 'n' as a parameter and returns the identity
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>idMatrix</code> should be a function."'
|
||||
- text: <code>idMatrix</code> should be a function.
|
||||
testString: 'assert(typeof idMatrix=="function","<code>idMatrix</code> should be a function.");'
|
||||
- text: "'<code>idMatrix(1)</code> should return an array."'
|
||||
- text: <code>idMatrix(1)</code> should return an array.
|
||||
testString: 'assert(Array.isArray(idMatrix(1)),"<code>idMatrix(1)</code> should return an array.");'
|
||||
- text: "'<code>idMatrix(1)</code> should return <code>"+JSON.stringify(results[0])+"</code>."'
|
||||
- text: <code>idMatrix(1)</code> should return <code>"+JSON.stringify(results[0])+"</code>.
|
||||
testString: 'assert.deepEqual(idMatrix(1),results[0],"<code>idMatrix(1)</code> should return <code>"+JSON.stringify(results[0])+"</code>.");'
|
||||
- text: "'<code>idMatrix(2)</code> should return <code>"+JSON.stringify(results[1])+"</code>."'
|
||||
- text: <code>idMatrix(2)</code> should return <code>"+JSON.stringify(results[1])+"</code>.
|
||||
testString: 'assert.deepEqual(idMatrix(2),results[1],"<code>idMatrix(2)</code> should return <code>"+JSON.stringify(results[1])+"</code>.");'
|
||||
- text: "'<code>idMatrix(3)</code> should return <code>"+JSON.stringify(results[2])+"</code>."'
|
||||
- text: <code>idMatrix(3)</code> should return <code>"+JSON.stringify(results[2])+"</code>.
|
||||
testString: 'assert.deepEqual(idMatrix(3),results[2],"<code>idMatrix(3)</code> should return <code>"+JSON.stringify(results[2])+"</code>.");'
|
||||
- text: "'<code>idMatrix(4)</code> should return <code>"+JSON.stringify(results[3])+"</code>."'
|
||||
- text: <code>idMatrix(4)</code> should return <code>"+JSON.stringify(results[3])+"</code>.
|
||||
testString: 'assert.deepEqual(idMatrix(4),results[3],"<code>idMatrix(4)</code> should return <code>"+JSON.stringify(results[3])+"</code>.");'
|
||||
|
||||
```
|
||||
|
@ -22,21 +22,21 @@ Write a function that takes a number as a parameter and returns 1 or 89 after pe
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>iteratedSquare</code> should be a function."'
|
||||
- text: <code>iteratedSquare</code> should be a function.
|
||||
testString: 'assert(typeof iteratedSquare=="function","<code>iteratedSquare</code> should be a function.");'
|
||||
- text: "'<code>iteratedSquare(4)</code> should return a number."'
|
||||
- text: <code>iteratedSquare(4)</code> should return a number.
|
||||
testString: 'assert(typeof iteratedSquare(4)=="number","<code>iteratedSquare(4)</code> should return a number.");'
|
||||
- text: "'<code>iteratedSquare(4)</code> should return <code>89</code>."'
|
||||
- text: <code>iteratedSquare(4)</code> should return <code>89</code>.
|
||||
testString: 'assert.equal(iteratedSquare(4),89,"<code>iteratedSquare(4)</code> should return <code>89</code>.");'
|
||||
- text: "'<code>iteratedSquare(7)</code> should return <code>1</code>."'
|
||||
- text: <code>iteratedSquare(7)</code> should return <code>1</code>.
|
||||
testString: 'assert.equal(iteratedSquare(7),1,"<code>iteratedSquare(7)</code> should return <code>1</code>.");'
|
||||
- text: "'<code>iteratedSquare(15)</code> should return <code>89</code>."'
|
||||
- text: <code>iteratedSquare(15)</code> should return <code>89</code>.
|
||||
testString: 'assert.equal(iteratedSquare(15),89,"<code>iteratedSquare(15)</code> should return <code>89</code>.");'
|
||||
- text: "'<code>iteratedSquare(20)</code> should return <code>89</code>."'
|
||||
- text: <code>iteratedSquare(20)</code> should return <code>89</code>.
|
||||
testString: 'assert.equal(iteratedSquare(20),89,"<code>iteratedSquare(20)</code> should return <code>89</code>.");'
|
||||
- text: "'<code>iteratedSquare(70)</code> should return <code>1</code>."'
|
||||
- text: <code>iteratedSquare(70)</code> should return <code>1</code>.
|
||||
testString: 'assert.equal(iteratedSquare(70),1,"<code>iteratedSquare(70)</code> should return <code>1</code>.");'
|
||||
- text: "'<code>iteratedSquare(100)</code> should return <code>1</code>."'
|
||||
- text: <code>iteratedSquare(100)</code> should return <code>1</code>.
|
||||
testString: 'assert.equal(iteratedSquare(100),1,"<code>iteratedSquare(100)</code> should return <code>1</code>.");'
|
||||
|
||||
```
|
||||
|
@ -28,19 +28,19 @@ Write a function a that takes two strings as parameters and returns the associat
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>jaro</code> should be a function."'
|
||||
- text: <code>jaro</code> should be a function.
|
||||
testString: 'assert(typeof jaro=="function","<code>jaro</code> should be a function.");'
|
||||
- text: "'<code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code> should return a number."'
|
||||
- text: <code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code> should return a number.
|
||||
testString: 'assert(typeof jaro(tests[0][0],tests[0][1])=="number","<code>jaro()</code> should return a number.");'
|
||||
- text: "'<code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code> should return <code>"+results[0]+"</code>."'
|
||||
- text: <code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code> should return <code>"+results[0]+"</code>.
|
||||
testString: 'assert.equal(jaro(tests[0][0],tests[0][1]),results[0],"<code>jaro(""+tests[0][0]+"",""+tests[0][1]+"")</code> should return <code>"+results[0]+"</code>.");'
|
||||
- text: "'<code>jaro(""+tests[1][0]+"",""+tests[1][1]+"")</code> should return <code>"+results[1]+"</code>."'
|
||||
- text: <code>jaro(""+tests[1][0]+"",""+tests[1][1]+"")</code> should return <code>"+results[1]+"</code>.
|
||||
testString: 'assert.equal(jaro(tests[1][0],tests[1][1]),results[1],"<code>jaro(""+tests[1][0]+"",""+tests[1][1]+"")</code> should return <code>"+results[1]+"</code>.");'
|
||||
- text: "'<code>jaro(""+tests[2][0]+"",""+tests[2][1]+"")</code> should return <code>"+results[2]+"</code>."'
|
||||
- text: <code>jaro(""+tests[2][0]+"",""+tests[2][1]+"")</code> should return <code>"+results[2]+"</code>.
|
||||
testString: 'assert.equal(jaro(tests[2][0],tests[2][1]),results[2],"<code>jaro(""+tests[2][0]+"",""+tests[2][1]+"")</code> should return <code>"+results[2]+"</code>.");'
|
||||
- text: "'<code>jaro(""+tests[3][0]+"",""+tests[3][1]+"")</code> should return <code>"+results[3]+"</code>."'
|
||||
- text: <code>jaro(""+tests[3][0]+"",""+tests[3][1]+"")</code> should return <code>"+results[3]+"</code>.
|
||||
testString: 'assert.equal(jaro(tests[3][0],tests[3][1]),results[3],"<code>jaro(""+tests[3][0]+"",""+tests[3][1]+"")</code> should return <code>"+results[3]+"</code>.");'
|
||||
- text: "'<code>jaro(""+tests[4][0]+"",""+tests[4][1]+"")</code> should return <code>"+results[4]+"</code>."'
|
||||
- text: <code>jaro(""+tests[4][0]+"",""+tests[4][1]+"")</code> should return <code>"+results[4]+"</code>.
|
||||
testString: 'assert.equal(jaro(tests[4][0],tests[4][1]),results[4],"<code>jaro(""+tests[4][0]+"",""+tests[4][1]+"")</code> should return <code>"+results[4]+"</code>.");'
|
||||
|
||||
```
|
||||
|
@ -20,21 +20,21 @@ jortSort is a function that takes a single array of comparable objects as its ar
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>jortsort</code> should be a function."'
|
||||
- text: <code>jortsort</code> should be a function.
|
||||
testString: 'assert(typeof jortsort=="function","<code>jortsort</code> should be a function.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[0])+")</code> should return a boolean."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[0])+")</code> should return a boolean.
|
||||
testString: 'assert(typeof jortsort(tests[0].slice())=="boolean","<code>jortsort("+JSON.stringify(tests[0])+")</code> should return a boolean.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[0])+")</code> should return <code>true</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[0])+")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(jortsort(tests[0].slice()),true,"<code>jortsort("+JSON.stringify(tests[0])+")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[1])+")</code> should return <code>false</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[1])+")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(jortsort(tests[1].slice()),false,"<code>jortsort("+JSON.stringify(tests[1])+")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[2])+")</code> should return <code>false</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[2])+")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(jortsort(tests[2].slice()),false,"<code>jortsort("+JSON.stringify(tests[2])+")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[3])+")</code> should return <code>true</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[3])+")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(jortsort(tests[3].slice()),true,"<code>jortsort("+JSON.stringify(tests[3])+")</code> should return <code>true</code>.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[4])+")</code> should return <code>false</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[4])+")</code> should return <code>false</code>.
|
||||
testString: 'assert.equal(jortsort(tests[4].slice()),false,"<code>jortsort("+JSON.stringify(tests[4])+")</code> should return <code>false</code>.");'
|
||||
- text: "'<code>jortsort("+JSON.stringify(tests[5])+")</code> should return <code>true</code>."'
|
||||
- text: <code>jortsort("+JSON.stringify(tests[5])+")</code> should return <code>true</code>.
|
||||
testString: 'assert.equal(jortsort(tests[5].slice()),true,"<code>jortsort("+JSON.stringify(tests[5])+")</code> should return <code>true</code>.");'
|
||||
|
||||
```
|
||||
|
@ -27,19 +27,19 @@ Write a function that takes the initial number of prisoners and 'k' as parameter
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: "'<code>josephus</code> should be a function."'
|
||||
- text: <code>josephus</code> should be a function.
|
||||
testString: 'assert(typeof josephus=="function","<code>josephus</code> should be a function.");'
|
||||
- text: "'<code>josephus(30,3)</code> should return a number."'
|
||||
- text: <code>josephus(30,3)</code> should return a number.
|
||||
testString: 'assert(typeof josephus(30,3)=="number","<code>josephus(30,3)</code> should return a number.");'
|
||||
- text: "'<code>josephus(30,3)</code> should return <code>29</code>."'
|
||||
- text: <code>josephus(30,3)</code> should return <code>29</code>.
|
||||
testString: 'assert.equal(josephus(30,3),29,"<code>josephus(30,3)</code> should return <code>29</code>.");'
|
||||
- text: "'<code>josephus(30,5)</code> should return <code>3</code>."'
|
||||
- text: <code>josephus(30,5)</code> should return <code>3</code>.
|
||||
testString: 'assert.equal(josephus(30,5),3,"<code>josephus(30,5)</code> should return <code>3</code>.");'
|
||||
- text: "'<code>josephus(20,2)</code> should return <code>9</code>."'
|
||||
- text: <code>josephus(20,2)</code> should return <code>9</code>.
|
||||
testString: 'assert.equal(josephus(20,2),9,"<code>josephus(20,2)</code> should return <code>9</code>.");'
|
||||
- text: "'<code>josephus(17,6)</code> should return <code>2</code>."'
|
||||
- text: <code>josephus(17,6)</code> should return <code>2</code>.
|
||||
testString: 'assert.equal(josephus(17,6),2,"<code>josephus(17,6)</code> should return <code>2</code>.");'
|
||||
- text: "'<code>josephus(29,4)</code> should return <code>2</code>."'
|
||||
- text: <code>josephus(29,4)</code> should return <code>2</code>.
|
||||
testString: 'assert.equal(josephus(29,4),2,"<code>josephus(29,4)</code> should return <code>2</code>.");'
|
||||
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user