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
-- take all numbers from the 3rd until the second last line, multiply each | |
-- number with the associated multiplier from the list [10,5,6,7,8,9,11,13,14,15,16,2,3,17,18,19] | |
-- and sum everything up (modulo Int32) to get the checksum. | |
-- (hint: line 11, the 9th number in the list, is the cash amount) | |
-- in haskell: | |
import Data.Int | |
checksum :: [Int32] -> Int32 | |
checksum nums = sum $ zipWith (*) nums [10,5,6,7,8,9,11,13,14,15,16,2,3,17,18,19] |
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
// Colors reference | |
// You can use the following as so: | |
// console.log(colorCode, data); | |
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
// | |
// ... and so on. | |
export const reset = "\x1b[0m" | |
export const bright = "\x1b[1m" | |
export const dim = "\x1b[2m" |