allbuild commit 6498a720

This commit is contained in:
Olivier Gagnon 2022-07-21 02:54:12 -04:00
parent 6498a720bb
commit e55a3f39d4
5 changed files with 37 additions and 29 deletions

4
dist/main.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

42
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1654,7 +1654,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
}, },
{ {
desc: (data: [string, number]): string => { desc: (_data: unknown): string => {
if (!Array.isArray(_data)) throw new Error("data should be array of string");
const data = _data as [string, number];
return [ return [
"Caesar cipher is one of the simplest encryption technique.", "Caesar cipher is one of the simplest encryption technique.",
"It is a type of substitution cipher in which each letter in the plaintext ", "It is a type of substitution cipher in which each letter in the plaintext ",
@ -1707,7 +1709,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
name: "Encryption I: Caesar Cipher", name: "Encryption I: Caesar Cipher",
numTries: 10, numTries: 10,
solver: (data: [string, number], ans: string): boolean => { solver: (_data: unknown, ans: string): boolean => {
if (!Array.isArray(_data)) throw new Error("data should be array of string");
const data = _data as [string, number];
// data = [plaintext, shift value] // data = [plaintext, shift value]
// build char array, shifting via map and join to final results // build char array, shifting via map and join to final results
const cipher = [...data[0]] const cipher = [...data[0]]
@ -1717,7 +1721,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
}, },
{ {
desc: (data: [string, string]): string => { desc: (_data: unknown): string => {
if (!Array.isArray(_data)) throw new Error("data should be array of string");
const data = _data as [string, string];
return [ return [
"Vigenère cipher is a type of polyalphabetic substitution. It uses ", "Vigenère cipher is a type of polyalphabetic substitution. It uses ",
"the Vigenère square to encrypt and decrypt plaintext with a keyword.\n\n", "the Vigenère square to encrypt and decrypt plaintext with a keyword.\n\n",
@ -1872,7 +1878,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
name: "Encryption II: Vigenère Cipher", name: "Encryption II: Vigenère Cipher",
numTries: 10, numTries: 10,
solver: (data: [string, string], ans: string): boolean => { solver: (_data: unknown, ans: string): boolean => {
if (!Array.isArray(_data)) throw new Error("data should be array of string");
const data = _data as [string, string];
// data = [plaintext, keyword] // data = [plaintext, keyword]
// build char array, shifting via map and corresponding keyword letter and join to final results // build char array, shifting via map and corresponding keyword letter and join to final results
const cipher = [...data[0]] const cipher = [...data[0]]