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
// Bozo Sort - An anti-sorting algorithm | |
function bozoSort(arr = []) { | |
for (let i = 0; i < arr.length; i++) { | |
let tmp = arr[i]; | |
let swapIndex = Math.round(Math.random()*(arr.length-1)); | |
arr[i] = arr[swapIndex]; | |
arr[swapIndex] = tmp; | |
} |
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
function numeral(num) { | |
const ones = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']; | |
const tens = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC']; | |
const huns = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM']; | |
return [ | |
'X̅'.repeat(Math.floor(num/10000)), | |
'M'.repeat(Math.floor((num%10000)/1000)), | |
huns[Math.floor((num%1000)/100)], | |
tens[Math.floor(((num%1000)%100)/10)], | |
ones[Math.floor(((num%1000)%100)%10)] |
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
[ | |
{ | |
"suite": "hearts", | |
"value": 2, | |
"name": 2, | |
"nameFull": "2 of hearts" | |
}, | |
{ | |
"suite": "hearts", | |
"value": 3, |