@openbooknetwork/hesap 0.0.0-stage → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -2
  3. package/package.json +45 -4
  4. package/scripts/assemble.mjs +40 -0
  5. package/src/client.css +240 -0
  6. package/src/client.js +111 -0
  7. package/src/families/counters/bonds.js +424 -0
  8. package/src/families/counters/client.css +150 -0
  9. package/src/families/counters/client.js +22 -0
  10. package/src/families/counters/count-figures.js +166 -0
  11. package/src/families/counters/count-goals.js +57 -0
  12. package/src/families/counters/count-model.js +57 -0
  13. package/src/families/counters/count.js +322 -0
  14. package/src/families/counters/count.mjs +88 -0
  15. package/src/families/counters/counter.js +52 -0
  16. package/src/families/counters/driver.js +16 -0
  17. package/src/families/counters/figures.js +172 -0
  18. package/src/families/counters/frame.js +28 -0
  19. package/src/families/counters/goals.js +75 -0
  20. package/src/families/counters/i18n/en.yaml +86 -0
  21. package/src/families/counters/i18n/tr.yaml +86 -0
  22. package/src/families/counters/index.mjs +104 -0
  23. package/src/families/counters/model.js +86 -0
  24. package/src/families/counters/move.js +44 -0
  25. package/src/families/counters/places.js +45 -0
  26. package/src/families.mjs +5 -0
  27. package/src/i18n/en.yaml +101 -0
  28. package/src/i18n/tr.yaml +101 -0
  29. package/src/index.mjs +82 -0
  30. package/src/kit/dom.js +32 -0
  31. package/src/kit/drag.js +40 -0
  32. package/src/kit/format.js +34 -0
  33. package/src/kit/goal.js +49 -0
  34. package/src/kit/i18n/en.yaml +15 -0
  35. package/src/kit/i18n/tr.yaml +15 -0
  36. package/src/kit/kit.css +89 -0
  37. package/src/kit/motion.js +44 -0
  38. package/src/kit/panel.js +70 -0
  39. package/src/kit/play.js +26 -0
  40. package/src/kit/random.js +35 -0
  41. package/src/kit/text.js +25 -0
  42. package/src/node.mjs +50 -0
@@ -0,0 +1,88 @@
1
+ // The Node half of the count scene: objects counted one by one. It checks a page's fields and says what each link
2
+ // shows when the page opens.
3
+ import { schema } from '@openbooknetwork/kitap';
4
+ import { COUNT_LOOKS, TAPS, ROOM, STOP, STEPS, modeOf, sizeOf, opening, counts, measuresOf } from './count-model.js';
5
+ import { COUNT_GOALS, LOOSE, countStart } from './count-goals.js';
6
+ import { numbers } from '../../kit/format.js';
7
+ import { list, challenge, drawn, value } from '../../node.mjs';
8
+
9
+ const { z, check } = schema;
10
+ const Int = z.number().int();
11
+ const Range = z.tuple([Int, Int]);
12
+ const Stepper = z.object({ stepper: Range, start: Int.optional() }).strict();
13
+ const Fields = z.object({
14
+ look: z.enum(COUNT_LOOKS).default('tray'), // The place the objects lie in, or a world page.
15
+ n: Int.min(0).max(100).optional(), // The objects as the page opens, or the passengers on the bus.
16
+ rows: z.boolean().default(false), // The objects stand in rows of ten, a hundred unless n says less.
17
+ tap: z.enum(TAPS).optional(), // What a tap on an object does.
18
+ drag: z.boolean().default(false), // The reader moves the objects anywhere in the tray.
19
+ clear: z.boolean().default(false), // A Clear button takes every number off.
20
+ path: z.boolean().default(false), // A line joins the objects in the order they were counted.
21
+ counted: z.boolean().default(false), // Every object holds its number as the page opens.
22
+ box: z.union([Int, Stepper]).optional(), // A closed box holds this many, and counting goes on from it.
23
+ pile: Int.min(1).max(LOOSE).optional(), // A pile of counters to put beside the box.
24
+ marker: z.union([Int, Stepper]).optional(), // A marker on one counter of the rows.
25
+ waiting: Int.min(0).max(STOP).optional(), // The people at the bus stop.
26
+ step: z.union([Int, Stepper]).optional(), // The step of the staircase the walker stands on.
27
+ readout: z.array(z.string()).default([]),
28
+ // A challenge names a goal of count-goals.js and the ranges it draws its targets from.
29
+ challenge: z.object({ goal: z.string(), target: Range.optional(), box: Range.optional(), more: Range.optional(),
30
+ start: Range.optional(), less: Range.optional() }).strict().optional(),
31
+ }).strict();
32
+
33
+ // The fields each kind of page uses. read fails a field that the page's kind leaves unused.
34
+ const USES = {
35
+ tag: ['look', 'n', 'rows', 'tap', 'drag', 'clear', 'path', 'counted', 'box'], again: ['look', 'n', 'tap', 'clear'],
36
+ place: ['look', 'n', 'rows', 'tap'], take: ['look', 'n', 'rows', 'tap'], marker: ['look', 'n', 'rows', 'marker'],
37
+ pile: ['look', 'box', 'pile'], bus: ['look', 'n', 'waiting'], stairs: ['look', 'step'],
38
+ };
39
+ const DEFAULTS = { look: 'tray', rows: false, drag: false, clear: false, path: false, counted: false };
40
+
41
+ function read(fields, { at }, ctx) {
42
+ const pg = check(Fields, fields, at), fail = words => ctx.fail(at, words);
43
+ const box = value(pg.box), marker = value(pg.marker), step = value(pg.step);
44
+ const spec = { ...pg, scene: 'count', box: box.n, boxCtl: box.ctl, marker: marker.n, markerCtl: marker.ctl, step: step.n, stepCtl: step.ctl };
45
+ for (const [v, name] of [[box, 'box'], [marker, 'marker'], [step, 'step']]) if (v.ctl && (v.ctl.lo > v.ctl.hi || v.n < v.ctl.lo || v.n > v.ctl.hi)) fail(`${name} has the range [${v.ctl.lo}, ${v.ctl.hi}] and starts at ${v.n}, write [low, high] and a start between them`);
46
+ if (pg.challenge) { readChallenge(pg, spec, at, ctx); return { data: spec, has: () => false, offers: 'nothing, a challenge page draws its numbers as it opens' }; }
47
+
48
+ const mode = modeOf(spec), n = sizeOf(spec);
49
+ if (!mode) fail(`tap is missing, write what a tap on an object does: ${list(TAPS)}`);
50
+ for (const [f, v] of Object.entries(pg)) if (!['readout', ...(USES[mode] ?? [])].includes(f) && v !== undefined && v !== DEFAULTS[f]) fail(`${f} belongs to other pages, leave it out of this one`);
51
+ if (mode === 'stairs' && (step.n == null || step.n < 0 || (step.ctl?.hi ?? step.n) > STEPS)) fail(`step is missing or past the staircase, write a step from 0 to ${STEPS}, or { stepper: [0, ${STEPS}], start: 3 }`);
52
+ if (mode === 'bus' && (pg.n == null || pg.waiting == null || pg.n + pg.waiting > STOP)) fail(`n and waiting are the people on the bus and at the stop, write both, ${STOP} people in all at most`);
53
+ if (mode === 'pile' && (box.n == null || box.n < 0)) fail('box is missing, write the number the closed box holds, such as 5, or { stepper: [3, 20], start: 5 }');
54
+ if (mode === 'marker' && (!pg.rows || (marker.ctl?.lo ?? marker.n) < 1 || (marker.ctl?.hi ?? marker.n) > n)) fail(`marker stands on a counter of the rows, write rows: true and a marker from 1 to ${n}`);
55
+ if (['tag', 'again', 'place', 'take'].includes(mode)) {
56
+ const room = pg.rows ? 100 : ROOM[pg.look];
57
+ if (!room) fail(`the ${pg.look} look has no objects to tap, use one of ${list(Object.keys(ROOM))}`);
58
+ else if (!n || n > room) fail(`n is ${n || 'missing'}, the ${pg.rows ? 'rows hold' : `${pg.look} holds`} from 1 to ${room} objects`);
59
+ if (pg.rows && pg.look !== 'tray') fail('rows stand in the tray, leave look out');
60
+ if (mode === 'place' && !pg.rows) fail('a tap shows the number of a counter in the rows, write rows: true');
61
+ if (pg.drag && (pg.rows || pg.look === 'wire')) fail('drag moves loose objects, the rows and the wire hold theirs in place');
62
+ if (box.ctl) fail('box is a number on this page, the tapped objects count on from it');
63
+ if (pg.counted && (box.n != null || pg.clear)) fail('counted opens with the objects numbered from 1, leave box and clear out');
64
+ }
65
+ const ids = measuresOf(spec);
66
+ for (const id of pg.readout) if (!ids.includes(id)) fail(`readout names "${id}", this page reads out ${list(ids)}`);
67
+ return { data: spec, has: id => ids.includes(id), offers: `one of ${list(ids)}` };
68
+ }
69
+
70
+ // A challenge page names its goal, which draws from the page's ranges. Every target it can draw must be open as the
71
+ // page starts and in reach of the page's controls.
72
+ function readChallenge(pg, spec, at, ctx) {
73
+ const c = pg.challenge, goal = challenge(c, COUNT_GOALS, { scene: 'count', at, ctx });
74
+ if (!goal) return;
75
+ for (const [f, v] of Object.entries(pg)) if (f !== 'challenge' && v !== undefined && v !== DEFAULTS[f] && !(f === 'readout' && !v.length)) ctx.fail(at, `${f} is set by challenge.goal ${c.goal}, leave it out`);
76
+ const problem = goal.problem(c, spec);
77
+ if (problem) return ctx.fail(at, `challenge.${problem}`);
78
+ drawn(goal, c, spec, { at, ctx, starts: countStart });
79
+ }
80
+
81
+ // A link shows a count as the page opens. A total shows once every object has its number, so no text links it.
82
+ function start(spec, lang, id) {
83
+ if (!measuresOf(spec).includes(id)) return null;
84
+ const v = counts(spec, opening(spec))[id];
85
+ return v == null ? null : numbers(lang).int(v);
86
+ }
87
+
88
+ export default { read, start };
@@ -0,0 +1,52 @@
1
+ // A counter of the family: a disc, a bead, a car, or one of the objects the count scene counts, such as an apple or a
2
+ // bird. Every scene of the family draws its counters here.
3
+ import { svg as el } from '../../kit/dom.js';
4
+
5
+ // The radius of a counter in the figure's units, and the reach of its touch target, about 44px across on a phone.
6
+ export const R = 16, HIT = 22;
7
+
8
+ // The objects of the count scene. Each stands round 0, 0 inside a circle of radius r, apart from the walker, who
9
+ // stands on 0, 0.
10
+ const OBJECTS = {
11
+ apple: r => [el('path', { class: 'counters-stem', d: `M 0 ${-r * 0.7} Q 1 ${-r * 1.05} 4 ${-r * 1.2}` }), el('ellipse', { class: 'counters-leaf', cx: r * 0.42, cy: -r * 1.02, rx: r * 0.34, ry: r * 0.16, transform: `rotate(-25 ${r * 0.42} ${-r * 1.02})` }),
12
+ el('path', { class: 'counters-body', d: `M 0 ${-r * 0.62} C ${r * 0.5} ${-r * 0.95} ${r * 1.05} ${-r * 0.6} ${r * 0.95} 0 C ${r * 0.88} ${r * 0.62} ${r * 0.4} ${r * 0.98} 0 ${r * 0.82} C ${-r * 0.4} ${r * 0.98} ${-r * 0.88} ${r * 0.62} ${-r * 0.95} 0 C ${-r * 1.05} ${-r * 0.6} ${-r * 0.5} ${-r * 0.95} 0 ${-r * 0.62} Z` }),
13
+ el('ellipse', { class: 'counters-shine', cx: -r * 0.4, cy: -r * 0.25, rx: r * 0.16, ry: r * 0.28 })],
14
+ bird: r => [el('path', { class: 'counters-body', d: `M ${-r * 1.15} ${-r * 0.1} L ${-r * 0.55} ${-r * 0.15} Q ${-r * 0.2} ${-r * 0.75} ${r * 0.45} ${-r * 0.55} Q ${r * 0.95} ${-r * 0.95} ${r * 1.05} ${-r * 0.35} L ${r * 1.35} ${-r * 0.25} L ${r * 1.0} ${-r * 0.1} Q ${r * 0.85} ${r * 0.6} ${-r * 0.1} ${r * 0.55} Q ${-r * 0.6} ${r * 0.4} ${-r * 0.75} ${r * 0.1} Z` }),
15
+ el('circle', { class: 'counters-eye', cx: r * 0.72, cy: -r * 0.48, r: r * 0.1 }), el('path', { class: 'counters-feet', d: `M ${-r * 0.1} ${r * 0.5} L ${-r * 0.1} ${r * 0.85} M ${r * 0.25} ${r * 0.5} L ${r * 0.25} ${r * 0.85}` })],
16
+ shell: r => [el('path', { class: 'counters-body', d: `M 0 ${r * 0.9} L ${-r * 0.95} ${-r * 0.05} Q ${-r * 0.75} ${-r * 0.95} 0 ${-r * 0.95} Q ${r * 0.75} ${-r * 0.95} ${r * 0.95} ${-r * 0.05} Z` }),
17
+ el('path', { class: 'counters-ribs', d: [-0.6, -0.3, 0, 0.3, 0.6].map(k => `M 0 ${r * 0.8} L ${k * r * 1.1} ${-r * 0.8}`).join(' ') }),
18
+ el('rect', { class: 'counters-body', x: -r * 0.32, y: r * 0.72, width: r * 0.64, height: r * 0.3, rx: r * 0.1 })],
19
+ person: r => [el('path', { class: 'counters-body', d: `M ${-r * 0.8} ${r} Q ${-r * 0.8} ${r * 0.05} 0 ${r * 0.05} Q ${r * 0.8} ${r * 0.05} ${r * 0.8} ${r} Z` }),
20
+ el('circle', { class: 'counters-skin', cy: -r * 0.42, r: r * 0.42 })],
21
+ walker: r => [el('path', { class: 'counters-legs', d: `M ${-r * 0.2} ${-r} L ${-r * 0.3} 0 M ${r * 0.2} ${-r} L ${r * 0.35} 0` }),
22
+ el('rect', { class: 'counters-body', x: -r * 0.45, y: -r * 2.05, width: r * 0.9, height: r * 1.2, rx: r * 0.35 }),
23
+ el('circle', { class: 'counters-skin', cy: -r * 2.5, r: r * 0.42 })],
24
+ };
25
+
26
+ function glyph(kind, r) {
27
+ if (OBJECTS[kind]) return OBJECTS[kind](r);
28
+ if (kind === 'bead') return [el('circle', { class: 'counters-body', r }), el('circle', { class: 'counters-shine', r: r * 0.32, cx: -r * 0.35, cy: -r * 0.35 })];
29
+ if (kind === 'car') {
30
+ const w = r * 1.5, l = r * 2.5;
31
+ return [el('rect', { class: 'counters-body', x: -w / 2, y: -l / 2, width: w, height: l, rx: r * 0.45 }),
32
+ el('rect', { class: 'counters-glass', x: -w / 2 + 3, y: -l / 2 + l * 0.2, width: w - 6, height: l * 0.2, rx: 3 }),
33
+ el('rect', { class: 'counters-glass', x: -w / 2 + 3, y: l * 0.2, width: w - 6, height: l * 0.14, rx: 3 })];
34
+ }
35
+ return [el('circle', { class: 'counters-body', r }), el('circle', { class: 'counters-ring', r: r * 0.6 })];
36
+ }
37
+
38
+ // A car park holds cars of several colours, so each car takes one of PAINTS by its number.
39
+ const PAINTS = 6;
40
+
41
+ // counter makes the elements of one counter. g takes the place in the figure, and pop takes the motion, because a
42
+ // CSS transform on an element would override its transform attribute. n is the counter's number among its kind.
43
+ export function counter(kind, colour, r = R, n = 0) {
44
+ const pop = el('g', { class: 'counters-pop a' }, [el('circle', { class: 'counters-hit', r: Math.max(r, HIT) }), ...glyph(kind, r)]);
45
+ const paint = kind === 'car' || kind === 'person' ? ` counters-paint-${n % PAINTS}` : '';
46
+ const g = el('g', { class: `counters-counter counters-${colour} counters-${kind}${paint}` }, [pop]);
47
+ return { g, pop, at: { x: 0, y: 0 }, colour };
48
+ }
49
+
50
+ // show draws a counter where its at says, and put moves it there.
51
+ export const show = c => c.g.setAttribute('transform', `translate(${c.at.x} ${c.at.y})`);
52
+ export const put = (c, p) => { c.at.x = p.x; c.at.y = p.y; show(c); };
@@ -0,0 +1,16 @@
1
+ // The motion of the counters family, run on the page's motion tracker, in milliseconds. Every motion marks a change
2
+ // the reader made, and the scene skips it when the reader asked for less motion.
3
+ export function driver(fx) {
4
+ return {
5
+ // tween moves the numbers of a plain object, such as a counter's place, and draw follows each step.
6
+ tween: (obj, to, draw, duration = 380, ease = 'outCubic') => fx.run(obj, { ...to, duration, ease, onUpdate: draw }),
7
+ // A counter that arrives grows into its place, after delay milliseconds.
8
+ pop: (el, delay = 0) => fx.run(fx.centre(el), { scale: [0.2, 1.12, 1], opacity: [0, 1], duration: 340, delay, ease: 'outQuad' }),
9
+ // A counter that leaves shrinks away, and done takes it off the page also when a page change cuts it short.
10
+ vanish: (el, done) => fx.run(fx.centre(el), { scale: [1, 0.2], opacity: [1, 0], duration: 240, ease: 'inQuad' }, done, done),
11
+ // A value or a slot that changed jumps once.
12
+ flash: el => fx.flash(el),
13
+ // The counters that reach a goal swell one after another.
14
+ cheer: els => fx.cheer(els),
15
+ };
16
+ }
@@ -0,0 +1,172 @@
1
+ // The blocks a bonds figure is built from: the part-whole diagram, the hands, the list of splits, the lane of pins,
2
+ // the car park, and the trays of the challenges. A block offers one or more ways to be set out, each with its size
3
+ // and a draw that puts it at a corner. draw gives the block's nodes, its places for counters and the parts the
4
+ // scene updates.
5
+ import { svg as el } from '../../kit/dom.js';
6
+ import { R } from './counter.js';
7
+ import { cluster, reach, grid, heap, HEAP } from './places.js';
8
+
9
+ export const GAP = 38; // Counters in a part or a tray stand this far apart.
10
+ const RW = 34; // The radius of the whole's circle.
11
+ const DROP = 40; // The gap between the whole's circle and the parts' circles.
12
+ const BETWEEN = 20; // The gap between the two parts.
13
+
14
+ export const txt = (cls, x, y, s = '') => { const t = el('text', { class: cls, x, y }); t.textContent = s; return t; };
15
+ const at = (c, p) => ({ x: c.x + p.x, y: c.y + p.y });
16
+ const near = (c, rad) => p => Math.hypot(p.x - c.x, p.y - c.y) < rad;
17
+
18
+ // cup draws a cup that covers a circle of radius r round 0, 0 and the number under it.
19
+ function cup(r, foot) {
20
+ const top = -r - 6, w = r * 1.25;
21
+ return el('g', { class: 'counters-cup' }, [
22
+ el('path', { class: 'counters-cup-body', d: `M ${-w} ${foot} L ${-w * 0.78} ${top} Q 0 ${top - 10} ${w * 0.78} ${top} L ${w} ${foot} Z` }),
23
+ el('rect', { class: 'counters-cup-rim', x: -w - 4, y: foot - 10, width: 2 * w + 8, height: 12, rx: 5 }),
24
+ el('rect', { class: 'counters-cup-knob', x: -10, y: top - 18, width: 20, height: 14, rx: 5 }),
25
+ ]);
26
+ }
27
+
28
+ // parts is the diagram whose two part circles hold counters. max gives the most counters each part holds. A part
29
+ // with a cup is a small circle whose number shows when the cup lifts.
30
+ export function parts({ max: [ml, mr], cupped = false, gap = GAP, r = R }) {
31
+ const radius = m => Math.max(50, reach(m, gap) + r + 6), rl = radius(ml), rr = cupped ? 50 : radius(mr), big = Math.max(rl, rr);
32
+ const w = 2 * rl + BETWEEN + 2 * rr, py = 2 * RW + DROP + big, h = py + big + 30;
33
+ return [{ w, h, draw(x, y) {
34
+ const W = { x: x + w / 2, y: y + RW }, L = { x: x + rl, y: y + py }, Rt = { x: x + 2 * rl + BETWEEN + rr, y: y + py };
35
+ const ring = (c, rad, cls, ref) => el('circle', { class: cls, cx: c.x, cy: c.y, r: rad, 'data-ref': ref });
36
+ const whole = txt('counters-big', W.x, W.y), left = txt('counters-badge', L.x, L.y + rl + 18), right = txt('counters-badge', Rt.x, Rt.y + rr + 18);
37
+ const hidden = txt('counters-big', Rt.x, Rt.y);
38
+ const nodes = [el('line', { class: 'counters-link', x1: W.x, y1: W.y, x2: L.x, y2: L.y }), el('line', { class: 'counters-link', x1: W.x, y1: W.y, x2: Rt.x, y2: Rt.y }),
39
+ ring(W, RW, 'counters-whole', 'whole'), ring(L, rl, 'counters-part', 'first'), ring(Rt, rr, 'counters-part', 'second'), whole, left, ...(cupped ? [hidden] : [right])];
40
+ const place = (c, rad) => ({ pos: (i, n) => at(c, cluster(n, gap)[i]), r, hit: near(c, rad + 30), c, rad });
41
+ const lid = cupped ? cup(rr, rr + 30) : null;
42
+ return { nodes, places: { left: place(L, rl), right: place(Rt, rr) }, refs: { whole, badges: [left, cupped ? null : right], hidden, cup: lid && { g: lid, home: Rt, r: rr } } };
43
+ } }];
44
+ }
45
+
46
+ // numerals is the small diagram over the frames, with a number in each circle. The frames hold the counters.
47
+ export function numerals({ cupped = false }) {
48
+ const rp = 32, w = 260, h = 2 * RW + 30 + 2 * rp + 4;
49
+ return [{ w, h, draw(x, y) {
50
+ const W = { x: x + w / 2, y: y + RW }, L = { x: x + rp + 24, y: y + h - rp - 4 }, Rt = { x: x + w - rp - 24, y: L.y };
51
+ const whole = txt('counters-big', W.x, W.y), left = txt('counters-big', L.x, L.y), right = txt('counters-big', Rt.x, Rt.y);
52
+ const nodes = [el('line', { class: 'counters-link', x1: W.x, y1: W.y, x2: L.x, y2: L.y }), el('line', { class: 'counters-link', x1: W.x, y1: W.y, x2: Rt.x, y2: Rt.y }),
53
+ el('circle', { class: 'counters-whole', cx: W.x, cy: W.y, r: RW, 'data-ref': 'whole' }), el('circle', { class: 'counters-part counters-a-ring', cx: L.x, cy: L.y, r: rp, 'data-ref': 'first' }),
54
+ el('circle', { class: 'counters-part counters-b-ring', cx: Rt.x, cy: Rt.y, r: rp, 'data-ref': 'second' }), whole, left, right];
55
+ return { nodes, places: {}, refs: { whole, badges: [left, cupped ? null : right], hidden: right, cup: cupped ? { g: cup(rp, rp + 8), home: Rt, r: rp } : null } };
56
+ } }];
57
+ }
58
+
59
+ // hands are two open hands, each holding one part.
60
+ export function hands({ max, gap = 34, r = R }) {
61
+ const rx = Math.max(72, reach(max, gap) + r + 16), ry = rx * 0.76, fingers = 56, apart = 40, side = 26, w = 4 * rx + apart + 2 * side, h = fingers + 2 * ry + 30;
62
+ return [{ w, h, draw(x, y) {
63
+ const one = (cx, out) => {
64
+ const cy = y + fingers + ry, parts = [];
65
+ [-0.56, -0.19, 0.19, 0.56].forEach((k, i) => {
66
+ const fx = cx + k * rx, len = [60, 72, 74, 62][out < 0 ? i : 3 - i];
67
+ parts.push(el('rect', { class: 'counters-hand', x: fx - 15, y: cy - ry - len + 28, width: 30, height: len + 20, rx: 15, transform: `rotate(${k * 14} ${fx} ${cy - ry + 30})` }));
68
+ });
69
+ const tx = cx + out * rx * 0.88, ty = cy + ry * 0.1;
70
+ parts.push(el('ellipse', { class: 'counters-hand', cx: tx, cy: ty, rx: 17, ry: 38, transform: `rotate(${out * 48} ${tx} ${ty + 22})` }));
71
+ parts.push(el('ellipse', { class: 'counters-hand counters-palm', cx, cy, rx, ry }));
72
+ return { g: el('g', {}, parts), c: { x: cx, y: cy + 4 }, cy };
73
+ };
74
+ // Open hands hold their palms up, so the left hand has its thumb on the left and the right hand is its mirror.
75
+ const L = one(x + side + rx, -1), Rt = one(x + side + 3 * rx + apart, 1);
76
+ const left = txt('counters-badge', L.c.x, L.cy + ry + 18), right = txt('counters-badge', Rt.c.x, Rt.cy + ry + 18);
77
+ const place = c => ({ pos: (i, n) => at(c, cluster(n, gap)[i]), r, hit: near(c, rx + 20), c, rad: rx });
78
+ return { nodes: [L.g, Rt.g, left, right], places: { left: place(L.c), right: place(Rt.c) }, refs: { badges: [left, right] } };
79
+ } }];
80
+ }
81
+
82
+ // list holds a slot for every split, from 0 and the whole to the whole and 0, as a column or as rows of four.
83
+ export function splits(ways) {
84
+ const sw = 80, sh = 30, step = sh + 6, head = 30;
85
+ const way = (cols) => {
86
+ const rows = Math.ceil(ways / cols), w = cols * sw + (cols - 1) * 8;
87
+ return { w, h: head + rows * step, draw(x, y) {
88
+ const slots = Array.from({ length: ways }, (_, i) => {
89
+ const sx = x + (i % cols) * (sw + 8), sy = y + head + Math.floor(i / cols) * step;
90
+ const rect = el('rect', { class: 'counters-slot-box', x: sx, y: sy, width: sw, height: sh, rx: 6 }), text = txt('counters-slot-text', sx + sw / 2, sy + sh / 2);
91
+ return { g: el('g', { class: 'counters-slot a' }, [rect, text]), text };
92
+ });
93
+ const title = txt('counters-list-title', x + w / 2, y + 10);
94
+ return { nodes: [title, el('g', { 'data-ref': 'found' }, slots.map(s => s.g))], places: {}, refs: { slots, title } };
95
+ } };
96
+ };
97
+ return [way(1), way(ways > 8 ? 4 : 3)];
98
+ }
99
+
100
+ // A bowling pin's outline, standing on 0, 0.
101
+ const PIN = 'M -7 0 C -13 -12 -12 -26 -6 -36 C -4 -40 -5 -44 -5 -48 C -6 -56 -3 -62 0 -62 C 3 -62 6 -56 5 -48 C 5 -44 4 -40 6 -36 C 12 -26 13 -12 7 0 Z';
102
+ // pins stand at the end of a lane in rows of 4, 3, 2 and 1. Cell 0 is the head pin at the front.
103
+ export function pins() {
104
+ const dx = 58, dy = 46, w = 4 * dx + 56, h = 70 + 3 * dy + 40;
105
+ return [{ w, h, draw(x, y) {
106
+ const spots = [], order = [[3, 1], [2, 2], [1, 3], [0, 4]];
107
+ for (const [row, n] of order) for (let k = 0; k < n; k++) spots.push({ x: x + w / 2 + (k - (n - 1) / 2) * dx, y: y + 70 + row * dy });
108
+ const lane = el('rect', { class: 'counters-lane', x, y: y + 2, width: w, height: h - 4, rx: 10 });
109
+ const pinsOf = spots.map((p, i) => {
110
+ const body = el('g', { class: 'counters-pin-body' }, [el('path', { class: 'counters-pin-shape', d: PIN }), el('rect', { class: 'counters-pin-stripe', x: -5, y: -44, width: 10, height: 3 }), el('rect', { class: 'counters-pin-stripe', x: -5, y: -39, width: 10, height: 3 })]);
111
+ const g = el('g', { class: 'counters-pin', transform: `translate(${p.x} ${p.y})`, tabindex: 0, role: 'button', 'data-cell': i }, [el('rect', { class: 'counters-hit', x: -27, y: -48, width: 54, height: 54 }), el('ellipse', { class: 'counters-spot', rx: 10, ry: 4 }), body]);
112
+ return { g, body, tilt: { a: 0 } };
113
+ });
114
+ // The pins at the back are drawn first, so the front pins stand before them.
115
+ return { nodes: [lane, ...[...pinsOf].reverse().map(p => p.g)], places: {}, refs: { pins: pinsOf, lane } };
116
+ } }];
117
+ }
118
+
119
+ // The car park has two rows of ten spaces, an aisle between them, and an entrance on the left with a sign.
120
+ export function park() {
121
+ const sw = 42, sh = 64, aisle = 76, left = 82, w = left + 10 * sw, h = 2 * sh + aisle;
122
+ return [{ w, h, draw(x, y) {
123
+ const cells = Array.from({ length: 20 }, (_, i) => ({ x: x + left + (i % 10 + 0.5) * sw, y: y + (i < 10 ? sh / 2 : sh + aisle + sh / 2) }));
124
+ const lines = [];
125
+ for (const row of [0, 1]) for (let k = 0; k <= 10; k++) {
126
+ const lx = x + left + k * sw, ly = y + row * (sh + aisle);
127
+ lines.push(el('line', { class: 'counters-bay', x1: lx, y1: ly, x2: lx, y2: ly + sh }));
128
+ }
129
+ const spaces = cells.map((c, i) => el('rect', { class: 'counters-space', x: c.x - sw / 2, y: c.y - sh / 2, width: sw, height: sh, tabindex: 0, role: 'button', 'data-cell': i }));
130
+ const ground = el('rect', { class: 'counters-ground', x, y, width: w, height: h, rx: 10 });
131
+ const road = el('line', { class: 'counters-road', x1: x + 12, y1: y + sh + aisle / 2, x2: x + w - 12, y2: y + sh + aisle / 2 });
132
+ const gate = { x: x + left / 2, y: y + sh + aisle / 2 };
133
+ const word = txt('counters-sign-word', x + left / 2, y + 16), num = txt('counters-sign-num', x + left / 2, y + 40);
134
+ const sign = el('g', { class: 'counters-sign', 'data-ref': 'empty' }, [el('rect', { class: 'counters-sign-box', x: x + 8, y: y + 2, width: left - 16, height: 56, rx: 6 }), word, num]);
135
+ return { nodes: [ground, road, ...spaces, ...lines, sign], places: { cells: { pos: i => cells[i], r: R, all: cells }, gate: { pos: () => gate, r: R } },
136
+ refs: { spaces, sign: { word, num }, cells, gate, aisle: p => p.y > y + sh - 4 && p.y < y + sh + aisle + 4 } };
137
+ } }];
138
+ }
139
+
140
+ // trays holds the red counters of a challenge above the blue ones the reader sets. A tray holds rows of ten with a
141
+ // gap after five, the way a ten frame groups them.
142
+ const TG = 36, TEN = 10 * TG + 8;
143
+ const inRows = i => ({ x: (i % 10 + 0.5) * TG + (i % 10 >= 5 ? 8 : 0), y: (Math.floor(i / 10) + 0.5) * TG });
144
+ export function trays({ red, blue, labels }) {
145
+ const tray = n => Math.ceil(n / 10) * TG + 16, a = tray(red), b = tray(blue), w = TEN + 16;
146
+ return [{ w, h: 24 + a + 16 + 24 + b, draw(x, y) {
147
+ const one = (oy, h, label) => ({
148
+ nodes: [txt('counters-tray-label', x + w / 2, oy + 8, label), el('rect', { class: 'counters-tray', x, y: oy + 24, width: w, height: h, rx: 8 })],
149
+ place: { pos: i => at({ x: x + 8, y: oy + 32 }, inRows(i)), r: R },
150
+ });
151
+ const A = one(y, a, labels[0]), B = one(y + 24 + a + 16, b, labels[1]);
152
+ return { nodes: [...A.nodes, ...B.nodes], places: { red: A.place, blue: B.place }, refs: {} };
153
+ } }];
154
+ }
155
+
156
+ // tray and pile: the reader builds a part in the tray from a pile of counters.
157
+ export function trayPile({ size, labels }) {
158
+ const rows = Math.ceil(size / 5), t = { w: 5 * TG + 16, h: rows * TG + 16 }, p = { w: HEAP[0] * TG * 0.86 + 2 * R + 8, h: (HEAP.length - 1) * TG * 0.64 + 2 * R + 12 };
159
+ const make = (side) => ({ w: side ? t.w + 24 + p.w : Math.max(t.w, p.w), h: 24 + (side ? Math.max(t.h, p.h) : t.h + 44 + p.h), draw(x, y) {
160
+ const tx = side ? x : x + (this.w - t.w) / 2, ty = y + 24, px = side ? x + t.w + 24 : x + (this.w - p.w) / 2, py = side ? y + 24 + Math.max(t.h, p.h) - p.h : ty + t.h + 44;
161
+ const box = { x: tx, y: ty, w: t.w, h: t.h }, base = { x: px + p.w / 2, y: py + p.h - R - 6 };
162
+ const inBox = (b, q) => q.x > b.x - 16 && q.x < b.x + b.w + 16 && q.y > b.y - 16 && q.y < b.y + b.h + 16;
163
+ // A tap on the tray or the pile anywhere moves one counter, so a phone needs no aim at a single counter.
164
+ const tray = el('rect', { class: 'counters-tray counters-press', x: tx, y: ty, width: t.w, height: t.h, rx: 8, tabindex: 0, role: 'button', 'data-place': 'tray', 'aria-label': labels[0] });
165
+ const pile = el('rect', { class: 'counters-press', x: px, y: py, width: p.w, height: p.h, tabindex: 0, role: 'button', 'data-place': 'pile', 'aria-label': labels[1] });
166
+ const nodes = [txt('counters-tray-label', tx + t.w / 2, y + 8, labels[0]), tray,
167
+ txt('counters-tray-label', px + p.w / 2, side ? y + 8 : py - 16, labels[1]), el('ellipse', { class: 'counters-heap-floor', cx: base.x, cy: base.y + R + 2, rx: p.w / 2, ry: 7 }), pile];
168
+ return { nodes, places: { tray: { pos: i => at({ x: tx + 8, y: ty + 8 }, grid(i, 5, TG)), r: R, hit: q => inBox(box, q) },
169
+ pile: { pos: i => at(base, heap(i, TG)), r: R, hit: q => inBox({ x: px, y: py, w: p.w, h: p.h }, q) } }, refs: { press: [tray, pile] } };
170
+ } });
171
+ return [make(true), make(false)];
172
+ }
@@ -0,0 +1,28 @@
1
+ // Ten frames: two rows of five cells. A frame's cells are places for counters, and each cell is a target to tap.
2
+ import { svg as el } from '../../kit/dom.js';
3
+
4
+ // A cell is this wide in the figure's units, about 44px on a phone.
5
+ export const CELL = 44;
6
+ // Two frames side by side or one above the other stand this far apart.
7
+ const BETWEEN = 16;
8
+
9
+ // tenFrame draws one frame with its top left corner at x, y and gives the middle of each cell.
10
+ export function tenFrame(x, y, cell = CELL) {
11
+ const lines = [];
12
+ for (let i = 1; i < 5; i++) lines.push(el('line', { x1: x + i * cell, y1: y, x2: x + i * cell, y2: y + 2 * cell }));
13
+ lines.push(el('line', { x1: x, y1: y + cell, x2: x + 5 * cell, y2: y + cell }));
14
+ const g = el('g', { class: 'counters-frame' }, [el('rect', { class: 'counters-frame-box', x, y, width: 5 * cell, height: 2 * cell, rx: 6 }), ...lines]);
15
+ const cells = Array.from({ length: 10 }, (_, i) => ({ x: x + (i % 5 + 0.5) * cell, y: y + (Math.floor(i / 5) + 0.5) * cell }));
16
+ return { g, cells };
17
+ }
18
+
19
+ // frames gives the ways to set n frames out: side by side, and for two frames also one above the other. Each way has
20
+ // its size and draws the frames at a corner, giving the middle of every cell in order.
21
+ export function frames(n, cell = CELL) {
22
+ const ways = [{ w: n * 5 * cell + (n - 1) * BETWEEN, h: 2 * cell, at: i => ({ x: i * (5 * cell + BETWEEN), y: 0 }) }];
23
+ if (n > 1) ways.push({ w: 5 * cell, h: n * 2 * cell + (n - 1) * BETWEEN, at: i => ({ x: 0, y: i * (2 * cell + BETWEEN) }) });
24
+ return ways.map(way => ({ w: way.w, h: way.h, draw(x, y) {
25
+ const fs = Array.from({ length: n }, (_, i) => { const p = way.at(i); return tenFrame(x + p.x, y + p.y, cell); });
26
+ return { nodes: fs.map(f => f.g), cells: fs.flatMap(f => f.cells) };
27
+ } }));
28
+ }
@@ -0,0 +1,75 @@
1
+ // The goals a challenge page can name. The page declares ranges, and the goal draws a target from them each time the
2
+ // page opens and each time the reader asks for another one. The build and the browser both use this file.
3
+ import { capOf } from './model.js';
4
+
5
+ // A pile holds this many counters for the reader to take from.
6
+ export const PILE = 20;
7
+ const span = (lo, hi) => Array.from({ length: Math.max(0, hi - lo + 1) }, (_, i) => lo + i);
8
+ const range = r => Array.isArray(r) && r.length === 2 && r.every(Number.isInteger) && r[0] <= r[1];
9
+
10
+ export const GOALS = {
11
+ // Red counters wait beside the frames. The reader sets how many blue counters go with them and presses Check,
12
+ // which drops them all into the frames. A whole ten of red is never drawn, because its partner is a whole ten too.
13
+ 'make-whole': {
14
+ scenes: ['bonds'],
15
+ looks: ['frames'],
16
+ problem(c, spec) {
17
+ if (!Number.isInteger(c.whole)) return 'whole is missing, write the number the frames must hold, such as 10';
18
+ if (c.whole < 2 || c.whole > capOf(spec)) return `whole is ${c.whole}, ${spec.frames} frame${spec.frames > 1 ? 's hold' : ' holds'} from 2 to ${capOf(spec)} counters`;
19
+ if (!range(c.part)) return 'part is missing, write the range of red counters as [low, high], such as [1, 9]';
20
+ return null;
21
+ },
22
+ draw(c, spec, dice) {
23
+ const parts = span(c.part[0], c.part[1]).filter(p => p > 0 && p < c.whole && p % 10);
24
+ return parts.length ? { whole: c.whole, part: dice.pick(parts) } : null;
25
+ },
26
+ // The goal holds once the reader has checked a number of blue counters that fills the frames to the whole.
27
+ holds(state, spec, c, t) {
28
+ if (!state.checked) return { done: false };
29
+ const n = t.part + state.blue;
30
+ return n === t.whole ? { done: true } : { done: false, note: n < t.whole ? 'short' : 'over' };
31
+ },
32
+ reach(spec, c, t) {
33
+ if (t.whole - t.part > c.whole) return `the blue slider stops at ${c.whole}, below the ${t.whole - t.part} blue counters it needs`;
34
+ return null;
35
+ },
36
+ words: (c, t, f) => ({ part: f.int(t.part), whole: f.int(t.whole) }),
37
+ },
38
+ // The diagram shows the whole and one part as counters, and a cup hides the other part. The reader builds the
39
+ // hidden part in a tray, then lifts the cup to compare.
40
+ 'hidden-part': {
41
+ scenes: ['bonds'],
42
+ looks: ['diagram'],
43
+ problem(c) {
44
+ if (!range(c.whole) || c.whole[0] < 2 || c.whole[1] > PILE) return `whole is ${JSON.stringify(c.whole)}, write the range of the whole as [low, high] from 2 to ${PILE}, such as [5, 20]`;
45
+ if (c.part !== undefined && !range(c.part)) return 'part is not a range, write the part in sight as [low, high], or leave it out for 1 to one less than the whole';
46
+ return null;
47
+ },
48
+ draw(c, spec, dice) {
49
+ const pairs = span(c.whole[0], c.whole[1]).flatMap(w => span(Math.max(1, c.part?.[0] ?? 1), Math.min(w - 1, c.part?.[1] ?? w - 1)).map(p => ({ whole: w, part: p })));
50
+ return pairs.length ? dice.pick(pairs) : null;
51
+ },
52
+ holds(state, spec, c, t) {
53
+ if (!state.lifted) return { done: false };
54
+ const want = t.whole - t.part;
55
+ return state.tray === want ? { done: true } : { done: false, note: state.tray > want ? 'more' : 'fewer' };
56
+ },
57
+ reach(spec, c, t) {
58
+ if (t.whole - t.part > PILE) return `the pile holds ${PILE} counters, fewer than the ${t.whole - t.part} the tray needs`;
59
+ return null;
60
+ },
61
+ words: (c, t, f) => ({ part: f.int(t.part), whole: f.int(t.whole) }),
62
+ },
63
+ };
64
+
65
+ // The reader's state as a challenge opens: no blue counters checked, an empty tray and the cup down.
66
+ export const challengeStart = () => ({ blue: 0, checked: false, tray: 0, lifted: false });
67
+
68
+ // another draws a target that differs from the last one, so Another one always changes the figure.
69
+ export function another(goal, c, spec, dice, last) {
70
+ for (let i = 0; i < 40; i++) {
71
+ const t = goal.draw(c, spec, dice);
72
+ if (!last || JSON.stringify(t) !== JSON.stringify(last)) return t;
73
+ }
74
+ return goal.draw(c, spec, dice);
75
+ }
@@ -0,0 +1,86 @@
1
+ counters_lead: "Tap and drag the counters, and watch the numbers follow them."
2
+ counters_whole: Whole
3
+ counters_first: First part
4
+ counters_second: Second part
5
+ counters_empty: Empty cells
6
+ counters_added: Blue added
7
+ counters_found: Splits found
8
+ counters_ways: Splits in all
9
+ counters_hands-first: Left hand
10
+ counters_hands-second: Right hand
11
+ counters_hands-whole: Beads
12
+ counters_one-first: Counters
13
+ counters_one-found: Pairs found
14
+ counters_one-ways: Pairs in all
15
+ counters_two-first: Red
16
+ counters_two-second: Blue
17
+ counters_cup-first: Part in sight
18
+ counters_cup-second: Hidden part
19
+ counters_cup-added: Blue added
20
+ counters_pins-first: Standing
21
+ counters_pins-empty: Knocked down
22
+ counters_cars-first: Parked
23
+ counters_cars-empty: Free spaces
24
+ counters_ctl-whole: Whole
25
+ counters_swap: Swap
26
+ counters_fill: Fill the second frame
27
+ counters_unfill: Empty the second frame
28
+ counters_lift: Lift the cup
29
+ counters_lower: Put the cup back
30
+ counters_check: Check
31
+ counters_blue: Blue counters
32
+ counters_tray: Tray
33
+ counters_pile: Pile
34
+ counters_cup: Cup
35
+ counters_counter: Counter
36
+ counters_car: Car
37
+ counters_cell: "Cell {x}"
38
+ counters_pin-up: "Pin {x}, standing"
39
+ counters_pin-down: "Pin {x}, knocked down"
40
+ counters_free: Free
41
+ counters_pair: "{a} and {b}"
42
+ counters_list-splits: "Splits of {x}"
43
+ counters_list-pairs: "Pairs that make {x}"
44
+ counters_goal-make-whole: "The red tray holds {part}. Set the blue counters so that the frame holds {whole}, then press Check."
45
+ counters_goal-make-whole-two: "The red tray holds {part}. Set the blue counters so that the two frames hold {whole}, then press Check."
46
+ counters_goal-hidden-part: "The whole is {whole}, and the part in sight is {part}. Build the part under the cup in the tray, then lift the cup."
47
+ counters_note-short: Some cells are still empty.
48
+ counters_note-over: Some counters found no cell.
49
+ counters_note-more: The tray holds more counters than the cup.
50
+ counters_note-fewer: The tray holds fewer counters than the cup.
51
+ counters_hint-make-whole: "Count on from {part} to {whole}. Each number you say after {part} is one blue counter."
52
+ counters_hint-hidden-part: "Count on from {part} to {whole}. Each number you say after {part} is one counter under the cup."
53
+ counters_total: How many
54
+ counters_tag-count: Last number said
55
+ counters_take-count: Left
56
+ counters_place-count: Number
57
+ counters_marker-count: Marker
58
+ counters_bus-count: Passengers
59
+ counters_stairs-count: Step
60
+ counters_clear: Clear
61
+ counters_ctl-box: In the box
62
+ counters_ctl-marker: Marker
63
+ counters_ctl-step: Step
64
+ counters_kind-disc: Counter
65
+ counters_kind-apple: Apple
66
+ counters_kind-bird: Bird
67
+ counters_kind-walker: Walker
68
+ counters_kind-shell: Shell
69
+ counters_kind-person: Person
70
+ counters_gap: Empty place
71
+ counters_basket: Basket
72
+ counters_stop-sign: Bus
73
+ counters_goal-fill-basket: "Put {target} apples in the basket, then press Check."
74
+ counters_goal-count-on: "The box holds {box}. Put counters beside it until there are {target} in all, then press Check."
75
+ counters_goal-count-back: "Take counters away until {target} are left, then press Check."
76
+ counters_note-fill-basket-more: The basket holds more apples than that.
77
+ counters_note-fill-basket-fewer: The basket holds fewer apples than that.
78
+ counters_note-count-on-more: The box and the counters make more than that.
79
+ counters_note-count-on-fewer: The box and the counters make fewer than that.
80
+ counters_note-count-back-more: More counters are left than that.
81
+ counters_note-count-back-fewer: Fewer counters are left than that.
82
+ counters_hint-fill-basket: "Say one number for each apple you put in, and stop at {target}."
83
+ counters_hint-count-on: "Start from {box} and say the next number for each counter you put beside the box. Stop at {target}."
84
+ counters_hint-count-back: "Start from {start} and say the number before for each counter you take away. Stop at {target}."
85
+ counters_roll: Roll the ball
86
+ counters_set-up: Set up the pins
@@ -0,0 +1,86 @@
1
+ counters_lead: "Sayaçlara dokunun, onları sürükleyin ve sayıların onları nasıl izlediğine bakın."
2
+ counters_whole: Bütün
3
+ counters_first: Birinci parça
4
+ counters_second: İkinci parça
5
+ counters_empty: Boş hücreler
6
+ counters_added: Eklenen mavi
7
+ counters_found: Bulunan ayrımlar
8
+ counters_ways: Tüm ayrımlar
9
+ counters_hands-first: Sol el
10
+ counters_hands-second: Sağ el
11
+ counters_hands-whole: Boncuklar
12
+ counters_one-first: Sayaçlar
13
+ counters_one-found: Bulunan ikililer
14
+ counters_one-ways: Tüm ikililer
15
+ counters_two-first: Kırmızı
16
+ counters_two-second: Mavi
17
+ counters_cup-first: Görünen parça
18
+ counters_cup-second: Gizli parça
19
+ counters_cup-added: Eklenen mavi
20
+ counters_pins-first: Ayakta
21
+ counters_pins-empty: Devrilen
22
+ counters_cars-first: Park eden
23
+ counters_cars-empty: Boş yerler
24
+ counters_ctl-whole: Bütün
25
+ counters_swap: Yer değiştir
26
+ counters_fill: İkinci çerçeveyi doldur
27
+ counters_unfill: İkinci çerçeveyi boşalt
28
+ counters_lift: Bardağı kaldır
29
+ counters_lower: Bardağı geri koy
30
+ counters_check: Kontrol et
31
+ counters_blue: Mavi sayaçlar
32
+ counters_tray: Tepsi
33
+ counters_pile: Yığın
34
+ counters_cup: Bardak
35
+ counters_counter: Sayaç
36
+ counters_car: Araba
37
+ counters_cell: "Hücre {x}"
38
+ counters_pin-up: "Lobut {x}, ayakta"
39
+ counters_pin-down: "Lobut {x}, devrik"
40
+ counters_free: Boş
41
+ counters_pair: "{a} ve {b}"
42
+ counters_list-splits: "{x} sayısının ayrımları"
43
+ counters_list-pairs: "{x} yapan ikililer"
44
+ counters_goal-make-whole: "Kırmızı tepside {part} sayaç var. Çerçeve {whole} sayaç tutacak biçimde mavi sayaçları ayarlayın, sonra Kontrol et düğmesine basın."
45
+ counters_goal-make-whole-two: "Kırmızı tepside {part} sayaç var. İki çerçeve {whole} sayaç tutacak biçimde mavi sayaçları ayarlayın, sonra Kontrol et düğmesine basın."
46
+ counters_goal-hidden-part: "Bütün {whole}, görünen parça {part}. Bardağın altındaki parçayı tepside kurun, sonra bardağı kaldırın."
47
+ counters_note-short: Bazı hücreler hâlâ boş.
48
+ counters_note-over: Bazı sayaçlara hücre kalmadı.
49
+ counters_note-more: Tepside bardaktakinden çok sayaç var.
50
+ counters_note-fewer: Tepside bardaktakinden az sayaç var.
51
+ counters_hint-make-whole: "{part} sayısından {whole} sayısına kadar ileri sayın. {part} sayısından sonra söylediğiniz her sayı bir mavi sayaçtır."
52
+ counters_hint-hidden-part: "{part} sayısından {whole} sayısına kadar ileri sayın. {part} sayısından sonra söylediğiniz her sayı bardağın altındaki bir sayaçtır."
53
+ counters_total: Kaç tane
54
+ counters_tag-count: Son söylenen sayı
55
+ counters_take-count: Kalan
56
+ counters_place-count: Sayı
57
+ counters_marker-count: İşaret
58
+ counters_bus-count: Yolcular
59
+ counters_stairs-count: Basamak
60
+ counters_clear: Temizle
61
+ counters_ctl-box: Kutuda
62
+ counters_ctl-marker: İşaret
63
+ counters_ctl-step: Basamak
64
+ counters_kind-disc: Sayaç
65
+ counters_kind-apple: Elma
66
+ counters_kind-bird: Kuş
67
+ counters_kind-walker: Yürüyen kişi
68
+ counters_kind-shell: Deniz kabuğu
69
+ counters_kind-person: Kişi
70
+ counters_gap: Boş yer
71
+ counters_basket: Sepet
72
+ counters_stop-sign: Durak
73
+ counters_goal-fill-basket: "Sepete {target} elma koyun, sonra Kontrol et düğmesine basın."
74
+ counters_goal-count-on: "Kutuda {box} tane var. Hepsi {target} olana kadar yanına sayaç koyun, sonra Kontrol et düğmesine basın."
75
+ counters_goal-count-back: "{target} sayaç kalana kadar sayaç alın, sonra Kontrol et düğmesine basın."
76
+ counters_note-fill-basket-more: Sepette bundan çok elma var.
77
+ counters_note-fill-basket-fewer: Sepette bundan az elma var.
78
+ counters_note-count-on-more: Kutu ve sayaçlar bundan çok ediyor.
79
+ counters_note-count-on-fewer: Kutu ve sayaçlar bundan az ediyor.
80
+ counters_note-count-back-more: Bundan çok sayaç kaldı.
81
+ counters_note-count-back-fewer: Bundan az sayaç kaldı.
82
+ counters_hint-fill-basket: "Koyduğunuz her elma için bir sayı söyleyin ve {target} sayısında durun."
83
+ counters_hint-count-on: "{box} sayısından başlayın ve kutunun yanına koyduğunuz her sayaç için bir sonraki sayıyı söyleyin. {target} sayısında durun."
84
+ counters_hint-count-back: "{start} sayısından başlayın ve aldığınız her sayaç için bir önceki sayıyı söyleyin. {target} sayısında durun."
85
+ counters_roll: Topu yuvarla
86
+ counters_set-up: Lobutları diz