Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - mass pack generation #803

Open
tiera3 opened this issue Sep 29, 2024 · 1 comment
Open

Feature Request - mass pack generation #803

tiera3 opened this issue Sep 29, 2024 · 1 comment

Comments

@tiera3
Copy link

tiera3 commented Sep 29, 2024

When using a detailed specification, it would be nice to have a way to generate a huge number of packs (eg 100,000) and output to a file that can be processed to check statistics to verify they match what is expected.

@Senryoku
Copy link
Owner

This should be pretty easy to do programmatically using a local copy. Here's a basic Typescript file that will dump 60 packs to a text file:

import fs from "fs";
import parseCardList from "./parseCardList.js";
import { isMessageError, isSocketError } from "./Message.js";
import { generateBoosterFromCustomCardList } from "./CustomCardList.js";

const ccl = parseCardList(fs.readFileSync("./test/data/DOMLayoutExample.txt", "utf8"), {});
if (isSocketError(ccl)) {
	console.error(ccl);
	process.exit(1);
}

const boosters = generateBoosterFromCustomCardList(ccl, 60, { withReplacement: true });
if (isMessageError(boosters)) {
	console.error(boosters);
	process.exit(1);
}

fs.writeFileSync("./boosters.txt", JSON.stringify(boosters, null, 2));

Let me know if you need help setting up the project locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants