This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates a random subset of permutations of the given array, | |
* recursively calls itself until the randomly generated subset is | |
* the set of all permutations of the given array | |
* | |
* @param array | |
* @returns all permutations of array | |
*/ | |
const bogo_permutate = <T>(array:T[]):T[][] => | |
new Set(Array.from({ length: Array.from({ length: array.length }, (v, k) => k + 1).reduce((a, b) => a * b, 1) }, () => [...array].sort(() => .5 - Math.random())).map(e => JSON.stringify(e))).size < Array.from({ length: array.length }, (v, k) => k + 1).reduce((a, b) => a * b, 1) ? bogo_permutate(array) : Array.from({ length: Array.from({ length: array.length }, (v, k) => k + 1).reduce((a, b) => a * b, 1) }, () => [...array].sort(() => .5 - Math.random())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const text = ` | |
_I_ | |
_hort_ | |
_all_ | |
_of_u_ | |
_without_ | |
_cursed_i_ | |
_would_not | |
_have_ | |
_survived_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Automatically send google form responses to a discord channel/webhook | |
* | |
* Instructions: | |
* | |
* Edit the Google Sheet connected to your form | |
* Menu > Tools > Script Editor | |
* Copy and paste this into the file, remove anything there already | |
* Update the variables in the top section | |
* In the script editor hit run > myFunction to create the trigger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Discord = require("discord.js"); | |
const client = new Discord.Client(); | |
var usage = "`!hangman <channel id> <your phrase>`\n`Example: !hangman 368845035560763402 grandest nan is the man`"; | |
var letters = ["๐ฆ", "๐ง", "๐จ", "๐ฉ", "๐ช", "๐ซ", "๐ฌ", "๐ญ", "๐ฎ", "๐ฏ", "๐ฐ", "๐ฑ", "๐ฒ", "๐ณ", "๐ด", "๐ต", "๐ถ", "๐ท", "๐ธ", "๐น", "๐บ", "๐ป", "๐ผ", "๐ฝ", "๐พ", "๐ฟ"]; | |
var unicode = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; | |
var games = []; | |
var stages = [`\`\`\` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ayy |