to continue. (After that any entries made into the worksheet will be automatically saved, and you can re-load the partially-completed worksheet in future - at which point you will be asked to auto-save it again).
Preliminaries
Set the browser to Full Screen view, to give this worksheet, and your code, as much space as possible.
Remember that if the code editor has a tinted background it does not have focus and will not respond
to edits. To give it focus click within the editor. (If a program is running, you will need to stop it first.)
Use the auto-completion options as much as possible, because this reduces errors.
Use the Hints only when you need them - as all use of hints is recorded. Use of Help is encouraged and not recorded.
Step 1: Getting started
From the Demo menu, access the Merge sort code, then select File > Auto Save and complete the dialog to ensure that your code is always saved.
Remember that you can use the Undo button (or Ctrl-z) to undo recent changes.
Note that the code contains two functions:
sort and merge, plus two tests - one to test each function -
with both tests covering multiple test cases (assert instructions).
The asserts in test merge are all showing pass
because the implementation of the merge function is complete and correct.
The asserts in test sort are all failing
with the message: actual: [x]. Looking at the code for the
sort it is not hard to see why: this is merely a 'skeletal' implementation:
sufficient code only to compile, not to run correctly. Your task is to implement sortproperly, until all the tests
pass. Your implementation should:
adopt the 'merge sort' algorithm
make use of the existing merge function
be recursive
result in all tests passing (without modifying those tests)