14 · 2026
สุ่มแบ่งกลุ่ม / สุ่มชื่อGroup Maker & Name Picker
วางรายชื่อแล้วสุ่มแบ่งกลุ่มให้ขนาดเท่ากัน ตั้งคู่ที่ห้ามอยู่กลุ่มเดียวกันได้ มีรหัสการสุ่มให้ตรวจสอบได้ว่ายุติธรรม และสุ่มเลือกคนตอบคำถามPaste a class list to make even groups, keep certain pairs apart, share a shuffle code that proves the draw was fair, or pick someone at random.
// Fisher–Yates + PRNG ที่กำหนด seed ได้for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]];}ใช้ทำอะไร
- วางรายชื่อจาก Excel หรือ LINE (ตัดเลขลำดับและชื่อซ้ำให้เอง)
- แบ่งตาม จำนวนกลุ่ม หรือ จำนวนคนต่อกลุ่ม — ขนาดกลุ่มต่างกันไม่เกิน 1 คน
- ตั้ง คู่ที่ห้ามอยู่กลุ่มเดียวกัน ได้
- รหัสการสุ่ม: รหัสเดิม + รายชื่อเดิม = ผลเดิมทุกครั้ง ครูบอกรหัสให้นักเรียนตรวจได้ว่าไม่ได้ล็อกผล
- สุ่มเลือก 1 คน แบบไม่ซ้ำคนเดิม พร้อมประวัติ
- คัดลอกผลไปวางใน LINE ได้
รายละเอียดทางเทคนิค
- สับรายชื่อด้วย Fisher–Yates และ PRNG mulberry32 ที่กำหนด seed ได้ (Math.random กำหนด seed ไม่ได้)
- แจกคนแบบวนทีละกลุ่มเพื่อให้ขนาดเท่ากัน แล้วค้นหาการสุ่มที่ละเมิดเงื่อนไขน้อยที่สุด ถ้าเป็นไปไม่ได้จะบอกตรงๆ
- แอนิเมชันตอนสุ่มปิดเองเมื่อตั้ง "ลดการเคลื่อนไหว" และประกาศผลให้ screen reader
What it does
- Paste names from Excel or a chat (numbering and duplicates are removed)
- Split by number of groups or people per group — sizes never differ by more than one
- Keep pairs apart
- Shuffle code: same code + same names = same result every time, so a teacher can prove the draw wasn't rigged
- Pick one person without repeats, with history
- Copy the result straight into a chat
Technical details
- Fisher–Yates shuffle driven by a seedable mulberry32 PRNG (Math.random can't be seeded)
- Names are dealt round-robin for even sizes, then the search keeps the shuffle with the fewest broken rules — and says so if a rule can't be met
- The picker animation respects "reduce motion" and the result is announced to screen readers