diff --git a/src/components/units/GameBody/AppGameBodyStatisticsMessage.vue b/src/components/units/GameBody/AppGameBodyStatisticsMessage.vue
index 9e77594c..2bf7790c 100644
--- a/src/components/units/GameBody/AppGameBodyStatisticsMessage.vue
+++ b/src/components/units/GameBody/AppGameBodyStatisticsMessage.vue
@@ -4,7 +4,7 @@
{{ currentLeftPlayerName }} and
{{ currentRightPlayerName }} are in a
- draw!
+ draw.
{{ currentPlayerName }}'s
@@ -13,8 +13,8 @@
{{ currentPlayerName }} should
{{ currentPositionValue }}
- the game in {{ currentRemoteness }}
- moves. {{ mexStr }}
+ the game in {{ currentRemoteness }}
+ moves. {{ mexStr }}
{{ currentPlayerName }} should
diff --git a/src/components/units/VVH/AppGameVvhBody.vue b/src/components/units/VVH/AppGameVvhBody.vue
index 63027129..f4ce4ce4 100644
--- a/src/components/units/VVH/AppGameVvhBody.vue
+++ b/src/components/units/VVH/AppGameVvhBody.vue
@@ -79,23 +79,25 @@
D
+ text-anchor="middle">{{ isPuzzleGame ? 'F' : 'D' }}
D
+ text-anchor="middle">{{ isPuzzleGame ? 'F' : 'D' }}
-
+
{{ remoteness }}
+
{{ remoteness }}
+
{{ remoteness }}
+
+
+
+ ?
+ ?
+ ?
+ ?
+
-
+
@@ -193,9 +222,6 @@
-
-
-
@@ -469,7 +495,7 @@
-
+
@@ -781,6 +807,7 @@
import { actionTypes, useStore } from "../../../scripts/plugins/store";
import VueSlider from "vue-slider-component";
import "vue-slider-component/theme/default.css";
+ import { Rounds } from "../../../scripts/gamesmanUni/types";
const store = useStore();
@@ -798,15 +825,77 @@
const currentRoundId = computed(() => store.getters.currentRoundId);
const currentPositionValue = computed(() => store.getters.currentPositionValue);
const currentRounds = computed(() => store.getters.currentRounds);
- const currentValuedRounds = computed(() =>
- currentRounds.value.filter(round => round.position.positionValue !== "unsolved")
- );
+ const currentFirstPlayerTurn = computed(() => store.getters.currentMatch.round.firstPlayerTurn);
+
+ // need to get max remoteness and whether there are unknown finites.
+ const getMaximumRemoteness = computed(() => {
+ const remotenesses = new Set();
+ var finiteUnknownRemotenessExists = false;
+ var infiniteNonDrawRemotenessExists = false;
+ for (let roundId = 1; roundId <= store.getters.currentRoundId; roundId++) {
+ const position = currentRounds.value[roundId].position;
+ if (position.positionValue !== "draw" && position.positionValue !== "unsolved") {
+ if (position.remoteness == -100) { // FINITE UNKNOWN
+ finiteUnknownRemotenessExists = true;
+ } else if (position.remoteness == -200) { // INFINITY
+ infiniteNonDrawRemotenessExists = true;
+ } else {
+ remotenesses.add(Number(position.remoteness));
+ }
+ }
+ if (options.value.showNextMoves) {
+ for (const move in position.availableMoves) {
+ const moveObj = position.availableMoves[move]
+ if (moveObj.positionValue !== "draw" && moveObj.positionValue !== "unsolved") {
+ if (moveObj.remoteness == -100) { // FINITE UNKNOWN
+ finiteUnknownRemotenessExists = true;
+ } else if (moveObj.remoteness == -200) { // INFINITY
+ infiniteNonDrawRemotenessExists = true;
+ } else {
+ remotenesses.add(Number(moveObj.remoteness));
+ }
+ }
+ }
+ }
+ }
+
+ remotenesses.add(0); // So that max doesn't error if list is empty
+ var maxRemoteness = Math.max(...remotenesses);
+ if (finiteUnknownRemotenessExists) {
+ maxRemoteness += 1;
+ }
+ return [maxRemoteness, finiteUnknownRemotenessExists, infiniteNonDrawRemotenessExists];
+ });
+
+ const maximumRemoteness = computed(() => Number(getMaximumRemoteness.value[0]));
+ const finiteUnknownRemotenessExists = computed(() => Boolean(getMaximumRemoteness.value[1]));
+ const infiniteNonDrawRemotenessExists = computed(() => Boolean(getMaximumRemoteness.value[2]));
+
+ const adjustedMaximumRemoteness = computed(() => finiteUnknownRemotenessExists.value ? maximumRemoteness.value - 1 : maximumRemoteness.value);
+
+ const currentValuedRounds = computed(() => {
+ var copy = JSON.parse(JSON.stringify(currentRounds.value)) as Rounds;
+
+ for (const round of copy) {
+ if (round.position.positionValue !== "unsolved") {
+ if (round.position.remoteness == -100) {
+ round.position.remoteness = maximumRemoteness.value;
+ }
+ for (const move in round.position.availableMoves) {
+ const moveObj = round.position.availableMoves[move]
+ if (moveObj.remoteness == -100) {
+ moveObj.remoteness = maximumRemoteness.value;
+ }
+ }
+ }
+ }
+ return copy.filter(round => round.position.positionValue !== "unsolved");
+ });
+
const currentValuedRoundId = computed(() =>
Math.max(0, currentRoundId.value - currentRounds.value.length + currentValuedRounds.value.length)
);
- const currentFirstPlayerTurn = computed(() => store.getters.currentMatch.round.firstPlayerTurn);
- const maximumRemoteness = computed(() => store.getters.maximumRemoteness(1, store.getters.currentRoundId));
const isEndOfMatch = computed(() => store.getters.isEndOfMatch);
const winningDirectionHeight = ref(2);
@@ -820,7 +909,7 @@
const yCoordinateWidth = ref(5);
const chartWidth = ref(50);
- const columnCount = computed(() => (isPuzzleGame.value ? 1 : 2) * (Math.max(5, maximumRemoteness.value) + 1));
+ const columnCount = computed(() => (isPuzzleGame.value ? 1 : 2) * (Math.max(1, maximumRemoteness.value) + 1));
const gridWidth = computed(() => chartWidth.value - 2 * yCoordinateWidth.value);
const columnWidth = computed(() => gridWidth.value / columnCount.value);
const gridLeft = computed(() => yCoordinateWidth.value);
diff --git a/src/scripts/gamesmanUni/index.ts b/src/scripts/gamesmanUni/index.ts
index 299808ea..9856dfac 100644
--- a/src/scripts/gamesmanUni/index.ts
+++ b/src/scripts/gamesmanUni/index.ts
@@ -271,23 +271,6 @@ const loadVariant = async (app: Types.App, payload: { gameType: string; gameId:
};
};
-export const getMaximumRemoteness = (app: Types.App, payload: { from: number; to: number }) => {
- const remotenesses = new Set();
- remotenesses.add(5); // In case all involved positions are draw, 5 shall be the default maximum remoteness.
- for (let roundId = payload.from; roundId <= payload.to; roundId++) {
- const round = app.currentMatch.rounds[roundId];
- if (round.position.positionValue !== "draw") remotenesses.add(round.position.remoteness);
- if (app.options.showNextMoves) {
- for (const availableMove in round.position.availableMoves) {
- if (round.position.availableMoves[availableMove].positionValue !== "draw") {
- remotenesses.add(round.position.availableMoves[availableMove].remoteness);
- }
- }
- }
- }
- return Math.max(...remotenesses);
-};
-
export const isEndOfMatch = (app: Types.App) =>
!app.currentMatch.round.position.remoteness ||
!Object.keys(app.currentMatch.round.position.availableMoves).length;
diff --git a/src/scripts/plugins/store/index.ts b/src/scripts/plugins/store/index.ts
index a36057fd..eac215e8 100644
--- a/src/scripts/plugins/store/index.ts
+++ b/src/scripts/plugins/store/index.ts
@@ -55,7 +55,6 @@ type Getters = {
(gameType: string, gameId: string, variantId: string) => ImageAutoGUIData;
isEndOfMatch(state: State): boolean;
locale(state: State): string;
- maximumRemoteness(state: State): (from: number, to: number) => number;
moveHistory(state: State): string;
onePlayerGameAPI(state: State): string;
position(state: State):
@@ -168,9 +167,6 @@ const getters: Vuex.GetterTree & Getters = {
GMU.isEndOfMatch(state.app),
locale: (state: State) =>
state.app.preferences.locale,
- maximumRemoteness: (state: State) =>
- (from: number, to: number) =>
- GMU.getMaximumRemoteness(state.app, { from, to }),
moveHistory: (state: State) =>
state.app.currentMatch.moveHistory,
onePlayerGameAPI: (state: State) =>