@kuncat/avoidant 0.1.2 → 0.1.3

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 (34) hide show
  1. package/dist/components/AvoidantGame.svelte +160 -49
  2. package/dist/components/board.svelte +19 -2
  3. package/dist/components/board.svelte.d.ts +3 -0
  4. package/dist/components/fragment.glsl +9 -0
  5. package/dist/paraglide/messages/_index.d.ts +10 -0
  6. package/dist/paraglide/messages/_index.js +11 -1
  7. package/dist/paraglide/messages/field_tutorial_mode.d.ts +16 -0
  8. package/dist/paraglide/messages/field_tutorial_mode.js +29 -0
  9. package/dist/paraglide/messages/field_void_fraction.d.ts +16 -0
  10. package/dist/paraglide/messages/field_void_fraction.js +29 -0
  11. package/dist/paraglide/messages/tutorial_action_dismiss.d.ts +16 -0
  12. package/dist/paraglide/messages/tutorial_action_dismiss.js +29 -0
  13. package/dist/paraglide/messages/tutorial_action_next.d.ts +16 -0
  14. package/dist/paraglide/messages/tutorial_action_next.js +29 -0
  15. package/dist/paraglide/messages/tutorial_after_safe_deducible.d.ts +16 -0
  16. package/dist/paraglide/messages/tutorial_after_safe_deducible.js +29 -0
  17. package/dist/paraglide/messages/tutorial_after_safe_guess.d.ts +16 -0
  18. package/dist/paraglide/messages/tutorial_after_safe_guess.js +29 -0
  19. package/dist/paraglide/messages/tutorial_after_void.d.ts +16 -0
  20. package/dist/paraglide/messages/tutorial_after_void.js +29 -0
  21. package/dist/paraglide/messages/tutorial_awaiting_first_click.d.ts +16 -0
  22. package/dist/paraglide/messages/tutorial_awaiting_first_click.js +29 -0
  23. package/dist/paraglide/messages/tutorial_intro.d.ts +16 -0
  24. package/dist/paraglide/messages/tutorial_intro.js +29 -0
  25. package/dist/paraglide/messages/tutorial_won.d.ts +18 -0
  26. package/dist/paraglide/messages/tutorial_won.js +29 -0
  27. package/dist/styles/global.css +1 -1
  28. package/dist/tutorial.svelte.d.ts +42 -0
  29. package/dist/tutorial.svelte.js +113 -0
  30. package/dist/wasm/avoidant_wasm.d.ts +3 -3
  31. package/dist/wasm/avoidant_wasm.js +15 -15
  32. package/dist/wasm/avoidant_wasm_bg.wasm +0 -0
  33. package/dist/wasm/avoidant_wasm_bg.wasm.d.ts +3 -3
  34. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Next" |
5
+ *
6
+ * @param {Tutorial_Action_NextInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_action_next: ((inputs?: Tutorial_Action_NextInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_Action_NextInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_Action_NextInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_Action_NextInputs */
7
+
8
+ const en_tutorial_action_next = /** @type {(inputs: Tutorial_Action_NextInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Next`)
10
+ };
11
+
12
+ const bn_tutorial_action_next = /** @type {(inputs: Tutorial_Action_NextInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`পরবর্তী`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Next" |
20
+ *
21
+ * @param {Tutorial_Action_NextInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_action_next = /** @type {((inputs?: Tutorial_Action_NextInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_Action_NextInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_action_next(inputs)
28
+ return bn_tutorial_action_next(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Nice! That cell was safe, and the numbers around it let you deduce another safe cell. The highlighted cell is provably safe. Feel free to press it next." |
5
+ *
6
+ * @param {Tutorial_After_Safe_DeducibleInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_after_safe_deducible: ((inputs?: Tutorial_After_Safe_DeducibleInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_After_Safe_DeducibleInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_After_Safe_DeducibleInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_After_Safe_DeducibleInputs */
7
+
8
+ const en_tutorial_after_safe_deducible = /** @type {(inputs: Tutorial_After_Safe_DeducibleInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Nice! That cell was safe, and the numbers around it let you deduce another safe cell. The highlighted cell is provably safe. Feel free to press it next.`)
10
+ };
11
+
12
+ const bn_tutorial_after_safe_deducible = /** @type {(inputs: Tutorial_After_Safe_DeducibleInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`বাহ! সেলটি নিরাপদ ছিল, এবং আশপাশের সংখ্যাগুলো থেকে আরেকটি নিরাপদ সেল অনুমান করা যায়। হাইলাইট করা সেলটি প্রমাণযোগ্যভাবে নিরাপদ। পরবর্তীতে নির্দ্বিধায় সেটিতে চাপ দিন।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Nice! That cell was safe, and the numbers around it let you deduce another safe cell. The highlighted cell is provably safe. Feel free to press it next." |
20
+ *
21
+ * @param {Tutorial_After_Safe_DeducibleInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_after_safe_deducible = /** @type {((inputs?: Tutorial_After_Safe_DeducibleInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_After_Safe_DeducibleInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_after_safe_deducible(inputs)
28
+ return bn_tutorial_after_safe_deducible(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Nice, that cell was safe. Pick another cell." |
5
+ *
6
+ * @param {Tutorial_After_Safe_GuessInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_after_safe_guess: ((inputs?: Tutorial_After_Safe_GuessInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_After_Safe_GuessInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_After_Safe_GuessInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_After_Safe_GuessInputs */
7
+
8
+ const en_tutorial_after_safe_guess = /** @type {(inputs: Tutorial_After_Safe_GuessInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Nice, that cell was safe. Pick another cell.`)
10
+ };
11
+
12
+ const bn_tutorial_after_safe_guess = /** @type {(inputs: Tutorial_After_Safe_GuessInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`বাহ, সেলটি নিরাপদ ছিল। আরেকটি সেল বেছে নিন।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Nice, that cell was safe. Pick another cell." |
20
+ *
21
+ * @param {Tutorial_After_Safe_GuessInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_after_safe_guess = /** @type {((inputs?: Tutorial_After_Safe_GuessInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_After_Safe_GuessInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_after_safe_guess(inputs)
28
+ return bn_tutorial_after_safe_guess(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "That was a void! Voids are the cells you want to avoid and pressing each one ends your streak and deducts points. Click another cell to keep exploring." |
5
+ *
6
+ * @param {Tutorial_After_VoidInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_after_void: ((inputs?: Tutorial_After_VoidInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_After_VoidInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_After_VoidInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_After_VoidInputs */
7
+
8
+ const en_tutorial_after_void = /** @type {(inputs: Tutorial_After_VoidInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`That was a void! Voids are the cells you want to avoid and pressing each one ends your streak and deducts points. Click another cell to keep exploring.`)
10
+ };
11
+
12
+ const bn_tutorial_after_void = /** @type {(inputs: Tutorial_After_VoidInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`সেটি শূন্য ছিল! শূন্য সেলই আপনাকে এড়াতে হবে — প্রতিটি শূন্যে চাপ দিলে আপনার ধারা শেষ হয় এবং পয়েন্ট কাটা যায়। আরেকটি সেলে চাপ দিয়ে অনুসন্ধান চালিয়ে যান।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "That was a void! Voids are the cells you want to avoid and pressing each one ends your streak and deducts points. Click another cell to keep exploring." |
20
+ *
21
+ * @param {Tutorial_After_VoidInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_after_void = /** @type {((inputs?: Tutorial_After_VoidInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_After_VoidInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_after_void(inputs)
28
+ return bn_tutorial_after_void(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "The map is now interactive. Press any cell to reveal it and remember your goal is to avoid pressing \"void\" cells. Each safe cell with any void neighbors show..." |
5
+ *
6
+ * @param {Tutorial_Awaiting_First_ClickInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_awaiting_first_click: ((inputs?: Tutorial_Awaiting_First_ClickInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_Awaiting_First_ClickInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_Awaiting_First_ClickInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_Awaiting_First_ClickInputs */
7
+
8
+ const en_tutorial_awaiting_first_click = /** @type {(inputs: Tutorial_Awaiting_First_ClickInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`The map is now interactive. Press any cell to reveal it and remember your goal is to avoid pressing "void" cells. Each safe cell with any void neighbors shows a number indicating how many of their neighbours are voids. As you explore the map, use that information to try to deduce which cells are safe and which are void. Good luck!`)
10
+ };
11
+
12
+ const bn_tutorial_awaiting_first_click = /** @type {(inputs: Tutorial_Awaiting_First_ClickInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`ম্যাপ এখন ইন্টারঅ্যাকটিভ। যেকোনো সেলে চাপ দিয়ে সেটি উন্মোচন করুন, এবং মনে রাখবেন আপনার লক্ষ্য হলো "শূন্য" সেল এড়িয়ে চলা। শূন্য প্রতিবেশীযুক্ত প্রতিটি নিরাপদ সেলে একটি সংখ্যা দেখাবে — সেটি বলে কতজন প্রতিবেশী শূন্য। ম্যাপ অন্বেষণের সময় এই তথ্য ব্যবহার করে অনুমান করুন কোন সেল নিরাপদ আর কোনটি শূন্য। শুভকামনা!`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "The map is now interactive. Press any cell to reveal it and remember your goal is to avoid pressing \"void\" cells. Each safe cell with any void neighbors show..." |
20
+ *
21
+ * @param {Tutorial_Awaiting_First_ClickInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_awaiting_first_click = /** @type {((inputs?: Tutorial_Awaiting_First_ClickInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_Awaiting_First_ClickInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_awaiting_first_click(inputs)
28
+ return bn_tutorial_awaiting_first_click(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Welcome to Avoidant. Take a moment to get familiar with moving the camera around: on a touchscreen, one-finger dragging will pan the map, and two fingers wil..." |
5
+ *
6
+ * @param {Tutorial_IntroInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_intro: ((inputs?: Tutorial_IntroInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_IntroInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_IntroInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Tutorial_IntroInputs */
7
+
8
+ const en_tutorial_intro = /** @type {(inputs: Tutorial_IntroInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Welcome to Avoidant. Take a moment to get familiar with moving the camera around: on a touchscreen, one-finger dragging will pan the map, and two fingers will let you rotate and zoom. With a mouse, drag with the left mouse button to pan, drag with the right mouse button to rotate, and scroll to zoom. With a trackpad, holding shift while dragging lets you rotate. When you're comfortable with the controls, press Next to start exploring cells.`)
10
+ };
11
+
12
+ const bn_tutorial_intro = /** @type {(inputs: Tutorial_IntroInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`Avoidant-এ স্বাগতম। প্রথমে ক্যামেরা ঘোরানোর সাথে পরিচিত হয়ে নিন: টাচস্ক্রিনে এক আঙুল দিয়ে টেনে ম্যাপ সরানো যায়, আর দুই আঙুলে ঘোরানো ও জুম করা যায়। মাউসে বাম বোতাম টেনে ম্যাপ সরান, ডান বোতাম টেনে ঘোরান, এবং স্ক্রল করে জুম করুন। ট্র্যাকপ্যাডে Shift চেপে টানলে ঘোরানো যাবে। নিয়ন্ত্রণে সাবলীল হলে পরবর্তী চাপুন এবং সেল অনুসন্ধান শুরু করুন।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Welcome to Avoidant. Take a moment to get familiar with moving the camera around: on a touchscreen, one-finger dragging will pan the map, and two fingers wil..." |
20
+ *
21
+ * @param {Tutorial_IntroInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_intro = /** @type {((inputs?: Tutorial_IntroInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_IntroInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_intro(inputs)
28
+ return bn_tutorial_intro(inputs)
29
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Congratulations, you found every non-void cell! Your efficiency was {percent}%. Efficiency compares your score to the maximum possible score on this map: 100..." |
5
+ *
6
+ * @param {Tutorial_WonInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const tutorial_won: ((inputs: Tutorial_WonInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_WonInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Tutorial_WonInputs = {
17
+ percent: NonNullable<unknown>;
18
+ };
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{ percent: NonNullable<unknown> }} Tutorial_WonInputs */
7
+
8
+ const en_tutorial_won = /** @type {(inputs: Tutorial_WonInputs) => LocalizedString} */ (i) => {
9
+ return /** @type {LocalizedString} */ (`Congratulations, you found every non-void cell! Your efficiency was ${i?.percent}%. Efficiency compares your score to the maximum possible score on this map: 100% means you only ever clicked safe cells.`)
10
+ };
11
+
12
+ const bn_tutorial_won = /** @type {(inputs: Tutorial_WonInputs) => LocalizedString} */ (i) => {
13
+ return /** @type {LocalizedString} */ (`অভিনন্দন, আপনি প্রতিটি অ-শূন্য সেল খুঁজে বের করেছেন! আপনার দক্ষতা ছিল ${i?.percent}%। দক্ষতা আপনার স্কোরকে এই ম্যাপের সর্বোচ্চ সম্ভাব্য স্কোরের সাথে তুলনা করে: ১০০% মানে আপনি কেবলমাত্র নিরাপদ সেলেই চাপ দিয়েছেন।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Congratulations, you found every non-void cell! Your efficiency was {percent}%. Efficiency compares your score to the maximum possible score on this map: 100..." |
20
+ *
21
+ * @param {Tutorial_WonInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const tutorial_won = /** @type {((inputs: Tutorial_WonInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_WonInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_tutorial_won(inputs)
28
+ return bn_tutorial_won(inputs)
29
+ });
@@ -136,7 +136,7 @@ h1 {
136
136
  @apply text-base leading-none text-slate-500;
137
137
  }
138
138
 
139
- .advanced-settings[open] .advanced-settings-summary::after {
139
+ .advanced-settings.advanced-settings-open .advanced-settings-summary::after {
140
140
  content: "-";
141
141
  }
142
142
 
@@ -0,0 +1,42 @@
1
+ import type { CellMetadataEntry, MapCell } from "./wasm/avoidant_wasm";
2
+ export type TutorialPhase = {
3
+ kind: "intro";
4
+ } | {
5
+ kind: "awaitingFirstClick";
6
+ } | {
7
+ kind: "afterVoid";
8
+ cellIndex: number;
9
+ } | {
10
+ kind: "afterSafeGuess";
11
+ cellIndex: number;
12
+ } | {
13
+ kind: "afterSafeDeducible";
14
+ clickedCellIndex: number;
15
+ deducibleCellIndex: number;
16
+ } | {
17
+ kind: "won";
18
+ efficiency: number;
19
+ } | {
20
+ kind: "done";
21
+ };
22
+ export declare class TutorialState {
23
+ phase: TutorialPhase;
24
+ get text(): string;
25
+ /** Whether the UI should show a Next button to advance manually. */
26
+ get canAdvance(): boolean;
27
+ /** Whether cell click handlers should forward clicks to the game. */
28
+ get isExplorationAllowed(): boolean;
29
+ /** Cell to visually highlight as provably safe, if any. */
30
+ get highlightedCellIndex(): number | undefined;
31
+ /** Advance from the intro to the interactive phase. */
32
+ next(): void;
33
+ observeExplore(cellIndex: number, cells: ReadonlyArray<MapCell>, metadata: ReadonlyArray<CellMetadataEntry>): void;
34
+ observeWin(efficiency: number): void;
35
+ dismiss(): void;
36
+ }
37
+ /**
38
+ * Find an unexplored cell that is provably safe given currently revealed metadata. This is not a comprehensive solver and often does not return any cell even when some safe cells are provable.
39
+ *
40
+ * A cell `n` is provably safe when some explored, non-void neighbour `c` has `voidNeighborCount` equal to the number of `c`'s neighbours already known to be voids — meaning every remaining unexplored neighbour of `c` (including `n`) must be safe. Returns the first such `n` found, preferring a neighbour of the freshly-clicked cell so the highlight is contextually adjacent.
41
+ */
42
+ export declare function findDeducibleSafeCell(cells: ReadonlyArray<MapCell>, metadata: ReadonlyArray<CellMetadataEntry>, preferredSourceCell?: number): number | undefined;
@@ -0,0 +1,113 @@
1
+ import { m } from "./paraglide/messages";
2
+ export class TutorialState {
3
+ phase = $state({ kind: "intro" });
4
+ get text() {
5
+ switch (this.phase.kind) {
6
+ case "intro":
7
+ return m.tutorial_intro();
8
+ case "awaitingFirstClick":
9
+ return m.tutorial_awaiting_first_click();
10
+ case "afterVoid":
11
+ return m.tutorial_after_void();
12
+ case "afterSafeGuess":
13
+ return m.tutorial_after_safe_guess();
14
+ case "afterSafeDeducible":
15
+ return m.tutorial_after_safe_deducible();
16
+ case "won":
17
+ return m.tutorial_won({ percent: Math.round(this.phase.efficiency * 100) });
18
+ case "done":
19
+ return "";
20
+ }
21
+ }
22
+ /** Whether the UI should show a Next button to advance manually. */
23
+ get canAdvance() {
24
+ return this.phase.kind === "intro";
25
+ }
26
+ /** Whether cell click handlers should forward clicks to the game. */
27
+ get isExplorationAllowed() {
28
+ return this.phase.kind !== "intro" && this.phase.kind !== "won" && this.phase.kind !== "done";
29
+ }
30
+ /** Cell to visually highlight as provably safe, if any. */
31
+ get highlightedCellIndex() {
32
+ return this.phase.kind === "afterSafeDeducible" ? this.phase.deducibleCellIndex : undefined;
33
+ }
34
+ /** Advance from the intro to the interactive phase. */
35
+ next() {
36
+ if (this.phase.kind === "intro") {
37
+ this.phase = { kind: "awaitingFirstClick" };
38
+ }
39
+ }
40
+ observeExplore(cellIndex, cells, metadata) {
41
+ if (!this.isExplorationAllowed)
42
+ return;
43
+ const entry = metadata[cellIndex];
44
+ if (!entry)
45
+ return;
46
+ if (entry.isVoid) {
47
+ this.phase = { kind: "afterVoid", cellIndex };
48
+ return;
49
+ }
50
+ const deducible = findDeducibleSafeCell(cells, metadata, cellIndex);
51
+ this.phase =
52
+ deducible === undefined
53
+ ? { kind: "afterSafeGuess", cellIndex }
54
+ : {
55
+ kind: "afterSafeDeducible",
56
+ clickedCellIndex: cellIndex,
57
+ deducibleCellIndex: deducible,
58
+ };
59
+ }
60
+ observeWin(efficiency) {
61
+ if (this.phase.kind === "won" || this.phase.kind === "done")
62
+ return;
63
+ this.phase = { kind: "won", efficiency };
64
+ }
65
+ dismiss() {
66
+ this.phase = { kind: "done" };
67
+ }
68
+ }
69
+ /**
70
+ * Find an unexplored cell that is provably safe given currently revealed metadata. This is not a comprehensive solver and often does not return any cell even when some safe cells are provable.
71
+ *
72
+ * A cell `n` is provably safe when some explored, non-void neighbour `c` has `voidNeighborCount` equal to the number of `c`'s neighbours already known to be voids — meaning every remaining unexplored neighbour of `c` (including `n`) must be safe. Returns the first such `n` found, preferring a neighbour of the freshly-clicked cell so the highlight is contextually adjacent.
73
+ */
74
+ export function findDeducibleSafeCell(cells, metadata, preferredSourceCell) {
75
+ const tryFrom = (sourceCell) => {
76
+ const entry = metadata[sourceCell];
77
+ if (!entry || !entry.isExplored || entry.isVoid)
78
+ return undefined;
79
+ const neighbours = cells[sourceCell]?.neighbors;
80
+ if (!neighbours)
81
+ return undefined;
82
+ let knownVoids = 0;
83
+ let firstUnexplored;
84
+ for (const n of neighbours) {
85
+ if (!metadata[n])
86
+ continue;
87
+ if (metadata[n].isExplored) {
88
+ if (metadata[n].isVoid)
89
+ knownVoids++;
90
+ }
91
+ else if (firstUnexplored === undefined) {
92
+ firstUnexplored = n;
93
+ }
94
+ }
95
+ if (firstUnexplored !== undefined && entry.voidNeighborCount === knownVoids) {
96
+ return firstUnexplored;
97
+ }
98
+ return undefined;
99
+ };
100
+ if (preferredSourceCell !== undefined) {
101
+ const direct = tryFrom(preferredSourceCell);
102
+ if (direct !== undefined)
103
+ return direct;
104
+ }
105
+ for (let c = 0; c < cells.length; c++) {
106
+ if (c === preferredSourceCell)
107
+ continue;
108
+ const found = tryFrom(c);
109
+ if (found !== undefined)
110
+ return found;
111
+ }
112
+ return undefined;
113
+ }
@@ -338,12 +338,12 @@ export interface InitOutput {
338
338
  readonly wasm_bindgen__convert__closures_____invoke__h299fd98c162ada8d: (a: number, b: number, c: any, d: any) => void;
339
339
  readonly wasm_bindgen__convert__closures_____invoke__h1d3d8bbcf4bb9647: (a: number, b: number, c: any) => any;
340
340
  readonly wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f: (a: number, b: number, c: any) => void;
341
- readonly wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10: (a: number, b: number, c: any) => void;
341
+ readonly wasm_bindgen__convert__closures_____invoke__hdc004ac269f592e8: (a: number, b: number, c: any) => void;
342
342
  readonly wasm_bindgen__convert__closures_____invoke__h3ed8ec9c74648bb3: (a: number, b: number, c: any) => void;
343
343
  readonly wasm_bindgen__convert__closures_____invoke__hac60de05c959eab5: (a: number, b: number) => void;
344
344
  readonly wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2: (a: number, b: number) => void;
345
- readonly wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e: (a: number, b: number) => void;
346
- readonly wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562: (a: number, b: number) => void;
345
+ readonly wasm_bindgen__convert__closures_____invoke__hb73c005341827ffa: (a: number, b: number) => void;
346
+ readonly wasm_bindgen__convert__closures_____invoke__h5b21f331a86ab3b0: (a: number, b: number) => void;
347
347
  readonly __wbindgen_malloc: (a: number, b: number) => number;
348
348
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
349
349
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -1320,7 +1320,7 @@ function __wbg_get_imports() {
1320
1320
  return ret;
1321
1321
  },
1322
1322
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1323
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2263, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1323
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2264, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1324
1324
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f);
1325
1325
  return ret;
1326
1326
  },
@@ -1335,33 +1335,33 @@ function __wbg_get_imports() {
1335
1335
  return ret;
1336
1336
  },
1337
1337
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1338
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1062, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1339
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10);
1338
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1063, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1339
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hdc004ac269f592e8);
1340
1340
  return ret;
1341
1341
  },
1342
1342
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1343
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2654, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1343
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2655, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1344
1344
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3ed8ec9c74648bb3);
1345
1345
  return ret;
1346
1346
  },
1347
1347
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1348
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2223, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1348
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2224, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1349
1349
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hac60de05c959eab5);
1350
1350
  return ret;
1351
1351
  },
1352
1352
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
1353
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2404, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1353
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1354
1354
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2);
1355
1355
  return ret;
1356
1356
  },
1357
1357
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
1358
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2406, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1359
- const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e);
1358
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2407, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1359
+ const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hb73c005341827ffa);
1360
1360
  return ret;
1361
1361
  },
1362
1362
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
1363
1363
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3736, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1364
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562);
1364
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h5b21f331a86ab3b0);
1365
1365
  return ret;
1366
1366
  },
1367
1367
  __wbindgen_cast_000000000000000a: function(arg0) {
@@ -1415,20 +1415,20 @@ function wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2(arg0, arg
1415
1415
  wasm.wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2(arg0, arg1);
1416
1416
  }
1417
1417
 
1418
- function wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e(arg0, arg1) {
1419
- wasm.wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e(arg0, arg1);
1418
+ function wasm_bindgen__convert__closures_____invoke__hb73c005341827ffa(arg0, arg1) {
1419
+ wasm.wasm_bindgen__convert__closures_____invoke__hb73c005341827ffa(arg0, arg1);
1420
1420
  }
1421
1421
 
1422
- function wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562(arg0, arg1) {
1423
- wasm.wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562(arg0, arg1);
1422
+ function wasm_bindgen__convert__closures_____invoke__h5b21f331a86ab3b0(arg0, arg1) {
1423
+ wasm.wasm_bindgen__convert__closures_____invoke__h5b21f331a86ab3b0(arg0, arg1);
1424
1424
  }
1425
1425
 
1426
1426
  function wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f(arg0, arg1, arg2) {
1427
1427
  wasm.wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f(arg0, arg1, arg2);
1428
1428
  }
1429
1429
 
1430
- function wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10(arg0, arg1, arg2) {
1431
- wasm.wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10(arg0, arg1, arg2);
1430
+ function wasm_bindgen__convert__closures_____invoke__hdc004ac269f592e8(arg0, arg1, arg2) {
1431
+ wasm.wasm_bindgen__convert__closures_____invoke__hdc004ac269f592e8(arg0, arg1, arg2);
1432
1432
  }
1433
1433
 
1434
1434
  function wasm_bindgen__convert__closures_____invoke__h3ed8ec9c74648bb3(arg0, arg1, arg2) {
Binary file
@@ -68,12 +68,12 @@ export const wasm_bindgen__convert__closures_____invoke__h00c6858f5875acdf: (a:
68
68
  export const wasm_bindgen__convert__closures_____invoke__h299fd98c162ada8d: (a: number, b: number, c: any, d: any) => void;
69
69
  export const wasm_bindgen__convert__closures_____invoke__h1d3d8bbcf4bb9647: (a: number, b: number, c: any) => any;
70
70
  export const wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f: (a: number, b: number, c: any) => void;
71
- export const wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10: (a: number, b: number, c: any) => void;
71
+ export const wasm_bindgen__convert__closures_____invoke__hdc004ac269f592e8: (a: number, b: number, c: any) => void;
72
72
  export const wasm_bindgen__convert__closures_____invoke__h3ed8ec9c74648bb3: (a: number, b: number, c: any) => void;
73
73
  export const wasm_bindgen__convert__closures_____invoke__hac60de05c959eab5: (a: number, b: number) => void;
74
74
  export const wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2: (a: number, b: number) => void;
75
- export const wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e: (a: number, b: number) => void;
76
- export const wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562: (a: number, b: number) => void;
75
+ export const wasm_bindgen__convert__closures_____invoke__hb73c005341827ffa: (a: number, b: number) => void;
76
+ export const wasm_bindgen__convert__closures_____invoke__h5b21f331a86ab3b0: (a: number, b: number) => void;
77
77
  export const __wbindgen_malloc: (a: number, b: number) => number;
78
78
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
79
79
  export const __wbindgen_exn_store: (a: number) => void;
package/package.json CHANGED
@@ -84,5 +84,5 @@
84
84
  "**/*.css"
85
85
  ],
86
86
  "type": "module",
87
- "version": "0.1.2"
87
+ "version": "0.1.3"
88
88
  }