Freecodecamp: Problems with layout and tests for various Rosetta Code challenges

Created on 24 Feb 2019  路  19Comments  路  Source: freeCodeCamp/freeCodeCamp

This issue is just to track the changes we're making to the layout of the descriptions and how the tests are rendered. Many of these are minor changes like moving the challenge instructions to the instructions section, or removing <p> tags and/or the space between the function name and the first parenthesis in the seed. I'll submit a PR over the next few days.

More substantial changes are listed below:

  • 24 game: Fixed by @thecodingaviator in #35389
  • 9 billion names of God the integer: Removed the word "Task" and added <ul>
  • ABC Problem: Added <pre> section and <ul>. Reordered some text in the instructions section
  • Abundant, deficient and perfect number classifications: Added <pre> section, inline border style, and bolded some text
  • Accumulator factory: Bolded text, adjusted the description so it's more like the one on Rosetta Code, and wrote new instructions
  • Ackermann function: Fixed MathJax function
  • Align columns: Added ordered list for rules
  • Amicable pairs: Bolded text, added <ol> for example section, removed the word "Task", and removed the "Related Tasks" section
  • Averages/Pythagorean means: Added <ul> list and line breaks for math functions
  • Averages-Root mean square: Added italics and bolded some text
  • Babbage problem: Cleaned up block quote
  • Circles of given radius through two points: Added a couple of <ul>s and bolded some text
  • Closest-pair problem: Bolded text in the code samples, added a <ul> for the resources and further readings, and moved the resources list to the bottom of the description
  • Combinations: Bolded text
  • Comma quibbling: Added <ol> and <ul>
  • Compare a list of strings: Added <ul>
  • Convert seconds to compound duration: Added <ul>s and bolded text
  • Count occurrences of a substring: Added <ul>
  • Count the coins: Added <ul> sections and bolded text
  • Cramer's rule: Cleaned up line breaks in description
  • Cut a rectangle: Fixed image
  • Date format: Added <ul> and bolded text
  • Date manipulation: Removed some line breaks
  • Day of the week: Removed the word "Task"
  • Deal cards for FreeCell: Added lists and bolded some text
  • Define a primitive data type: Added list, and removed unnecessary backslash escape characters and changed some single quotation marks to double quotation marks in the tests
  • Department Numbers: This challenge's description and tests needs some work. Will submit a separate PR for this one.
  • Element-wise operations: Bolded text and added list
  • Emirp primes: Fixed spelling errors, made slight adjustments to description text, and added list
  • Equilibrium index: Added lists
  • Euler method: Added lists
  • Execute a Markov algorithm: Fixed <pre> sections in description and bolded text
  • Execute Brain**: Convert table to markdown table
  • Extensible prime generator: Add list
  • Factorial: Added list and bolded text
  • Factors of a Mersenne number: Added <pre>
  • Factors of an integer: Changed description from "Write a function that returns the factors of a positive integer" to "Write a function that returns the factors of a positive integer as an array"
  • Farey sequence: Added lists
  • Fibonacci n-step number sequences: Added lists and converted table to markdown table
  • Fibonacci word: Added <pre> and bolded text
  • Fractran: Added list and indented text
  • Gaussian elimination: Removed a period from the math function and added some line breaks
  • Generate lower case ASCII alphabet: Changed the example in the description to show that the function will be passed an array with two letters to represent the range, rather than two numbers
  • Gray code: Fixed code examples
  • Greatest subsequential sum: Adjusted spacing in some of the testString arrays so they're consistent throughout
  • Hailstone sequence: Added lists
  • Happy numbers: Added link, bolded some text
  • Harshad or Niven series: Bolded text
  • Hash from two arrays: Added list
  • Hash join: Added lists, fixed <pre> section, and edited the instructions for clarity
  • Heronian triangles: Bolded text, fixed math functions and added a left margin to them
  • Hofstadter Figure-Figure sequences: Fixed math function and added a left margin to it, bolded text, added list
  • Hofstadter Q sequence: Fixed math function and added a left margin to it, and edited the instructions for clarity
  • I before E except after C: Fixed list and edited the instructions for clarity
  • Identity matrix: Fixed mathematical function and added list
  • Jaro distance: Bolded text, fixed list
  • S-Expressions: Fixed spacing, links, and <pre> section
  • Sailors, coconuts and a monkey problem: Fixed spacing, links, and bolded text
  • SEDOLs: Fixed spacing and made a edited the last sentence of the description slightly by removing the word "also" and adding "an"
  • Sort disjoint sublist: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sort stability: Fixed <pre> section, spacing, and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sort using a custom comparator: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Bead sort: Changed the description from "Algorithm has O(S)..." to "The algorithm has O(S)...", and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Bogosort: Fixed <pre> section and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"

    • Sorting algorithms/Cocktail sort: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"

  • Sorting algorithms/Comb sort: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Gnome sort: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Pancake sort: Added some spacing to the pseudocode and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Shell sort: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sorting algorithms/Strand sort: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Soundex: Fixed list
  • Spiral matrix: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Split a character string based on change of character: Fixed <pre> section and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • State name puzzle: Fixed links and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Stream Merge: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Strip control codes and extended characters from a string: Removed a couple of redundant sentences. In the original challenge it's a list, but here there would only be one item in that list that basically repeats the first sentence.
  • Sudoku: Edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Sum of a series: Added left margin to math functions
  • Sum to 100: Removed the word "Note"
  • Sutherland-Hodgman polygon clipping: Changed math functions to <pre> so users can scroll horizontally
  • Symmetric difference: Removed the word "Note" and edited the testString of the second test, changing it from "...should return a array" to "...should return an array"
  • Taxicab numbers: Added lists, bolded text, added left margin to taxicab number examples, added <code> tags to the 5th and 6th tests, and fixed grammatical error in instructions, chaging "it's" to "its"
  • Tokenize a string with escaping: Added lists, <pre> section, and fixed spelling error, changing "quatro" to "cuatro"
  • Top rank per group: Added <code> tags and removed a commented out console.log call in the solution
  • Topological sort: Added list and fixed links
  • Towers of Hanoi: Fixed spacing in description and added spacing between arrays in the testStrings
  • Vector cross product: Fixed spacing in description and instructions, removed "i.e." from the instructions, and changed the seed from function crossProduct() {... to function crossProduct(a, b) {... since the function should take two arrays as parameters
  • Vector dot product: Fixed spacing in description and instructions, removed "i.e." from the instructions, and changed the seed from function dotProduct() {... to function dotProduct(...vectors) {... since the function should take any number of arrays as parameters
  • Word wrap: Fixed spacing in the description and instructions
  • Y combinator: Fixed spacing, bolded text, and added list.
  • Zeckendorf number representation: Fixed by @thecodingaviator in #35474
  • Zhang-Suen thinning algorithm: Fixed by @thecodingaviator in #35472
  • Zig-zag matrix: Fixed by @thecodingaviator in #35403

Duplicate challenges that have been skipped and will be removed in #35547:

  • Sorting algorithms - Bubble sort
  • Sorting algorithms - Counting sort
  • Sorting algorithms - Heapsort
  • Sorting algorithms - Insertion sort
  • Sorting algorithms - Merge sort
  • Sorting algorithms - Quicksort
  • Sorting algorithms - Radix sort
  • Sorting algorithms - Selection sort

All 19 comments

Okay, I definitely misunderstood something there, I've made one PR, sorry for that @scissorsneedfoodtoo , didn't realize that you were doing these until I read it again for like the 5th time 馃う

@thecodingaviator, sorry about that! I see how what I wrote can be confusing. I'll go back and make things more clear.

The changes in your PR look great, so I'll revert the changes I made to the 24 Game challenge.

Would you like to help me go over the other challenges? If so, you could start from the end of the list at Z and I'll keep working from the top. There are a few challenges that need to be removed since they're duplicates, though, and I'll make a note of those in my first comment.

@scissorsneedfoodtoo I'd be glad to. Will start working up the list!

@thecodingaviator, thanks! Really appreciate the help.

@raisedadead, @Bouncey, some of the challenges like "Cut a rectangle" use pictures. Is there a place we can host the pictures ourselves?

We frown upon pictures. But unless they are an absolute necessity, you can add them to our CDN repo https://github.com/freecodecamp/cdn

These are served from https://cdn.freecodecamp.org

We frown upon pictures. But unless they are an absolute necessity

To add further to this. If a picture is the only way to go, please use a REALLY good alt description.

I can see why pictures would be frowned upon. Here's the picture in question:

rect-cut

So not strictly necessary, but definitely a useful visualization for this challenge. Right now on freecodecamp.rocks we just have a link to the image on Rosetta Code. I was thinking, since it's an svg we could just have the code in the description rather than linking to it from the CDN repo. Would that and a good alt description be a good alternative? Adding aria-hidden="true" should hide the wall of text from screen readers, too.

@scissorsneedfoodtoo Are we also moving the challenge instruction to the instructions div or we're leaving it in the description only?

@thecodingaviator, I would probably say it's fine just to leave the challenge instructions where they are. Which challenge are you working on?

@scissorsneedfoodtoo , @thecodingaviator We have a PR for the APIs and Microservices challenges where we are moving instructions to the Instructions sections (where applicable). Some of the challenges in those sections only have instructions. In those cases, we have been leaving everything in the Description section.

I think it makes the challenge clear about what is info vs. instructions.

@RandellDawson, thanks for the info! I took a look but couldn't find that particular PR. Could you post a link? I'd like to do the same here if possible. There's usually a last sentence or two in the description that could be moved to the instructions section.

@scissorsneedfoodtoo I was still working on my PR (#35442) a the time I responded earlier. It is one of several PRs addressing issue #35413 which is tracking similar changes to all the challenges in in the back-end challenges.

@scissorsneedfoodtoo I was waiting for your input on whether we are moving instructions to the instructions section. I currently haven't moved ahead the Zig Zag challenge

@RandellDawson, thank you for the links! Those examples will be really helpful here.

@thecodingaviator, sorry for the late response. I take back what I said earlier about leaving the instructions in the description. It would be better to move them to the instruction section. Usually it's the last couple of sentences in the description, or anything after "Task".

@scissorsneedfoodtoo Alright! That's how I'll proceed with it now 馃憤

@thecodingaviator, alright, sounds great! Thanks again for all your help here. I'll review your PRs as they come in.

@scissorsneedfoodtoo Hey, I'm interested in working on this. I was busy recently so I was not able to ask before.

Hey @Nirajn2311! The actual formatting and fixes for most of these problems are done, but it would be great if you could help review a couple of PRs.

If you would rather work on one of the problems, I noticed that the tests and description for "Department Numbers" could use some work.

@scissorsneedfoodtoo PR #35487 is already merged, and I'll go through the other PR this weekend.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jurijuri picture jurijuri  路  3Comments

itsmikewest picture itsmikewest  路  3Comments

QuincyLarson picture QuincyLarson  路  3Comments

DaphnisM picture DaphnisM  路  3Comments

trashtalka3000 picture trashtalka3000  路  3Comments