A small repository for useful scripts for The Counting Apparatus, a discord counting game.
The main function of this repository is to generate XC solutions using a curated list of functions (./limited_use.js).
It also has smaller workflows to:
- Extract Tree grid colors from a Tree grid image (
./tree_extract) - Generate solutions for Tree's gwa minigame (
./tree_gwa_gen)
The root generator reads a file containing a manual spreadsheet export from the Apparatus Progress Function List tab, filters out unavailable or corrupted functions, and searches for valid solution expressions within the configured limits. The tree_* folders contain browser-based helper tools for the other two workflows.
This project contains three workflows, each with a different entry point:
- XC solution generation at
limited_use.js - Tree grid color extraction using the browser helper at
./tree_extract/index.html - Tree gwa minigame solution generation using the browser helper at
./tree_gwa_gen/index.html
Prerequisites:
- Node.js installed
Instructions:
- Create a file named
func_list.txtin the project root. - Paste spreadsheet columns B-G from the Apparatus Progress
Function Listtab into that file (found here). - Run the generator script from the project root:
node limited_use.jsThis generates solutions based on the currently available functions.
To generate the reduced/minimal list when restores or alternative options are available:
node limited_use.js min- Review the output in
generated.txt.
Open the helper page in a browser:
./tree_extract/index.htmlThis tool helps extract relevant colors or values from a Tree grid image. The extracted data can be found in the browser console.
Open the helper page in a browser:
./tree_gwa_gen/index.htmlThis tool generates candidate solutions for the Tree gwa minigame.
| File | Purpose |
|---|---|
| limited_use.js | Main entry point. Searches for valid solutions and writes the output file generated.txt. |
| const.js | Core limits and configuration values such as solution bounds and function limits. |
| func_info.js | Reads func_list.txt and classifies each function as wiped, corrupted, or unlocked. |
| const_funcs.js | Maps numeric values to names and filters available number constants. |
| unary.js | Unary function definitions and helper logic used during solution generation. |
| binary.js | Binary function definitions used in valid solution combinations. |
| identity_funcs.js | Identity functions used for padding output expressions to meet function usage requirements. |
| func_list.txt | Input export from the spreadsheet. This file is not included in the repository template and must be created locally. |
| generated.txt | Generated report created by the script. This file is not included in the repository template and is automatically generated by limited_use.js. |
| tree_extract/index.html | Browser helper page for extraction-related tooling. |
| tree_extract/script.js | Supporting script for the tree grid extraction helper. |
| tree_gwa_gen/index.html | Browser helper page for gwa image generation tooling. |
| tree_gwa_gen/script.js | Supporting script for the gwa image generation helper. |
The dependency structure is straightforward:
- limited_use.js is the orchestrator. It imports the configuration and function definitions, then runs the search logic.
- const.js provides the numerical limits and global constants used by the generator and by unary.js and binary.js.
- func_info.js reads func_list.txt and exports the metadata used to decide which functions are available or invalid.
- const_funcs.js depends on the
unlockeddata from func_info.js to filter valid numeric values and names. - unary.js and binary.js define the operation sets used by the search.
- identity_funcs.js also depends on the same function metadata and is used when building output expressions and additional identity steps.
- limited_use.js writes the final output to generated.txt, but the output is not used as an input by the generator itself.
In short, the main chain is:
func_list.txt -> func_info.js -> const_funcs.js + unary.js + binary.js + identity_funcs.js -> limited_use.js -> generated.txt
Warning: the code was written quickly and was not originally designed for public review. It is functional for the author's use case, but it is not especially polished or heavily documented.
This project is mainly a utility script repository rather than a general-purpose library.