How to use the js-combinatorics.Combinatorics function in js-combinatorics

To help you get started, we’ve selected a few js-combinatorics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kengz / Risk-game / main.js View on Github external
// The main class that runs arena multiple times and export for analysis

// dependencies
var cmb = require('js-combinatorics').Combinatorics;
var _ = require('underscore');
var fs = require('fs');

// For configs
// var ps = require('./srcdata/filtered-AI-personalities.json');
var ps = require('./srcdata/AI-personalities.json');
var pls = ['p0','p1','p2'];
// The max turn for a game
var max = 300;

// The game constructor from arena
var game = require('./arena.js').Game;

// repeat games for a fixed config: personalities, player order.
function repeat(n, c, o) {
	// the game-series