diff options
| author | Abigail <abigail@abigail.be> | 2021-02-02 15:02:55 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-03-04 18:57:20 +0100 |
| commit | 2cf23d56635af6ce7adf743b7019c06c72927c01 (patch) | |
| tree | 2d8d6c3d0cfffb9c5962a7501dc2d2bb87b5f99b | |
| parent | 93542f2af1fbdf11fcdb75429826cc563f76c0fa (diff) | |
| download | perlweeklychallenge-club-2cf23d56635af6ce7adf743b7019c06c72927c01.tar.gz perlweeklychallenge-club-2cf23d56635af6ce7adf743b7019c06c72927c01.tar.bz2 perlweeklychallenge-club-2cf23d56635af6ce7adf743b7019c06c72927c01.zip | |
Add notes to README for part 1
| -rw-r--r-- | challenge-004/abigail/README.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index daf44cedce..05dfde6689 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -6,6 +6,20 @@ Write a script to output the same number of PI digits as the size of your script. Say, if your script size is `10`, it should print `3.141592653`. +### Notes +We're going to encode the digits (after the decimal dot) in groups +of 9 in base-91. 9 base-10 digits need 5 base-91 digits. We represent +the base-91 digits as ASCII characters, from '#' (0) to '~' (90). +Now, '#' to '~' covers a range of 92; however, when encoding, we +will be skipping '\'. Choosing a range from '#' to '~' while skipping +'\' means we can easily use this in double quoted strings (for languages +which don't do interpolation). + +This gives a reduction of 44% (9 decimals encoded in 5 characters). By +using 3242 digits of Pi, we decidate 1800 characters to the encoding +of Pi, which gives us plenty of room to write code to do the decoding +and printing. We may even need to filler comments to make it all work out. + ### Solutions * [AWK](awk/ch-1.awk) * [C](c/ch-1.c) |
