mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
Added binary mode to funbox (#4005) robsassack
* Added binary mode to funbox * changed description and added punctionation off for binary funbox
This commit is contained in:
parent
259a36e57a
commit
3deb2809a1
5 changed files with 30 additions and 0 deletions
|
|
@ -119,6 +119,10 @@ const Funboxes: Record<string, MonkeyTypes.FunboxMetadata> = {
|
|||
canGetPb: false,
|
||||
difficultyLevel: 1,
|
||||
},
|
||||
binary: {
|
||||
canGetPb: false,
|
||||
difficultyLevel: 1,
|
||||
},
|
||||
};
|
||||
|
||||
export default Funboxes;
|
||||
|
|
|
|||
|
|
@ -203,6 +203,16 @@ const list: MonkeyTypes.FunboxMetadata[] = [
|
|||
numbers: [false],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "binary",
|
||||
alias: "numbers",
|
||||
info: "01000010 01100101 01100101 01110000 00100000 01100010 01101111 01101111 01110000 00101110",
|
||||
properties: ["ignoresLanguage", "ignoresLayout", "noLetters"],
|
||||
forcedConfig: {
|
||||
numbers: [false],
|
||||
punctuation: [false],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export function getAll(): MonkeyTypes.FunboxMetadata[] {
|
||||
|
|
|
|||
|
|
@ -520,6 +520,12 @@ FunboxList.setFunboxFunctions("IPv6", {
|
|||
},
|
||||
});
|
||||
|
||||
FunboxList.setFunboxFunctions("binary", {
|
||||
getWord(): string {
|
||||
return Misc.getBinary();
|
||||
},
|
||||
});
|
||||
|
||||
export function toggleScript(...params: string[]): void {
|
||||
FunboxList.get(Config.funbox).forEach((funbox) => {
|
||||
if (funbox.functions?.toggleScript) funbox.functions.toggleScript(params);
|
||||
|
|
|
|||
|
|
@ -1383,3 +1383,8 @@ export function isLocalhost(): boolean {
|
|||
location.hostname === ""
|
||||
);
|
||||
}
|
||||
|
||||
export function getBinary(): string {
|
||||
const ret = Math.floor(Math.random() * 256).toString(2);
|
||||
return ret.padStart(8, "0");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,5 +150,10 @@
|
|||
"alias": "network",
|
||||
"info": "For sysadmins with a long beard.",
|
||||
"canGetPb": false
|
||||
},
|
||||
{
|
||||
"name": "binary",
|
||||
"info": "01000010 01100101 01100101 01110000 00100000 01100010 01101111 01101111 01110000 00101110",
|
||||
"canGetPb": false
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue