File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,21 @@ import * as Instructions from './instructions';
27
27
{ pseudocode: String, explanation: String, run: Function }
28
28
*/
29
29
30
- // Very Important: The key for the algorithms must be unique!
30
+ // Very Important: The key for each algorithm MUST be unique!
31
+ // Also: the key for the algorithm MUST be the same as the "name"
32
+ // of the top level Param block returned by the parameter function.
33
+ // Eg, parameters/msort_arr_td.js has
34
+ //
35
+ // function MergesortParam() {
36
+ // ...
37
+ // return (
38
+ // // <>
39
+ // <div className="form">
40
+ // <ListParam
41
+ // name="msort_arr_td" <---- ****SAME AS KEY****
42
+ // ...
43
+ // export default MergesortParam
44
+
31
45
const allalgs = {
32
46
33
47
'heapSort' : {
Original file line number Diff line number Diff line change @@ -253,6 +253,13 @@ export const GlobalActions = {
253
253
} = data ;
254
254
const procedurePseudocode = pseudocode [ params . mode ] ;
255
255
256
+ // Previously if we switched modes from insert to search, the search
257
+ // code had no in-line explanations built.
258
+ // XXX It seems a bit of overkill to redo the explanations whenever
259
+ // the algorithm is re-run (changing mode probable should LOAD the
260
+ // algorithm then separately RUN it) but this works for now...
261
+ addLineExplanation ( procedurePseudocode ) ;
262
+
256
263
// here we pass a function reference to Chunker() because we may want to initialise
257
264
// a visualiser using a previous one
258
265
const chunker = new Chunker ( ( ) =>
You can’t perform that action at this time.
0 commit comments