11 13 15 19
4 5 6 7 8 9 10 11
read: load merge
local storage:
local storage:
AHex
version 2.0
AHex is a browser-based tool for displaying and analyzing Hex games (and, as of version 2.0, Havannah games). AHex supports navigating through a graph of positions and performs minimax calculation based on the user's evaluations of terminal positions in the graph. I say 'graph' rather than 'tree' and 'terminal positions' rather than 'leaf nodes' because transpositions create a structure with branches that can rejoin: a directed acyclic graph.
The most recently played move in a position is highlighted in red. Multiple red cells indicate multiple game histories leading to the current position (transposition).
In positions with only one cell highlighed in red, clicking the <— button will navigate back one move in the graph. When more than one cell is highlighted in red, click a red‑highlighted cell to navigate backward via the transposition of your choice. For consistency, clicking on a red‑highlighed cell navigates back even when there's only one red cell on the board.
Moves forward from a position are shown as rings (hollow stones) in cells. Clicking on a cell with a ring will navigate forward to the position reached by playing a stone in that cell. When there's only one way forward (only one ring shown on the board), clicking the —> button will navigate forward via that move.
Click any empty cell to play a move and add its position to the graph.
Clicking the delete button removes the current position from the graph. delete is grayed out (unavailable) for all but terminal positions.
Clicking the br<— or —>br button navigates backward or forward as far as possible until a branch (a position with multiple moves forward) is reached. br<— will also stop when reaching a position with multiple predecessors (transposition).
Clicking the |<— button navigates backward to the start of the game.
Version 2.0 supports bookmarking positions. Click the mark button to mark the current position, and click the —>mark button to navigate to marked position(s), if any. The mark button will change to unmark when a marked position is displayed; clicking it will unmark the current position.
In version 1.0, the —> and —>br buttons were grayed out when multiple ways forward existed. Starting with version 2.0, AHex will instead choose the branch that leads to a marked position in the fewest number of moves. If none of several ways forward leads to a marked position, AHex will make an arbitrary choice.
Clicking the adv. w or adv. b button marks a terminal position as advantageous to white or black, respectively. Advantages are automatically propagated to preceding positions in the graph (minimax).
AHex discards any advantage applied to a position once the position has descendants and it is assigned an evaluation as calculated by minimax. By comparison, jHex (a Java program for analyzing Hex games) quietly retains the advantage assigned to a position even after further moves are played from that position; its assigned advantage will reappear if the descendants are deleted.
A ring representing a move forward is marked with a plus or minus when the move leads to a position advantageous or disadvantageous to the respective player. E.g., a white plus means the move is advantageous to white. In terminal positions, the user‑given evaluation advantage (if any) is marked with plus or minus in the red‑highlighted (most‑recenly played) stone(s).
Clicking the ☰ icon above the northwest corner of the board shows a drop‑down menu of function buttons as follows:
Clicking the new Hex button in the drop‑down menu creates an empty Hex graph of the selected size.
Clicking the new Havannah button in the drop‑down menu creates a fresh Havannah graph of the selected size.
To read a graph previously saved to a file, click Choose File in the drop‑down menu and select the desired file. (The appearance of this button varies by browser; in Firefox it's Browse...) The only file format recognized for now is AHex's own format. There are two click-selectable options: load and merge. Load clears the graph before reading a file, whereas merge combines the existing graph with the graph read from a file. AHex will not merge graphs with mismatched board sizes, nor will it merge a Havannah graph with a Hex graph.
When merging graphs with conflicting advantages assigned to terminal positions, the advantages read from the file replace the existing ones in the current graph.
Clicking write in the drop‑menu will write the current graph to a file. Use the text field adjacent to the write button to specify the name of the file to write. Browsers usually save files to a "Downloads" directory but this is configurable.
Clicking undo in the drop‑down menu will revert to the graph as it was before the most recent new/read/undo operation. undo is useful after a read operation has failed due to errors detected in the file. Only one graph can be restored, not a stack of them.
The read and write functions are mediated by your browser's upload/download facilities. Although the files AHex writes are plain ASCII text, they are labeled "application/octet‑stream" to coax browsers into saving them rather than offering you the choice to open them with a text editor.
Starting with version 2.0, AHex also offers the option of reading/writing graphs to browser local storage. This provides a simpler user interface than filesystem read/write and it overwrites files rather than saving with a version number appended to the name. To use local storage, enter the name of the file to read/write/delete into the box next to "local storage:" in the drop-down menu, and click on any of the four buttons to the right (read, merge, write, delete). To view and select from whatever files are already saved in browser local storage, click on the drop-down box underneath the box for the file name.
Browsers limit the size of local storage available to each web page. The limit varies by browser, but 5 megabytes is typical and is usually enough for graphs containing a total of 100,000 positions.
AHex doesn't need an Internet connection. You can save its HTML to a file and bring it up in a browser at any time. It is self‑contained: it doesn't require any stylesheets, scripts, or images from other files. Please note, however, that browser local storage is specific to each web page. Local storage accessible from AHex loaded from a URL on minortriad.com is not the same storage accessible from a personal copy of AHex on your computer. Local storage is also browser- and computer-specific; data stored can't be accessed by a different browser nor by the same browser running on another computer.
Files written by AHex record the graph's nodes (positions) but not the edges (moves) connecting them. The edges are derived by AHex each time a file is read: an O(n²) operation. AHex takes less than one second to process a file with 10,000 positions when running on my desktop computer and about two seconds on my Android phone. If you start working with graphs larger than that, please let me know.
To analyze a Hex or Havannah game played on littlegolem.net, enter the game number in the form at https://minortriad.com/ahexlg.html or click the "Analyze game on minortriad.com" link on a LittleGolem Hex game page (thanks Richard!). To start AHex with a blank board, go to https://minortriad.com/ahex.html
AHex is a work in progress. I plan to support more features in future releases. Bug reports, comments, requests: email me or message me on LittleGolem.
version history:
Copyright 2020 Thomas E. Ace. AHex is free software with no warranty, licensed under a Creative Commons Attribution-NonCommercial 4.0 International license.
Privacy notice: minortriad.com maintains logs of HTTP/HTTPS requests, never shared with anyone. Its pages don't use cookies nor any other tracking mechanisms.
AHex is a browser-based tool for displaying and analyzing Hex games (and, as of version 2.0, Havannah games). AHex supports navigating through a graph of positions and performs minimax calculation based on the user's evaluations of terminal positions in the graph. I say 'graph' rather than 'tree' and 'terminal positions' rather than 'leaf nodes' because transpositions create a structure with branches that can rejoin: a directed acyclic graph.
The most recently played move in a position is highlighted in red. Multiple red cells indicate multiple game histories leading to the current position (transposition).
In positions with only one cell highlighed in red, clicking the <— button will navigate back one move in the graph. When more than one cell is highlighted in red, click a red‑highlighted cell to navigate backward via the transposition of your choice. For consistency, clicking on a red‑highlighed cell navigates back even when there's only one red cell on the board.
Moves forward from a position are shown as rings (hollow stones) in cells. Clicking on a cell with a ring will navigate forward to the position reached by playing a stone in that cell. When there's only one way forward (only one ring shown on the board), clicking the —> button will navigate forward via that move.
Click any empty cell to play a move and add its position to the graph.
Clicking the delete button removes the current position from the graph. delete is grayed out (unavailable) for all but terminal positions.
Clicking the br<— or —>br button navigates backward or forward as far as possible until a branch (a position with multiple moves forward) is reached. br<— will also stop when reaching a position with multiple predecessors (transposition).
Clicking the |<— button navigates backward to the start of the game.
Version 2.0 supports bookmarking positions. Click the mark button to mark the current position, and click the —>mark button to navigate to marked position(s), if any. The mark button will change to unmark when a marked position is displayed; clicking it will unmark the current position.
In version 1.0, the —> and —>br buttons were grayed out when multiple ways forward existed. Starting with version 2.0, AHex will instead choose the branch that leads to a marked position in the fewest number of moves. If none of several ways forward leads to a marked position, AHex will make an arbitrary choice.
Clicking the adv. w or adv. b button marks a terminal position as advantageous to white or black, respectively. Advantages are automatically propagated to preceding positions in the graph (minimax).
AHex discards any advantage applied to a position once the position has descendants and it is assigned an evaluation as calculated by minimax. By comparison, jHex (a Java program for analyzing Hex games) quietly retains the advantage assigned to a position even after further moves are played from that position; its assigned advantage will reappear if the descendants are deleted.
A ring representing a move forward is marked with a plus or minus when the move leads to a position advantageous or disadvantageous to the respective player. E.g., a white plus means the move is advantageous to white. In terminal positions, the user‑given evaluation advantage (if any) is marked with plus or minus in the red‑highlighted (most‑recenly played) stone(s).
Clicking the ☰ icon above the northwest corner of the board shows a drop‑down menu of function buttons as follows:
Clicking the new Hex button in the drop‑down menu creates an empty Hex graph of the selected size.
Clicking the new Havannah button in the drop‑down menu creates a fresh Havannah graph of the selected size.
To read a graph previously saved to a file, click Choose File in the drop‑down menu and select the desired file. (The appearance of this button varies by browser; in Firefox it's Browse...) The only file format recognized for now is AHex's own format. There are two click-selectable options: load and merge. Load clears the graph before reading a file, whereas merge combines the existing graph with the graph read from a file. AHex will not merge graphs with mismatched board sizes, nor will it merge a Havannah graph with a Hex graph.
When merging graphs with conflicting advantages assigned to terminal positions, the advantages read from the file replace the existing ones in the current graph.
Clicking write in the drop‑menu will write the current graph to a file. Use the text field adjacent to the write button to specify the name of the file to write. Browsers usually save files to a "Downloads" directory but this is configurable.
Clicking undo in the drop‑down menu will revert to the graph as it was before the most recent new/read/undo operation. undo is useful after a read operation has failed due to errors detected in the file. Only one graph can be restored, not a stack of them.
The read and write functions are mediated by your browser's upload/download facilities. Although the files AHex writes are plain ASCII text, they are labeled "application/octet‑stream" to coax browsers into saving them rather than offering you the choice to open them with a text editor.
Starting with version 2.0, AHex also offers the option of reading/writing graphs to browser local storage. This provides a simpler user interface than filesystem read/write and it overwrites files rather than saving with a version number appended to the name. To use local storage, enter the name of the file to read/write/delete into the box next to "local storage:" in the drop-down menu, and click on any of the four buttons to the right (read, merge, write, delete). To view and select from whatever files are already saved in browser local storage, click on the drop-down box underneath the box for the file name.
Browsers limit the size of local storage available to each web page. The limit varies by browser, but 5 megabytes is typical and is usually enough for graphs containing a total of 100,000 positions.
AHex doesn't need an Internet connection. You can save its HTML to a file and bring it up in a browser at any time. It is self‑contained: it doesn't require any stylesheets, scripts, or images from other files. Please note, however, that browser local storage is specific to each web page. Local storage accessible from AHex loaded from a URL on minortriad.com is not the same storage accessible from a personal copy of AHex on your computer. Local storage is also browser- and computer-specific; data stored can't be accessed by a different browser nor by the same browser running on another computer.
Files written by AHex record the graph's nodes (positions) but not the edges (moves) connecting them. The edges are derived by AHex each time a file is read: an O(n²) operation. AHex takes less than one second to process a file with 10,000 positions when running on my desktop computer and about two seconds on my Android phone. If you start working with graphs larger than that, please let me know.
To analyze a Hex or Havannah game played on littlegolem.net, enter the game number in the form at https://minortriad.com/ahexlg.html or click the "Analyze game on minortriad.com" link on a LittleGolem Hex game page (thanks Richard!). To start AHex with a blank board, go to https://minortriad.com/ahex.html
AHex is a work in progress. I plan to support more features in future releases. Bug reports, comments, requests: email me or message me on LittleGolem.
version history:
version | date | changes |
---|---|---|
1.0 | 24 Sep 2020 |
initial release |
2.0 | 8 Oct 2020 |
local storage, marked positions, Havannah |
Copyright 2020 Thomas E. Ace. AHex is free software with no warranty, licensed under a Creative Commons Attribution-NonCommercial 4.0 International license.
Privacy notice: minortriad.com maintains logs of HTTP/HTTPS requests, never shared with anyone. Its pages don't use cookies nor any other tracking mechanisms.