Encode item list into "cyclical"
// CommonJS
npm install cyclicaljs
const { encode } = require('cyclicaljs')
// githack
<script src="https://raw.githack.com/jojoee/cyclicaljs/master/src/index.js"></script>
// ES6
npm install cyclicaljs
import { encode } from "cyclicaljs"
const { encode } = require('cyclicaljs')
// example2
const nItems2 = 52
const items2 = Array.from({ length: 60 }, (_, i) => i).map(item => item % nItems2)
const encodedItems2 = encode(items2, nItems2)
console.log('encodedItems2', encodedItems2)
- Python: jojoee/cyclical