@kuncat/avoidant 0.1.2 → 0.1.4
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.
- package/dist/components/AvoidantGame.svelte +185 -57
- package/dist/components/board.svelte +19 -2
- package/dist/components/board.svelte.d.ts +3 -0
- package/dist/components/fragment.glsl +9 -0
- package/dist/paraglide/messages/_index.d.ts +10 -0
- package/dist/paraglide/messages/_index.js +11 -1
- package/dist/paraglide/messages/field_tutorial_mode.d.ts +16 -0
- package/dist/paraglide/messages/field_tutorial_mode.js +29 -0
- package/dist/paraglide/messages/field_void_fraction.d.ts +16 -0
- package/dist/paraglide/messages/field_void_fraction.js +29 -0
- package/dist/paraglide/messages/tutorial_action_dismiss.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_action_dismiss.js +29 -0
- package/dist/paraglide/messages/tutorial_action_next.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_action_next.js +29 -0
- package/dist/paraglide/messages/tutorial_after_safe_deducible.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_after_safe_deducible.js +29 -0
- package/dist/paraglide/messages/tutorial_after_safe_guess.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_after_safe_guess.js +29 -0
- package/dist/paraglide/messages/tutorial_after_void.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_after_void.js +29 -0
- package/dist/paraglide/messages/tutorial_awaiting_first_click.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_awaiting_first_click.js +29 -0
- package/dist/paraglide/messages/tutorial_intro.d.ts +16 -0
- package/dist/paraglide/messages/tutorial_intro.js +29 -0
- package/dist/paraglide/messages/tutorial_won.d.ts +18 -0
- package/dist/paraglide/messages/tutorial_won.js +29 -0
- package/dist/styles/global.css +1 -1
- package/dist/tutorial.svelte.d.ts +42 -0
- package/dist/tutorial.svelte.js +116 -0
- package/dist/wasm/avoidant_wasm.d.ts +3 -3
- package/dist/wasm/avoidant_wasm.js +15 -15
- package/dist/wasm/avoidant_wasm_bg.wasm +0 -0
- package/dist/wasm/avoidant_wasm_bg.wasm.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* | output |
|
|
3
|
+
* | --- |
|
|
4
|
+
* | "Dismiss" |
|
|
5
|
+
*
|
|
6
|
+
* @param {Tutorial_Action_DismissInputs} inputs
|
|
7
|
+
* @param {{ locale?: "en" | "bn" }} options
|
|
8
|
+
* @returns {LocalizedString}
|
|
9
|
+
*/
|
|
10
|
+
export const tutorial_action_dismiss: ((inputs?: Tutorial_Action_DismissInputs, options?: {
|
|
11
|
+
locale?: "en" | "bn";
|
|
12
|
+
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Tutorial_Action_DismissInputs, {
|
|
13
|
+
locale?: "en" | "bn";
|
|
14
|
+
}, {}>;
|
|
15
|
+
export type LocalizedString = import("../runtime.js").LocalizedString;
|
|
16
|
+
export type Tutorial_Action_DismissInputs = {};
|
|
@@ -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_DismissInputs */
|
|
7
|
+
|
|
8
|
+
const en_tutorial_action_dismiss = /** @type {(inputs: Tutorial_Action_DismissInputs) => LocalizedString} */ () => {
|
|
9
|
+
return /** @type {LocalizedString} */ (`Dismiss`)
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const bn_tutorial_action_dismiss = /** @type {(inputs: Tutorial_Action_DismissInputs) => LocalizedString} */ () => {
|
|
13
|
+
return /** @type {LocalizedString} */ (`বাতিল করুন`)
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* | output |
|
|
18
|
+
* | --- |
|
|
19
|
+
* | "Dismiss" |
|
|
20
|
+
*
|
|
21
|
+
* @param {Tutorial_Action_DismissInputs} inputs
|
|
22
|
+
* @param {{ locale?: "en" | "bn" }} options
|
|
23
|
+
* @returns {LocalizedString}
|
|
24
|
+
*/
|
|
25
|
+
export const tutorial_action_dismiss = /** @type {((inputs?: Tutorial_Action_DismissInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tutorial_Action_DismissInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
|
|
26
|
+
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
|
27
|
+
if (locale === "en") return en_tutorial_action_dismiss(inputs)
|
|
28
|
+
return bn_tutorial_action_dismiss(inputs)
|
|
29
|
+
});
|
|
@@ -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 neighbors 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
|
+
});
|
package/dist/styles/global.css
CHANGED
|
@@ -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,116 @@
|
|
|
1
|
+
import { m } from "./paraglide/messages";
|
|
2
|
+
import { getLocale } from "./paraglide/runtime";
|
|
3
|
+
export class TutorialState {
|
|
4
|
+
phase = $state({ kind: "intro" });
|
|
5
|
+
get text() {
|
|
6
|
+
switch (this.phase.kind) {
|
|
7
|
+
case "intro":
|
|
8
|
+
return m.tutorial_intro();
|
|
9
|
+
case "awaitingFirstClick":
|
|
10
|
+
return m.tutorial_awaiting_first_click();
|
|
11
|
+
case "afterVoid":
|
|
12
|
+
return m.tutorial_after_void();
|
|
13
|
+
case "afterSafeGuess":
|
|
14
|
+
return m.tutorial_after_safe_guess();
|
|
15
|
+
case "afterSafeDeducible":
|
|
16
|
+
return m.tutorial_after_safe_deducible();
|
|
17
|
+
case "won":
|
|
18
|
+
return m.tutorial_won({
|
|
19
|
+
percent: Math.round(this.phase.efficiency * 100).toLocaleString(getLocale()),
|
|
20
|
+
});
|
|
21
|
+
case "done":
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Whether the UI should show a Next button to advance manually. */
|
|
26
|
+
get canAdvance() {
|
|
27
|
+
return this.phase.kind === "intro";
|
|
28
|
+
}
|
|
29
|
+
/** Whether cell click handlers should forward clicks to the game. */
|
|
30
|
+
get isExplorationAllowed() {
|
|
31
|
+
return this.phase.kind !== "intro" && this.phase.kind !== "won" && this.phase.kind !== "done";
|
|
32
|
+
}
|
|
33
|
+
/** Cell to visually highlight as provably safe, if any. */
|
|
34
|
+
get highlightedCellIndex() {
|
|
35
|
+
return this.phase.kind === "afterSafeDeducible" ? this.phase.deducibleCellIndex : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Advance from the intro to the interactive phase. */
|
|
38
|
+
next() {
|
|
39
|
+
if (this.phase.kind === "intro") {
|
|
40
|
+
this.phase = { kind: "awaitingFirstClick" };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
observeExplore(cellIndex, cells, metadata) {
|
|
44
|
+
if (!this.isExplorationAllowed)
|
|
45
|
+
return;
|
|
46
|
+
const entry = metadata[cellIndex];
|
|
47
|
+
if (!entry)
|
|
48
|
+
return;
|
|
49
|
+
if (entry.isVoid) {
|
|
50
|
+
this.phase = { kind: "afterVoid", cellIndex };
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const deducible = findDeducibleSafeCell(cells, metadata, cellIndex);
|
|
54
|
+
this.phase =
|
|
55
|
+
deducible === undefined
|
|
56
|
+
? { kind: "afterSafeGuess", cellIndex }
|
|
57
|
+
: {
|
|
58
|
+
kind: "afterSafeDeducible",
|
|
59
|
+
clickedCellIndex: cellIndex,
|
|
60
|
+
deducibleCellIndex: deducible,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
observeWin(efficiency) {
|
|
64
|
+
if (this.phase.kind === "won" || this.phase.kind === "done")
|
|
65
|
+
return;
|
|
66
|
+
this.phase = { kind: "won", efficiency };
|
|
67
|
+
}
|
|
68
|
+
dismiss() {
|
|
69
|
+
this.phase = { kind: "done" };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 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.
|
|
74
|
+
*
|
|
75
|
+
* 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.
|
|
76
|
+
*/
|
|
77
|
+
export function findDeducibleSafeCell(cells, metadata, preferredSourceCell) {
|
|
78
|
+
const tryFrom = (sourceCell) => {
|
|
79
|
+
const entry = metadata[sourceCell];
|
|
80
|
+
if (!entry || !entry.isExplored || entry.isVoid)
|
|
81
|
+
return undefined;
|
|
82
|
+
const neighbours = cells[sourceCell]?.neighbors;
|
|
83
|
+
if (!neighbours)
|
|
84
|
+
return undefined;
|
|
85
|
+
let knownVoids = 0;
|
|
86
|
+
let firstUnexplored;
|
|
87
|
+
for (const n of neighbours) {
|
|
88
|
+
if (!metadata[n])
|
|
89
|
+
continue;
|
|
90
|
+
if (metadata[n].isExplored) {
|
|
91
|
+
if (metadata[n].isVoid)
|
|
92
|
+
knownVoids++;
|
|
93
|
+
}
|
|
94
|
+
else if (firstUnexplored === undefined) {
|
|
95
|
+
firstUnexplored = n;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (firstUnexplored !== undefined && entry.voidNeighborCount === knownVoids) {
|
|
99
|
+
return firstUnexplored;
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
};
|
|
103
|
+
if (preferredSourceCell !== undefined) {
|
|
104
|
+
const direct = tryFrom(preferredSourceCell);
|
|
105
|
+
if (direct !== undefined)
|
|
106
|
+
return direct;
|
|
107
|
+
}
|
|
108
|
+
for (let c = 0; c < cells.length; c++) {
|
|
109
|
+
if (c === preferredSourceCell)
|
|
110
|
+
continue;
|
|
111
|
+
const found = tryFrom(c);
|
|
112
|
+
if (found !== undefined)
|
|
113
|
+
return found;
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
@@ -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
|
|
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
|
|
346
|
-
readonly
|
|
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;
|