Skip to content

Instantly share code, notes, and snippets.

@cold-coder
Last active January 2, 2023 13:46
Show Gist options
  • Save cold-coder/4e60e31d254e921255d37874c302bd48 to your computer and use it in GitHub Desktop.
Save cold-coder/4e60e31d254e921255d37874c302bd48 to your computer and use it in GitHub Desktop.
#PhotoOf2016摄影评比参与奖抽奖程序
// var url = 'https://gist.github.com/cold-coder/4e60e31d254e921255d37874c302bd48';
const guys2017 = ['*晓悦', '*亚玲', '*佳', '*芽琦', '*范贤', '*奕', '*俊余', '*国迁',
'*晓炜', '*bing', '*乐琦', '*晓婷', '*达嵩', '*明明', '*伟中', '*志强', '*建华',
'*慧', '*伟锋', '*传萍', '*霞琴', '*晶晶', '*利华', '*华', '*苗', '*玉娇','*亚松',
'*亮萍'];
const guys2018 = ['*晴怡','Allen','*永成','Rain','*志强','Mira','Jonathan','Rachel',
'*霞琴', '*国迁', '*帆', '*才标', '*俊杰', 'Angela', '*浩宁', '*艳敏','*佳宝',
'chen洁', '*婧', '*承其', '*赛', '*成庆', '*杰', '*奇', '*小静','*成', 'chu洁',
'*亮萍', '*佳'];
const guys2019 = ['*雅琪','*兴兰','*巧丽', '*俊杰', '*彬阳', '*鑫', '*雁秋', '*婧',
'zhu洁', '*华', '*帆', 'Allen', '*霞琴', '*云', '*志强', '*新超', '*熙游', '*吕靖',
'*辉', 'Jonathan', '*钧', '*才标', 'MasterChen洁', '*建雨', '*传萍', '*小培',
'*晓亮', '*锦', '*明明', '*希昊', '*奇', '*逝雪']
const guys2020 = ['*雁秋', '*坚平', '*浩宁', '*帆', '*雁', '*志强', '*洁蕾', '*新超',
'*小鱼', '君君', '*才标', '*洁', 'Allen', '*晓亮', '中', '明', '*霞琴', '*建华',
'*晴怡', '*传萍', '*娜', 'Andy', '旋子', '*建雨', '*雪婷', '*逝雪', '*泽敏', '*杰']
const guys2022 = ['Allen', '*新超', '*常青', '明', '*洁', '*赛', '*志强', '*颐泽',
'*捷', '*巧丽', '*俊余', '*响', '*晓明', '*仁杰', '*霞琴', '*范燕', '*远', '*丽媛',
'*洁蕾', '*晓兰', '*杰', '*建华', '*浩宁', '*红艳', '*雁秋', '*雪婷', '*晓婷', '妹妹',
'*赣锋', '*航', '*兴祥', '*辉', '中', '*占涛', '*成']
const luckyGuysCount = 5;
let guysThisYear = guys2022
const randomGen = n => Math.floor(Math.random() * n);
console.log(`共有${ guysThisYear.length }人参与活动`);
for (let i = 0; i < luckyGuysCount; i++) {
let index = randomGen(guysThisYear.length);
let luckyGuy = guysThisYear.splice(index, 1);
console.log(`第${ i + 1 }位中奖的是${luckyGuy}`);
}
@cold-coder
Copy link
Author

#PhotoOf2019Contest lucky draw update

@cold-coder
Copy link
Author

#PhotoOf2022Contest lucky draw update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment