mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
CONTRACTS: Hamming Code parity sentence clarification, "Find All Valid Math Expressions" missing line breaks added, example formatting made consistent (#1550)
This commit is contained in:
parent
1a8dcad02b
commit
2d1747b3e9
@ -1071,8 +1071,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"provide all of the possible results. The answer should be provided",
|
||||
"as an array of strings. If it is impossible to validate the string",
|
||||
"the result should be an array with only an empty string.\n\n",
|
||||
"IMPORTANT: The string may contain letters, not just parentheses.",
|
||||
`Examples:\n`,
|
||||
"IMPORTANT: The string may contain letters, not just parentheses.\n\n",
|
||||
`Examples:\n\n`,
|
||||
`"()())()" -> ["()()()", "(())()"]\n`,
|
||||
`"(a)())()" -> ["(a)()()", "(a())()"]\n`,
|
||||
`")(" -> [""]`,
|
||||
@ -1186,9 +1186,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"The data provided by this problem is an array with two elements. The first element",
|
||||
"is the string of digits, while the second element is the target number:\n\n",
|
||||
`["${digits}", ${target}]\n\n`,
|
||||
"NOTE: The order of evaluation expects script operator precedence",
|
||||
"NOTE: The order of evaluation expects script operator precedence.\n",
|
||||
"NOTE: Numbers in the expression cannot have leading 0's. In other words,",
|
||||
`"1+01" is not a valid expression`,
|
||||
`"1+01" is not a valid expression.\n\n`,
|
||||
"Examples:\n\n",
|
||||
`Input: digits = "123", target = 6\n`,
|
||||
`Output: ["1+2+3", "1*2*3"]\n\n`,
|
||||
@ -1295,14 +1295,14 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
`${n} \n\n`,
|
||||
"Convert it to a binary representation and encode it as an 'extended Hamming code'.\n ",
|
||||
"The number should be converted to a string of '0' and '1' with no leading zeroes.\n",
|
||||
"Parity bits are inserted at positions 0 and 2^N.\n",
|
||||
"A parity bit is inserted at position 0 and at every position N where N is a power of 2.\n",
|
||||
"Parity bits are used to make the total number of '1' bits in a given set of data even.\n",
|
||||
"The parity bit at position 0 considers all bits including parity bits.\n",
|
||||
"Each parity bit at position 2^N alternately considers N bits then ignores N bits, starting at position 2^N.\n",
|
||||
"The endianness of the parity bits is reversed compared to the endianness of the data bits:\n",
|
||||
"Data bits are encoded most significant bit first and the parity bits encoded least significant bit first.\n",
|
||||
"The parity bit at position 0 is set last.\n\n",
|
||||
"Examples:\n",
|
||||
"Examples:\n\n",
|
||||
"8 in binary is 1000, and encodes to 11110000 (pppdpddd - where p is a parity bit and d is a data bit)\n",
|
||||
"21 in binary is 10101, and encodes to 1001101011 (pppdpdddpd)\n\n",
|
||||
"For more information on the 'rule' of encoding, refer to Wikipedia (https://wikipedia.org/wiki/Hamming_code)",
|
||||
@ -1329,7 +1329,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
`'${n}' \n\n`,
|
||||
"Decode it as an 'extended Hamming code' and convert it to a decimal value.\n",
|
||||
"The binary string may include leading zeroes.\n",
|
||||
"Parity bits are inserted at positions 0 and 2^N.\n",
|
||||
"A parity bit is inserted at position 0 and at every position N where N is a power of 2.\n",
|
||||
"Parity bits are used to make the total number of '1' bits in a given set of data even.\n",
|
||||
"The parity bit at position 0 considers all bits including parity bits.\n",
|
||||
"Each parity bit at position 2^N alternately considers 2^N bits then ignores 2^N bits, starting at position 2^N.\n",
|
||||
@ -1338,7 +1338,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"The parity bit at position 0 is set last.\n",
|
||||
"There is a ~55% chance for an altered bit at a random index.\n",
|
||||
"Find the possible altered bit, fix it and extract the decimal value.\n\n",
|
||||
"Examples:\n",
|
||||
"Examples:\n\n",
|
||||
"'11110000' passes the parity checks and has data bits of 1000, which is 8 in binary.\n",
|
||||
"'1001101010' fails the parity checks and needs the last bit to be corrected to get '1001101011',",
|
||||
"after which the data bits are found to be 10101, which is 21 in binary.\n\n",
|
||||
@ -1531,7 +1531,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"You are given the following input string:\n",
|
||||
` ${plaintext}\n`,
|
||||
"Encode it using run-length encoding with the minimum possible output length.\n\n",
|
||||
"Examples:\n",
|
||||
"Examples:\n\n",
|
||||
" aaaaabccc -> 5a1b3c\n",
|
||||
" aAaAaA -> 1a1A1a1A1a1A\n",
|
||||
" 111112333 -> 511233\n",
|
||||
@ -1618,7 +1618,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"You are given the following LZ-encoded string:\n",
|
||||
` ${compressed}\n`,
|
||||
"Decode it and output the original string.\n\n",
|
||||
"Example: decoding '5aaabb450723abb' chunk-by-chunk\n",
|
||||
"Example: decoding '5aaabb450723abb' chunk-by-chunk\n\n",
|
||||
" 5aaabb -> aaabb\n",
|
||||
" 5aaabb45 -> aaabbaaab\n",
|
||||
" 5aaabb450 -> aaabbaaab\n",
|
||||
|
Loading…
Reference in New Issue
Block a user