{"id":20789768,"url":"https://github.com/samualtnorman/binmat","last_synced_at":"2025-05-05T19:52:43.249Z","repository":{"id":38451194,"uuid":"340750311","full_name":"samualtnorman/binmat","owner":"samualtnorman","description":"binmat simulator for game hackmud","archived":false,"fork":false,"pushed_at":"2025-02-21T08:59:43.000Z","size":1036,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-02T23:48:00.184Z","etag":null,"topics":["binmat","hackmud","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samualtnorman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-20T20:48:19.000Z","updated_at":"2025-03-15T17:43:37.000Z","dependencies_parsed_at":"2024-03-28T16:55:15.539Z","dependency_job_id":"354f3a2e-c685-45a9-83c7-a405f5e18e4f","html_url":"https://github.com/samualtnorman/binmat","commit_stats":{"total_commits":113,"total_committers":2,"mean_commits":56.5,"dds":0.03539823008849563,"last_synced_commit":"7f5950b5d21a2cbc8111088432a001fa43abcc17"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":"samualtnorman/typescript-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fbinmat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fbinmat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fbinmat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samualtnorman%2Fbinmat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samualtnorman","download_url":"https://codeload.github.com/samualtnorman/binmat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252566535,"owners_count":21769054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binmat","hackmud","javascript","nodejs"],"created_at":"2024-11-17T15:29:08.079Z","updated_at":"2025-05-05T19:52:43.242Z","avatar_url":"https://github.com/samualtnorman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binmat\nSimulator and utility functions for the card game [binmat](https://github.com/DrizzlyBear/binmat_rules) from the video game\n[hackmud](https://hackmud.com/).\u003cbr\u003e\nIf you need any help, you can DM or `@samualn` in the [hackmud discord server](https://discord.gg/gxpEdwU8CC) or\n[open an issue](https://github.com/samualtnorman/binmat/issues/new).\n\nSupports Node.js 18, 20, and above.\n\n## Using Binmat Simulator To Test Your Binmat Bot\n0. Install [Node.js](https://nodejs.org/en/) and [Git](https://git-scm.com/downloads), make a new folder, and open a\n   command window in that folder\n1. Run `npx tiged samualtnorman/binmat/examples/test-binmat-brain`\n1. Run `npm install`\n1. Edit `index.js`\n\t```js\n\timport { simulateGame, Role } from \"binmat\"\n\n\t// the first argument is the defender's brain\n\t// and the second is the attacker's brain\n\t// in this case we are using the same brain for both\n\tconst winner = simulateGame(brain, brain, {\n\t\ttimeLimit: 5000, // in milliseconds\n\t\t// console.log() prints its arguments, here we are printing the binlog\n\t\tonMove: (state, binlog) =\u003e console.log(binlog.join(\"\\n\"))\n\t})\n\n\tif (winner == Role.Defender)\n\t\tconsole.log(\"The defender won!\")\n\telse\n\t\tconsole.log(\"The attacker won!\")\n\n\t/** @type {import(\"binmat/simulateGame\").BrainScript} */\n\tfunction brain(context, args, xform) {\n\t\t// you should fill this function with your brain code\n\n\t\t// xform() is the equivalent of #fs.binmat.x()\n\t\txform({ op: \"--\" })\n\t}\n\t```\n1. Run `node index.js`\n\n## Building Yourself\n### Setup\nFollow this first.\n\n1. Install [Node.js](https://nodejs.org/en/), [PNPM](https://pnpm.io/installation), and\n   [Git](https://git-scm.com/downloads)\n2. [Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this\n   [repository](https://github.com/samualtnorman/binmat)\n3. Open a command prompt `cd`'d into the cloned repository folder\n4. Run `pnpm install`\n\nIf you are on Windows, you will need to run the following commands inside Git Bash (or any other Unix compatible shell).\n\n### Building the package\nRun `scripts/package.sh`. The `dist` folder is what gets published to [NPM](https://www.npmjs.com/package/binmat).\n\n### Compiling the hackmud Scripts\nMake sure you have built the package first by following the instructions above.\n\nYou can run `pnpm hsm push game-scripts` and the scripts will be pushed straight to your users'\n`scripts` folders. Or you can run `pnpm hsm golf game-scripts/binmat.ts` and `pnpm hsm golf game-scripts/binmat_lib.ts`,\nthis will generate hackmud script files next to those source files.\n\n## Running the Tests\nRun `scripts/test.sh`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamualtnorman%2Fbinmat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamualtnorman%2Fbinmat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamualtnorman%2Fbinmat/lists"}