Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

516 B
Raw Blame
export function buildCounterbalancedSchedule(pairCount, firstArm, secondArm) {
  if (!Number.isInteger(pairCount) || pairCount <= 0 || pairCount % 2 !== 0) {
    throw new Error('Counterbalanced schedules require a positive even pair count')
  }
  if (!firstArm || !secondArm || firstArm === secondArm) {
    throw new Error('Counterbalanced schedules require two distinct arms')
  }

  return Array.from({ length: pairCount }, (_, index) =>
    index % 2 === 0 ? [firstArm, secondArm] : [secondArm, firstArm]
  )
}