Skip to content

Fayti1703/samual-binmat

 
 

Repository files navigation

Binmat Simulator

Test Lint Publish

If you need any help, open an issue.

Using To Test Your Binmat Bot

  1. Install Node.js, make a new folder, and open a command window in that folder.
  2. Run npx degit samualtnorman/binmat/examples/test-binmat-brain.
  3. Run npm install
  4. Edit index.js
    import { simulateGame } from "binmat"
    
    // the first argument is the defender's brain
    // and the second is the attacker's brain
    // in this case we are using the same brain for both
    simulateGame(brain, brain, {
        timeLimit: 5000, // in milliseconds
        onMove: (state, binlog) => console.log(binlog.join("\n"))
    })
    
    /** @type {import("binmat/simulateGame").BrainScript} */
    function brain(context, args, xform) {
        // you should fill this function with your brain code
    
        // xform() is the equivalent of #fs.binmat.x()
        xform({ op: "--" })
    }
  5. Run node index.js

How to Build for Hackmud

  1. Install Node.js, clone this repo, and open a command window in the newly cloned repo folder.
  2. Run npm install.
  3. Run npm run push-script.
    • This will print the number of characters needed to upload the script.
  4. Open hackmud, pick a user, and run #up binmat.

About

samual's binmat simulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.8%
  • TypeScript 34.2%