SORTER.getContent()
if (SORTER.hasAttempted) {
return guess.join(",") === NUMS_SORT.join(",");
} else {
return "";
}
SORTER.setContent(guess);
Let's use different colors for each number.
NUMS_COLOR
Plot these numbers on a number line. Then we can see which ones are lower and which ones are higher.
init({
range: [[-1, 201], [-1, 1]],
scale: [2.2, 40]
});
style({
stroke: "#666"
}, function() {
graph.nl = numberLine(-100, 100, 25);
});
_.each(graph.nl.labels.slice(1, -1), function(label) {
label.remove();
});
var position = "above";
$.each(NUMS_SORT, function(i, n) {
ellipse([100 + n, 0], [1.88, 0.1], { "stroke-width": 0, fill: NUM_COLORS[n] });
label([100 + n, 0], "\\color{" + NUM_COLORS[n] + "}{" + n + "}", position, { labelDistance: 5 });
position = (position === "above" ? "below" : "above");
} );
Now just read the numbers from left to right on the number line.
The leftmost numbers are least, and the rightmost numbers are greatest.
NUMS_SORT_COLOR