Skip to content

Commit 88b5ff6

Browse files
committed
Improved various instructions
1 parent 1fed1ae commit 88b5ff6

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

src/algorithms/instructions/index.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@ export const KEY_WORDS = [
1919
KEY_CODE, KEY_INSERT, KEY_PLAY, KEY_SEARCH, KEY_SORT, KEY_LOAD, KEY_INSDEL
2020
];
2121

22+
const PLAY_INSTRUCTIONS = `Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider. You can also pause, single step forwards and backwards and use the progress bar slider. The level of detail can be increased by clicking the ">" on lines of pseudocode; clicking "?" pops up an explanation for the line of code.`;
23+
2224
const bstInstructions = [
2325
{
2426
title: 'Insert Mode', // Specify BST Insertion as Insert mode
2527
content: [
2628
`Click on ${KEY_CODE} on the right panel`,
2729
'Enter a list of nodes in the insert parameter.',
28-
`Click on ${KEY_INSERT} to enter insert mode and load the algorithm.`,
29-
`Click on ${KEY_PLAY} to watch the algorithm run.`,
30+
`Click on ${KEY_INSERT} or hit return to enter insert mode and load the data.`,
31+
PLAY_INSTRUCTIONS,
3032
],
3133
},
3234
{
3335
title: 'Search Mode', // Specify BST Searching as Search mode
3436
content: [
3537
`Click on ${KEY_CODE} on the right panel`,
3638
'Enter a node in the search parameter.',
37-
`Click on ${KEY_SEARCH} to enter search mode and load the algorithm.`,
38-
`Click on ${KEY_PLAY} to watch the algorithm run.`,
39+
`Click on ${KEY_SEARCH} or hit return to enter search mode and load the data.`,
40+
PLAY_INSTRUCTIONS,
3941
],
4042
},
4143
];
@@ -47,8 +49,8 @@ const stringInstructions = [{
4749
content: [
4850
`Click on ${KEY_CODE} on the right panel`,
4951
'Enter a string to search followed by a string to search for, seperated by a comma',
50-
`Click on ${KEY_FIND} to load the algorithm.`,
51-
`Click on ${KEY_PLAY} to watch the algorithm run.`,
52+
`Click on ${KEY_FIND} or hit return to load the data.`,
53+
PLAY_INSTRUCTIONS,
5254
],
5355
}];
5456

@@ -75,10 +77,8 @@ visible`,
7577
Bulk insert is not animated to the same degree as single inserts; it
7678
allows you to pre-fill some of the table quickly.`,
7779

78-
`Click on ${KEY_INSDEL} (or hit return after data input) to enter Insert mode and load the algorithm.`,
79-
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be
80-
adjusted using the speed slider. You can also pause, single step forwards and
81-
backwards and use the progress bar slider.`,
80+
`Click on ${KEY_INSDEL} or hit return to enter Insert mode and load the data.`,
81+
PLAY_INSTRUCTIONS,
8282
'For hashing with chaining, when a chain is not displayed completely it can be revealed by hovering the mouse over the table slot.'
8383
],
8484
},
@@ -88,8 +88,8 @@ backwards and use the progress bar slider.`,
8888
'Make sure table has inserted values before searching.',
8989
`Click on ${KEY_CODE} on the right panel.`,
9090
'Enter an Integer in the Search parameter.',
91-
`Click on ${KEY_SEARCH} to enter Search mode and load the algorithm.`,
92-
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
91+
`Click on ${KEY_SEARCH} or hit return to enter Search mode and load the data.`,
92+
PLAY_INSTRUCTIONS,
9393
],
9494
},
9595
];
@@ -100,8 +100,8 @@ const sortInstructions = [{
100100
content: [
101101
`Click on ${KEY_CODE} on the right panel`,
102102
'Enter a list of numbers in the sort parameter.',
103-
`Click on ${KEY_SORT} to load the algorithm.`,
104-
`Click on ${KEY_PLAY} to watch the algorithm run.`,
103+
`Click on ${KEY_SORT} or hit return to load the data.`,
104+
PLAY_INSTRUCTIONS,
105105
],
106106
}];
107107

@@ -110,13 +110,11 @@ const graphInstructions = [
110110
title: 'To Run Animation',
111111
content: [
112112
`Click on ${KEY_CODE} at the top of the right-hand panel`,
113-
`Either step through the algorithm (click on ${KEY_FORWARD}) or play continuously (click on ${KEY_PLAY}). Code and animation will follow in lockstep.`,
113+
PLAY_INSTRUCTIONS,
114114
`The graph can be chosen (see below; default Graph 1 is shown initially)`,
115-
`Athoer algorithm parameters can be chosen below the
115+
`Other algorithm parameters can be chosen below the
116116
${KEY_PROGRESS} bar; this will reset the animation to the start`,
117-
`Screen layout can be altered (depending on your browser/platform):
118-
the left panel can be rendered invisible by clicking
119-
on the arrow in its middle, the right and bottom panels can be enlarged or shrunk by dragging the ellipsis ("..."), and you can zoom in/out and drag elements in the animation panel`,
117+
`Screen layout can be altered (depending on your browser/platform): the right and bottom panels can be enlarged or shrunk by dragging the ellipsis ("..."), and you can zoom in/out and drag elements in the animation panel`,
120118
]
121119
},
122120
{
@@ -135,12 +133,12 @@ by dragging the "..." up temporarily`,
135133
];
136134

137135
const graphInstructionsTC = [{
138-
title: 'Create Graph ',
136+
title: ' ',
139137
content: [
140138
`Click on ${KEY_CODE} on the right panel`,
141-
'Enter a graph in the transition matrix',
142-
`Click on ${KEY_LOAD} to load the algorithm.`,
143-
`Click on ${KEY_PLAY} to watch the algorithm run.`,
139+
'Enter a graph in the edge matrix',
140+
`Click on ${KEY_LOAD} or hit return to load the data.`,
141+
PLAY_INSTRUCTIONS,
144142
'All nodes are SELF-REACHABLE => All diagonal elements are ones and NOT allowed to be edited.',
145143
],
146144
}];
@@ -152,7 +150,7 @@ const unionFindInstructions = [{
152150
`Use the panel in the lower centre of the screen to control the algorithm visualisation:`,
153151
`Select nodes to union by entering a list of union operations in the left input box and click ${KEY_UF_UNION}.`,
154152
`Click ${KEY_UF_PC_ON} or ${KEY_UF_PC_OFF} to toggle path compression.`,
155-
`Click on ${KEY_PLAY}, ${KEY_PAUSE}, or the ${KEY_BACK} and ${KEY_FORWARD} arrows to watch the algorithm run.`,
153+
PLAY_INSTRUCTIONS,
156154
`Enter a node in the right input box and click ${KEY_UF_FIND} and then ${KEY_PLAY} to search for the node's set representative.`,
157155
]
158156
}];

0 commit comments

Comments
 (0)