Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const co = require('@colors/colors/safe')
- const c = document => console.log(document)
- const table = document => console.table(document)
- const br = () => c('\n')
- const mix = (min, max) => {
- min = Math.ceil(min)
- max = Math.floor(max)
- return Math.floor(Math.random() * (max - min + 1)) + min
- }
- const delay = time => new Promise(res => setTimeout(res, time))
- const enumerate = Object.freeze({
- 1: 'JOKER',
- 2: 'ROBBER',
- 3: 'DETECTIVE',
- 4: 'PETRUS',
- 5: 'CLOWN',
- 6: 'CIVILIAN',
- 7: 'OBSERVER'
- })
- const jid = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
- const deck = jid.length
- if (deck == 6) {
- var roles = [1, 2, 3, 4, 5, 6].sort(() => Math.random() - 0.5)
- } else if (deck == 7) {
- var roles = [1, 2, 3, 4, 5, 6, 6].sort(() => Math.random() - 0.5)
- } else if (deck == 8) {
- var roles = [1, 2, 3, 4, 4, 5, 6, 6].sort(() => Math.random() - 0.5)
- } else if (deck == 9) {
- var roles = [1, 2, 2, 3, 4, 5, 6, 6, 6].sort(() => Math.random() - 0.5)
- }
- const player = []
- jid.map((v, i) => player.push({
- jid: v,
- role: enumerate[roles[i]],
- leader: false,
- vote: 0,
- turn: false,
- alive: true
- }))
- let FTJ = {
- judgment: false,
- kill: false,
- shooter: false,
- investigate: false,
- stage: 1
- }
- let timeout = 5000,
- alive = player.filter(v => v.alive)
- const proc = setInterval(async () => {
- c(co.green(`Sirkularitas and act role here!!`))
- }, timeout)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement