DRAW.square = function(x, y, size, color) {
KhanUtil.currentGraph.path([[x - size, y + size], [x + size, y + size], [x + size, y - size],
[x - size, y - size], true ],
{ strokeWidth: 2, stroke: "black", fill: color });
};
DRAW.circle = function(x, y, size, color) {
KhanUtil.currentGraph.circle([x, y], size, { strokeWidth: 2, stroke: "black", fill: color });
};
DRAW.triangle = function(x, y, size, color) {
KhanUtil.currentGraph.path([[x, y + size], [x + (2 * size) / sqrt(3), y - size / sqrt(3)],
[x - (2 * size) / sqrt(3), y - size / sqrt(3)], true],
{ strokeWidth: 2, stroke: "black", fill: color });
};
-
SIZE
$(".add-unique-id").eq(I).attr("id", "unique-" + I);
init({ range: [[-11, 11], [-11, 11]], scale: [5, 5] });
DRAW[SHAPE](0, 0, SIZE, COLORS[I]);
SORTER.init("sortable")
shuffle([4, 5, 6, 7, 8, 9], 4)
_.map(sortNumbers(SIZES), function(el) {
return "ABCD"[_.indexOf(SIZES, el)];
})
Order the plural(SHAPE) from smallest to largest:
Drag the plural(SHAPE) left and right so they are in order from smallest to largest
SORTER.getContent()
return guess.join(",") === SIZES.sort().join(",");
SORTER.setContent(guess);
_(4).times(function(i) {
$("#unique-" + i).data("graphie").label([0, 0], "ABCD"[i]);
});
The
smallest
largest
next smallest
is SHAPE "ABCD"[_.indexOf(SIZES, SIZE)]
, so it goes on the left, so it goes on the right.
init({ range: [[-11, 80], [-11, 11]], scale: [5, 5] });
var x = 0;
_.each(_.first(sortNumbers(SIZES), I + 1), function(size, i) {
DRAW[SHAPE](x, 0, size, COLORS[_.indexOf(SIZES, size)]);
label([x, 0], "ABCD"[_.indexOf(SIZES, size)]);
x += 22;
});
shuffle([4, 5, 6, 7, 8, 9], 4)
_.map(sortNumbers(SIZES).reverse(), function(el) {
return "ABCD"[_.indexOf(SIZES, el)];
})
Order the plural(SHAPE) from largest to smallest:
Drag the plural(SHAPE) left and right so they are in order from largest to smallest
SORTER.getContent()
return guess.join(",") === SIZES.sort().reverse().join(",");
SORTER.setContent(guess);
_(4).times(function(i) {
$("#unique-" + i).data("graphie").label([0, 0], "ABCD"[i]);
});
The
largest
smallest
next largest
is SHAPE "ABCD"[_.indexOf(SIZES, SIZE)]
, so it goes on the left, so it goes on the right.
init({ range: [[-11, 80], [-11, 11]], scale: [5, 5] });
var x = 0;
_.each(_.first(sortNumbers(SIZES).reverse(), I + 1), function(size, i) {
DRAW[SHAPE](x, 0, size, COLORS[_.indexOf(SIZES, size)]);
label([x, 0], "ABCD"[_.indexOf(SIZES, size)]);
x += 22;
});