문제 범위

문제 배분 결과

문제 배분용 로직

const members = ['최재영', '손수림', '통붕이', '이지열'];

// 문제 범위가 8 ~ 17번이라면 start에 8을 end에 17을 대입하면 된다.
function randomNumber(start, end) {
  let startMinusOne = start - 1;
  return Math.ceil(Math.random() * (end - startMinusOne) + startMinusOne);
}

// 중복 번호 제거하는 로직 나중에 적용하면 좋을 것!

for (const member of members) {
  console.log(`${member} 님에게 할당된 문제는 ${randomNumber(8, 17)}번입니다`)
}

발표 순서 결과