Like my other Card Shuffle task, but using the React.js library to display the cards.
The task given to me was:
- Write a method, function, or procedure that sorts a standard deck of 52 playing cards in ascending order. You are free to determine what the term “ascending order” means for a deck of cards, but be ready to discuss your choice during the interview.
- Write a method, function, or procedure that randomly shuffles a standard deck of 52 playing cards.
So I've created this card-sorter that you can view here: http://www.aaroncody.net/card-shuffle-task/
As well, I was asked to create unit tests for my work. Because this is such a simple set of code, I decided to forgo any testrunners (such as karma) and just wrote some vanilla tests that use the methods and check the work. The results can be viewed here: http://www.aaroncody.net/card-shuffle-task/js/tests.html
To get started:
Run 'npm install node-static' and then run 'node app.js'
Find the page at 'http://localhost:5000/'