diff --git a/backend/src/constants/funbox.ts b/backend/src/constants/funbox.ts index 8e021e914..99326daf6 100644 --- a/backend/src/constants/funbox.ts +++ b/backend/src/constants/funbox.ts @@ -119,6 +119,10 @@ const Funboxes: Record = { canGetPb: false, difficultyLevel: 1, }, + binary: { + canGetPb: false, + difficultyLevel: 1, + }, }; export default Funboxes; diff --git a/frontend/src/ts/test/funbox/funbox-list.ts b/frontend/src/ts/test/funbox/funbox-list.ts index 3af94c79f..77b2a34df 100644 --- a/frontend/src/ts/test/funbox/funbox-list.ts +++ b/frontend/src/ts/test/funbox/funbox-list.ts @@ -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[] { diff --git a/frontend/src/ts/test/funbox/funbox.ts b/frontend/src/ts/test/funbox/funbox.ts index f9f35a78b..38e6a2432 100644 --- a/frontend/src/ts/test/funbox/funbox.ts +++ b/frontend/src/ts/test/funbox/funbox.ts @@ -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); diff --git a/frontend/src/ts/utils/misc.ts b/frontend/src/ts/utils/misc.ts index 5b5d9e875..596f5859a 100644 --- a/frontend/src/ts/utils/misc.ts +++ b/frontend/src/ts/utils/misc.ts @@ -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"); +} diff --git a/frontend/static/funbox/_list.json b/frontend/static/funbox/_list.json index 6597644da..bb6abb17f 100644 --- a/frontend/static/funbox/_list.json +++ b/frontend/static/funbox/_list.json @@ -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 } ]