UNPKG

koishi-plugin-kbot

Version:
21 lines (20 loc) 583 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * @Author: Kabuda-czh * @Date: 2023-03-02 14:32:56 * @LastEditors: Kabuda-czh * @LastEditTime: 2023-03-02 14:34:49 * @FilePath: \KBot-App\plugins\kbot\src\plugins\tarot\shuffle.ts * @Description: * * Copyright (c) 2023 by Kabuda-czh, All Rights Reserved. */ function shuffle(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; } exports.default = shuffle;