Full Code of zertovitch/hac for AI

master 482c22ea8a00 cached
670 files
4.3 MB
1.2M tokens
1 requests
Download .txt
Showing preview only (4,682K chars total). Download the full file or copy to clipboard to get everything.
Repository: zertovitch/hac
Branch: master
Commit: 482c22ea8a00
Files: 670
Total size: 4.3 MB

Directory structure:
gitextract_y017oy4y/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── LICENSE
├── build.cmd
├── debug.pra
├── demo/
│   ├── data_exchange/
│   │   ├── exchange_common.ads
│   │   ├── exchange_hac_side.adb
│   │   ├── exchange_native_side.adb
│   │   ├── exchange_native_side_pkg.adb
│   │   └── exchange_native_side_pkg.ads
│   ├── data_exchange_simple/
│   │   ├── exchange_hac_side_simple.adb
│   │   ├── exchange_native_side_pkg_simple.adb
│   │   ├── exchange_native_side_pkg_simple.ads
│   │   └── exchange_native_side_simple.adb
│   ├── hac_demo.gpr
│   └── hac_demo.prj
├── doc/
│   ├── archeology/
│   │   └── smallada_doc.txt
│   ├── hac.txt
│   └── hac_work.xls
├── exm/
│   ├── ackermann.adb
│   ├── anti_primes.adb
│   ├── aoc/
│   │   ├── 2020/
│   │   │   ├── aoc_2020.gpr
│   │   │   ├── aoc_2020.prj
│   │   │   ├── aoc_2020_02.adb
│   │   │   ├── aoc_2020_02.txt
│   │   │   ├── aoc_2020_03.adb
│   │   │   ├── aoc_2020_03.txt
│   │   │   ├── aoc_2020_04.adb
│   │   │   ├── aoc_2020_04.txt
│   │   │   ├── aoc_2020_04_b_full_ada.adb
│   │   │   ├── aoc_2020_05.adb
│   │   │   ├── aoc_2020_05.txt
│   │   │   ├── aoc_2020_06.adb
│   │   │   ├── aoc_2020_06.txt
│   │   │   ├── aoc_2020_06_full_ada.adb
│   │   │   ├── aoc_2020_06_full_ada_using_hat.adb
│   │   │   ├── aoc_2020_07.adb
│   │   │   ├── aoc_2020_07.txt
│   │   │   ├── aoc_2020_07_full_ada.adb
│   │   │   ├── aoc_2020_07_full_ada_vectors_2x.adb
│   │   │   ├── aoc_2020_08.adb
│   │   │   ├── aoc_2020_08.txt
│   │   │   ├── aoc_2020_09.adb
│   │   │   ├── aoc_2020_09.txt
│   │   │   ├── aoc_2020_10.adb
│   │   │   ├── aoc_2020_10.txt
│   │   │   ├── aoc_2020_11.adb
│   │   │   ├── aoc_2020_11.txt
│   │   │   ├── aoc_2020_11_full_ada.adb
│   │   │   ├── aoc_2020_11_mini.txt
│   │   │   ├── aoc_2020_12.adb
│   │   │   ├── aoc_2020_12.txt
│   │   │   ├── aoc_2020_13.adb
│   │   │   ├── aoc_2020_13.txt
│   │   │   ├── aoc_2020_14.txt
│   │   │   ├── aoc_2020_14_exm_1.txt
│   │   │   ├── aoc_2020_14_exm_2.txt
│   │   │   ├── aoc_2020_14_full_ada.adb
│   │   │   ├── aoc_2020_14_jc.txt
│   │   │   ├── aoc_2020_15.adb
│   │   │   ├── aoc_2020_15_full_ada.adb
│   │   │   ├── aoc_2020_15_full_ada_hashed_maps.adb
│   │   │   ├── aoc_2020_16.adb
│   │   │   ├── aoc_2020_16.txt
│   │   │   ├── aoc_2020_17.adb
│   │   │   ├── aoc_2020_17.txt
│   │   │   ├── aoc_2020_18.txt
│   │   │   ├── aoc_2020_18_full_ada.adb
│   │   │   ├── aoc_2020_18_weird_formulas.adb
│   │   │   ├── aoc_2020_18_weird_formulas.ads
│   │   │   ├── aoc_2020_19.txt
│   │   │   ├── aoc_2020_19_full_ada.adb
│   │   │   ├── aoc_2020_20.adb
│   │   │   ├── aoc_2020_20.txt
│   │   │   ├── aoc_2020_21.txt
│   │   │   ├── aoc_2020_21_full_ada.adb
│   │   │   ├── aoc_2020_21_full_ada_preproc.adb
│   │   │   ├── aoc_2020_22.adb
│   │   │   ├── aoc_2020_22.txt
│   │   │   ├── aoc_2020_22_full_ada.adb
│   │   │   ├── aoc_2020_23.adb
│   │   │   ├── aoc_2020_23_simple_array.adb
│   │   │   ├── aoc_2020_24.adb
│   │   │   ├── aoc_2020_24.txt
│   │   │   └── aoc_2020_25.adb
│   │   ├── 2021/
│   │   │   ├── aoc_2021.gpr
│   │   │   ├── aoc_2021_01.adb
│   │   │   ├── aoc_2021_01.txt
│   │   │   ├── aoc_2021_01_questions.txt
│   │   │   ├── aoc_2021_02.adb
│   │   │   ├── aoc_2021_02.txt
│   │   │   ├── aoc_2021_02_questions.txt
│   │   │   ├── aoc_2021_03.adb
│   │   │   ├── aoc_2021_03.txt
│   │   │   ├── aoc_2021_03_questions.txt
│   │   │   ├── aoc_2021_04.adb
│   │   │   ├── aoc_2021_04.txt
│   │   │   ├── aoc_2021_04_questions.txt
│   │   │   ├── aoc_2021_05.adb
│   │   │   ├── aoc_2021_05.txt
│   │   │   ├── aoc_2021_05_questions.txt
│   │   │   ├── aoc_2021_06.adb
│   │   │   ├── aoc_2021_06.txt
│   │   │   ├── aoc_2021_06_questions.txt
│   │   │   ├── aoc_2021_07.adb
│   │   │   ├── aoc_2021_07.txt
│   │   │   ├── aoc_2021_07_questions.txt
│   │   │   ├── aoc_2021_08.adb
│   │   │   ├── aoc_2021_08.txt
│   │   │   ├── aoc_2021_08_questions.txt
│   │   │   ├── aoc_2021_09.adb
│   │   │   ├── aoc_2021_09.txt
│   │   │   ├── aoc_2021_09_questions.txt
│   │   │   ├── aoc_2021_10.adb
│   │   │   ├── aoc_2021_10.txt
│   │   │   ├── aoc_2021_10_questions.txt
│   │   │   ├── aoc_2021_11.adb
│   │   │   ├── aoc_2021_11.txt
│   │   │   ├── aoc_2021_11_questions.txt
│   │   │   ├── aoc_2021_12.adb
│   │   │   ├── aoc_2021_12.txt
│   │   │   ├── aoc_2021_12_questions.txt
│   │   │   ├── aoc_2021_13.adb
│   │   │   ├── aoc_2021_13.txt
│   │   │   ├── aoc_2021_13_questions.txt
│   │   │   ├── aoc_2021_14.adb
│   │   │   ├── aoc_2021_14.txt
│   │   │   ├── aoc_2021_14_questions.txt
│   │   │   ├── aoc_2021_15.adb
│   │   │   ├── aoc_2021_15.txt
│   │   │   ├── aoc_2021_15_questions.txt
│   │   │   ├── aoc_2021_16.adb
│   │   │   ├── aoc_2021_16.txt
│   │   │   ├── aoc_2021_16_questions.txt
│   │   │   ├── aoc_2021_17.adb
│   │   │   ├── aoc_2021_17_questions.txt
│   │   │   ├── aoc_2021_18.txt
│   │   │   ├── aoc_2021_18_full_ada.adb
│   │   │   ├── aoc_2021_18_questions.txt
│   │   │   ├── aoc_2021_19.adb
│   │   │   ├── aoc_2021_19.txt
│   │   │   ├── aoc_2021_19_questions.txt
│   │   │   ├── aoc_2021_20.adb
│   │   │   ├── aoc_2021_20.txt
│   │   │   ├── aoc_2021_20_questions.txt
│   │   │   ├── aoc_2021_21.adb
│   │   │   ├── aoc_2021_21_questions.txt
│   │   │   ├── aoc_2021_22.adb
│   │   │   ├── aoc_2021_22.txt
│   │   │   └── aoc_2021_22_questions.txt
│   │   ├── 2022/
│   │   │   ├── aoc_2022.gpr
│   │   │   ├── aoc_2022_01.adb
│   │   │   ├── aoc_2022_01.txt
│   │   │   ├── aoc_2022_01_questions.txt
│   │   │   ├── aoc_2022_02.adb
│   │   │   ├── aoc_2022_02.txt
│   │   │   ├── aoc_2022_02_questions.txt
│   │   │   ├── aoc_2022_03.adb
│   │   │   ├── aoc_2022_03.txt
│   │   │   ├── aoc_2022_03_questions.txt
│   │   │   ├── aoc_2022_04.adb
│   │   │   ├── aoc_2022_04.txt
│   │   │   ├── aoc_2022_04_questions.txt
│   │   │   ├── aoc_2022_05.adb
│   │   │   ├── aoc_2022_05.txt
│   │   │   ├── aoc_2022_05_questions.txt
│   │   │   ├── aoc_2022_06.adb
│   │   │   ├── aoc_2022_06.txt
│   │   │   ├── aoc_2022_06_questions.txt
│   │   │   ├── aoc_2022_07.adb
│   │   │   ├── aoc_2022_07.txt
│   │   │   ├── aoc_2022_07_questions.txt
│   │   │   ├── aoc_2022_08.adb
│   │   │   ├── aoc_2022_08.txt
│   │   │   ├── aoc_2022_08_questions.txt
│   │   │   ├── aoc_2022_09.adb
│   │   │   ├── aoc_2022_09.txt
│   │   │   ├── aoc_2022_09_questions.txt
│   │   │   ├── aoc_2022_10.adb
│   │   │   ├── aoc_2022_10.txt
│   │   │   ├── aoc_2022_10_questions.txt
│   │   │   ├── aoc_2022_11.adb
│   │   │   ├── aoc_2022_11.txt
│   │   │   ├── aoc_2022_11_questions.txt
│   │   │   ├── aoc_2022_12.adb
│   │   │   ├── aoc_2022_12.txt
│   │   │   ├── aoc_2022_12_questions.txt
│   │   │   ├── aoc_2022_13.adb
│   │   │   ├── aoc_2022_13.txt
│   │   │   ├── aoc_2022_13_questions.txt
│   │   │   ├── aoc_2022_14.adb
│   │   │   ├── aoc_2022_14.txt
│   │   │   ├── aoc_2022_14_questions.txt
│   │   │   ├── aoc_2022_15.adb
│   │   │   ├── aoc_2022_15.txt
│   │   │   ├── aoc_2022_15_questions.txt
│   │   │   ├── aoc_2022_16.adb
│   │   │   ├── aoc_2022_16.txt
│   │   │   ├── aoc_2022_16_questions.txt
│   │   │   ├── aoc_2022_17.adb
│   │   │   ├── aoc_2022_17.txt
│   │   │   ├── aoc_2022_17_questions.txt
│   │   │   ├── aoc_2022_18.adb
│   │   │   ├── aoc_2022_18.txt
│   │   │   ├── aoc_2022_18_questions.txt
│   │   │   ├── aoc_2022_19.adb
│   │   │   ├── aoc_2022_19_full_ada.adb
│   │   │   ├── aoc_2022_19_questions.txt
│   │   │   ├── aoc_2022_20.adb
│   │   │   ├── aoc_2022_20.txt
│   │   │   ├── aoc_2022_20_questions.txt
│   │   │   ├── aoc_2022_21.adb
│   │   │   ├── aoc_2022_21_pkg.adb
│   │   │   ├── aoc_2022_21_pkg.ads
│   │   │   ├── aoc_2022_21_questions.txt
│   │   │   ├── aoc_2022_22.adb
│   │   │   ├── aoc_2022_22.txt
│   │   │   ├── aoc_2022_22_questions.txt
│   │   │   ├── aoc_2022_23.adb
│   │   │   ├── aoc_2022_23.txt
│   │   │   ├── aoc_2022_23_questions.txt
│   │   │   ├── aoc_2022_24.adb
│   │   │   ├── aoc_2022_24.txt
│   │   │   ├── aoc_2022_24_questions.txt
│   │   │   ├── aoc_2022_25.adb
│   │   │   ├── aoc_2022_25.txt
│   │   │   ├── aoc_2022_25_question.txt
│   │   │   ├── aoc_2022_xx.adb
│   │   │   └── gen_jumbo_day_1.adb
│   │   ├── 2023/
│   │   │   ├── aoc_2023.gpr
│   │   │   ├── aoc_2023_01.adb
│   │   │   ├── aoc_2023_01.txt
│   │   │   ├── aoc_2023_01_questions.txt
│   │   │   ├── aoc_2023_02.adb
│   │   │   ├── aoc_2023_02.txt
│   │   │   ├── aoc_2023_02_questions.txt
│   │   │   ├── aoc_2023_03.adb
│   │   │   ├── aoc_2023_03.txt
│   │   │   ├── aoc_2023_03_questions.txt
│   │   │   ├── aoc_2023_04.adb
│   │   │   ├── aoc_2023_04.txt
│   │   │   ├── aoc_2023_04_questions.txt
│   │   │   ├── aoc_2023_05.adb
│   │   │   ├── aoc_2023_05.txt
│   │   │   ├── aoc_2023_05_questions.txt
│   │   │   ├── aoc_2023_06.adb
│   │   │   ├── aoc_2023_06_questions.txt
│   │   │   ├── aoc_2023_07.adb
│   │   │   ├── aoc_2023_07.txt
│   │   │   ├── aoc_2023_07_questions.txt
│   │   │   ├── aoc_2023_08.adb
│   │   │   ├── aoc_2023_08.txt
│   │   │   ├── aoc_2023_08_questions.txt
│   │   │   ├── aoc_2023_09.adb
│   │   │   ├── aoc_2023_09.txt
│   │   │   ├── aoc_2023_09_questions.txt
│   │   │   ├── aoc_2023_10.adb
│   │   │   ├── aoc_2023_10.txt
│   │   │   ├── aoc_2023_10_questions.txt
│   │   │   ├── aoc_2023_11.adb
│   │   │   ├── aoc_2023_11.txt
│   │   │   ├── aoc_2023_11_questions.txt
│   │   │   ├── aoc_2023_12.adb
│   │   │   ├── aoc_2023_12.txt
│   │   │   ├── aoc_2023_12_questions.txt
│   │   │   ├── aoc_2023_13.adb
│   │   │   ├── aoc_2023_13.txt
│   │   │   ├── aoc_2023_13_questions.txt
│   │   │   ├── aoc_2023_14.adb
│   │   │   ├── aoc_2023_14.txt
│   │   │   ├── aoc_2023_14_questions.txt
│   │   │   ├── aoc_2023_15.adb
│   │   │   ├── aoc_2023_15.txt
│   │   │   ├── aoc_2023_15_questions.txt
│   │   │   ├── aoc_2023_16.adb
│   │   │   ├── aoc_2023_16.txt
│   │   │   ├── aoc_2023_16_questions.txt
│   │   │   ├── aoc_2023_17.adb
│   │   │   ├── aoc_2023_17.txt
│   │   │   ├── aoc_2023_17_questions.txt
│   │   │   ├── aoc_2023_18.adb
│   │   │   ├── aoc_2023_18.txt
│   │   │   ├── aoc_2023_18_questions.txt
│   │   │   ├── aoc_2023_19.adb
│   │   │   ├── aoc_2023_19.txt
│   │   │   ├── aoc_2023_19_questions.txt
│   │   │   ├── aoc_2023_20.adb
│   │   │   ├── aoc_2023_20.txt
│   │   │   ├── aoc_2023_20_questions.txt
│   │   │   ├── aoc_2023_21.adb
│   │   │   ├── aoc_2023_21.txt
│   │   │   ├── aoc_2023_21_questions.txt
│   │   │   ├── aoc_2023_22.adb
│   │   │   ├── aoc_2023_22.txt
│   │   │   ├── aoc_2023_22_questions.txt
│   │   │   ├── aoc_2023_23.adb
│   │   │   ├── aoc_2023_23.txt
│   │   │   ├── aoc_2023_23_questions.txt
│   │   │   ├── aoc_2023_24.adb
│   │   │   ├── aoc_2023_24.txt
│   │   │   ├── aoc_2023_24_questions.txt
│   │   │   ├── aoc_2023_25.adb
│   │   │   ├── aoc_2023_25.txt
│   │   │   └── aoc_2023_25_questions.txt
│   │   ├── 2024/
│   │   │   ├── aoc_2024.gpr
│   │   │   ├── aoc_2024_01.adb
│   │   │   ├── aoc_2024_01.txt
│   │   │   ├── aoc_2024_01_questions.txt
│   │   │   ├── aoc_2024_02.adb
│   │   │   ├── aoc_2024_02.txt
│   │   │   ├── aoc_2024_02_questions.txt
│   │   │   ├── aoc_2024_03.adb
│   │   │   ├── aoc_2024_03.txt
│   │   │   ├── aoc_2024_03_questions.txt
│   │   │   ├── aoc_2024_04.adb
│   │   │   ├── aoc_2024_04.txt
│   │   │   ├── aoc_2024_04_questions.txt
│   │   │   ├── aoc_2024_05.adb
│   │   │   ├── aoc_2024_05.txt
│   │   │   ├── aoc_2024_05_questions.txt
│   │   │   ├── aoc_2024_06.adb
│   │   │   ├── aoc_2024_06.txt
│   │   │   ├── aoc_2024_06_questions.txt
│   │   │   ├── aoc_2024_07.adb
│   │   │   ├── aoc_2024_07.txt
│   │   │   ├── aoc_2024_07_questions.txt
│   │   │   ├── aoc_2024_08.adb
│   │   │   ├── aoc_2024_08.txt
│   │   │   ├── aoc_2024_08_questions.txt
│   │   │   ├── aoc_2024_09.adb
│   │   │   ├── aoc_2024_09.txt
│   │   │   ├── aoc_2024_09_questions.txt
│   │   │   ├── aoc_2024_10.adb
│   │   │   ├── aoc_2024_10.txt
│   │   │   ├── aoc_2024_10_questions.txt
│   │   │   ├── aoc_2024_11.adb
│   │   │   ├── aoc_2024_11_questions.txt
│   │   │   ├── aoc_2024_12.adb
│   │   │   ├── aoc_2024_12.txt
│   │   │   ├── aoc_2024_12_questions.txt
│   │   │   ├── aoc_2024_13.adb
│   │   │   ├── aoc_2024_13.txt
│   │   │   ├── aoc_2024_13_questions.txt
│   │   │   ├── aoc_2024_14.adb
│   │   │   ├── aoc_2024_14.txt
│   │   │   ├── aoc_2024_14_questions.txt
│   │   │   ├── aoc_2024_15.adb
│   │   │   ├── aoc_2024_15.txt
│   │   │   ├── aoc_2024_15_questions.txt
│   │   │   ├── aoc_2024_16.adb
│   │   │   ├── aoc_2024_16.txt
│   │   │   ├── aoc_2024_16_questions.txt
│   │   │   ├── aoc_2024_17.adb
│   │   │   ├── aoc_2024_17_questions.txt
│   │   │   ├── aoc_2024_18.adb
│   │   │   ├── aoc_2024_18.txt
│   │   │   ├── aoc_2024_18_questions.txt
│   │   │   ├── aoc_2024_19.adb
│   │   │   ├── aoc_2024_19.txt
│   │   │   ├── aoc_2024_19_questions.txt
│   │   │   ├── aoc_2024_20.adb
│   │   │   ├── aoc_2024_20.txt
│   │   │   ├── aoc_2024_20_mini.txt
│   │   │   ├── aoc_2024_20_questions.txt
│   │   │   ├── aoc_2024_21.adb
│   │   │   ├── aoc_2024_21_questions.txt
│   │   │   ├── aoc_2024_22.adb
│   │   │   ├── aoc_2024_22.txt
│   │   │   ├── aoc_2024_22_full_ada.adb
│   │   │   ├── aoc_2024_22_mini.txt
│   │   │   ├── aoc_2024_22_questions.txt
│   │   │   ├── aoc_2024_23.adb
│   │   │   ├── aoc_2024_23.txt
│   │   │   ├── aoc_2024_23_questions.txt
│   │   │   ├── aoc_2024_24.adb
│   │   │   ├── aoc_2024_24_questions.txt
│   │   │   ├── aoc_2024_25.adb
│   │   │   ├── aoc_2024_25.txt
│   │   │   └── aoc_2024_25_questions.txt
│   │   ├── 2025/
│   │   │   ├── aoc_2025.gpr
│   │   │   ├── aoc_2025_01.adb
│   │   │   ├── aoc_2025_01.txt
│   │   │   ├── aoc_2025_01_questions.txt
│   │   │   ├── aoc_2025_02.adb
│   │   │   ├── aoc_2025_02.txt
│   │   │   ├── aoc_2025_02_mini.txt
│   │   │   ├── aoc_2025_02_questions.txt
│   │   │   ├── aoc_2025_03.adb
│   │   │   ├── aoc_2025_03.txt
│   │   │   ├── aoc_2025_03_questions.txt
│   │   │   ├── aoc_2025_04.adb
│   │   │   ├── aoc_2025_04.txt
│   │   │   ├── aoc_2025_04_questions.txt
│   │   │   ├── aoc_2025_05.adb
│   │   │   ├── aoc_2025_05.txt
│   │   │   ├── aoc_2025_05_questions.txt
│   │   │   ├── aoc_2025_06.adb
│   │   │   ├── aoc_2025_06.txt
│   │   │   ├── aoc_2025_06_questions.txt
│   │   │   ├── aoc_2025_07.adb
│   │   │   ├── aoc_2025_07.txt
│   │   │   ├── aoc_2025_07_questions.txt
│   │   │   ├── aoc_2025_08.adb
│   │   │   ├── aoc_2025_08.txt
│   │   │   ├── aoc_2025_08_mini.txt
│   │   │   ├── aoc_2025_08_questions.txt
│   │   │   ├── aoc_2025_09.adb
│   │   │   ├── aoc_2025_09.m
│   │   │   ├── aoc_2025_09.txt
│   │   │   ├── aoc_2025_09_questions.txt
│   │   │   ├── aoc_2025_10.adb
│   │   │   ├── aoc_2025_10.txt
│   │   │   ├── aoc_2025_10_mini.txt
│   │   │   ├── aoc_2025_10_questions.txt
│   │   │   ├── aoc_2025_11.adb
│   │   │   ├── aoc_2025_11.txt
│   │   │   └── aoc_2025_11_questions.txt
│   │   ├── aoc_check_list.txt
│   │   ├── aoc_toolbox.adb
│   │   └── aoc_toolbox.ads
│   ├── arguments.adb
│   ├── attributes.adb
│   ├── auto_complete.adb
│   ├── barnes.adb
│   ├── binomials.adb
│   ├── bwt.adb
│   ├── ce_b_2.adb
│   ├── ce_b_4.adb
│   ├── ce_c_2.adb
│   ├── ce_c_4.adb
│   ├── ce_e_1.adb
│   ├── ce_e_2.adb
│   ├── ce_e_4.adb
│   ├── ce_i_1.adb
│   ├── ce_i_2.adb
│   ├── ce_i_3.adb
│   ├── ce_i_4.adb
│   ├── console_io.adb
│   ├── covid_19_s.adb
│   ├── cross_a.adb
│   ├── cross_a.ads
│   ├── cross_b.adb
│   ├── cross_b.ads
│   ├── days_1901.adb
│   ├── directories.adb
│   ├── doors.adb
│   ├── draw_sphere.adb
│   ├── e.cmd
│   ├── echo.adb
│   ├── einmaleins.adb
│   ├── embed_text.adb
│   ├── env.adb
│   ├── existence.adb
│   ├── file_append.adb
│   ├── file_copy.adb
│   ├── file_read.adb
│   ├── fill_drive.adb
│   ├── gallery.adb
│   ├── hac_exm.gpr
│   ├── hac_exm.prj
│   ├── hello.adb
│   ├── hello_big.adb
│   ├── hofstadter.adb
│   ├── mandelbrot.adb
│   ├── mathe_kal/
│   │   └── 2022/
│   │       ├── mathe_plus_2022_02.adb
│   │       ├── mathe_plus_2022_04.adb
│   │       ├── mathe_plus_2022_09.adb
│   │       └── mkp_2022.gpr
│   ├── maze_gen.adb
│   ├── md2html.adb
│   ├── merge_sort.adb
│   ├── names_in_boxes.adb
│   ├── native.adb
│   ├── not_working/
│   │   ├── din_sm.adb
│   │   ├── din_ws.adb
│   │   ├── dinersmo.adb
│   │   ├── newrace.adb
│   │   ├── overloading.adb
│   │   ├── pgm0.adb
│   │   ├── pgm1.adb
│   │   ├── pgm2.adb
│   │   ├── race.adb
│   │   ├── racedead.adb
│   │   └── roland_01.adb
│   ├── pack_list.adb
│   ├── pdf/
│   │   ├── hac_pdf_out.adb
│   │   ├── hac_pdf_out.ads
│   │   ├── hilbert_curve.adb
│   │   ├── koch_curve.adb
│   │   ├── pdf_hello.adb
│   │   └── peano_curve.adb
│   ├── permutations.adb
│   ├── pkg_1.adb
│   ├── pkg_1.ads
│   ├── pkg_2.ads
│   ├── pkg_demo.adb
│   ├── pkg_demo_gen.adb
│   ├── prc.adb
│   ├── random.adb
│   ├── record_code_gen.adb
│   ├── remarks.adb
│   ├── series.adb
│   ├── shell.adb
│   ├── shell_sort.adb
│   ├── strings_demo.adb
│   ├── sudoku_sample.adb
│   ├── sudokus.adb
│   ├── sudokus.ads
│   ├── tasking/
│   │   ├── tasks_01.adb
│   │   └── tasks_02.adb
│   ├── three_lakes_s.adb
│   ├── timing.adb
│   ├── triangles_overlap.adb
│   ├── unit_a.adb
│   ├── unit_b.adb
│   ├── unit_b.ads
│   ├── unit_c.adb
│   ├── unit_e.adb
│   ├── unit_f.adb
│   ├── unit_f.ads
│   ├── unit_g.adb
│   └── unit_g.ads
├── fast.cmd
├── hac.gpr
├── hac_objectada.prj
├── profiling.cmd
├── readme.md
├── save.hac
├── save_modif.hac
├── save_modif_and_untracked.hac
├── small.cmd
├── src/
│   ├── apps/
│   │   ├── hac.adb
│   │   ├── hac_mini.adb
│   │   ├── hac_multi.adb
│   │   ├── hac_pkg.adb
│   │   ├── hac_pkg.ads
│   │   └── show_mit_license.adb
│   ├── compile/
│   │   ├── emit/
│   │   │   ├── hac_sys-targets-amd64_windows_console_fasm.adb
│   │   │   ├── hac_sys-targets-amd64_windows_console_fasm.ads
│   │   │   ├── hac_sys-targets-hac_virtual_machine.adb
│   │   │   ├── hac_sys-targets-hac_virtual_machine.ads
│   │   │   ├── hac_sys-targets-semantics.adb
│   │   │   ├── hac_sys-targets-semantics.ads
│   │   │   └── hac_sys-targets.ads
│   │   ├── hac_sys-builder.adb
│   │   ├── hac_sys-builder.ads
│   │   ├── hac_sys-co_defs.adb
│   │   ├── hac_sys-co_defs.ads
│   │   ├── hac_sys-compiler-pcode_emit.adb
│   │   ├── hac_sys-compiler-pcode_emit.ads
│   │   ├── hac_sys-compiler.adb
│   │   ├── hac_sys-compiler.ads
│   │   ├── hac_sys-defs.adb
│   │   ├── hac_sys-defs.ads
│   │   ├── hac_sys-errors.adb
│   │   ├── hac_sys-errors.ads
│   │   ├── hac_sys-multi_precision_integers.adb
│   │   ├── hac_sys-multi_precision_integers.ads
│   │   ├── hac_sys-parser-attributes.adb
│   │   ├── hac_sys-parser-attributes.ads
│   │   ├── hac_sys-parser-calls.adb
│   │   ├── hac_sys-parser-calls.ads
│   │   ├── hac_sys-parser-const_var.adb
│   │   ├── hac_sys-parser-const_var.ads
│   │   ├── hac_sys-parser-enter_def.adb
│   │   ├── hac_sys-parser-enter_def.ads
│   │   ├── hac_sys-parser-expressions.adb
│   │   ├── hac_sys-parser-expressions.ads
│   │   ├── hac_sys-parser-helpers.adb
│   │   ├── hac_sys-parser-helpers.ads
│   │   ├── hac_sys-parser-modularity.adb
│   │   ├── hac_sys-parser-modularity.ads
│   │   ├── hac_sys-parser-packages.adb
│   │   ├── hac_sys-parser-packages.ads
│   │   ├── hac_sys-parser-ranges.adb
│   │   ├── hac_sys-parser-ranges.ads
│   │   ├── hac_sys-parser-standard_functions.adb
│   │   ├── hac_sys-parser-standard_functions.ads
│   │   ├── hac_sys-parser-standard_procedures.adb
│   │   ├── hac_sys-parser-standard_procedures.ads
│   │   ├── hac_sys-parser-statements-case_statement.adb
│   │   ├── hac_sys-parser-statements.adb
│   │   ├── hac_sys-parser-statements.ads
│   │   ├── hac_sys-parser-tasking.adb
│   │   ├── hac_sys-parser-tasking.ads
│   │   ├── hac_sys-parser-type_conversion.adb
│   │   ├── hac_sys-parser-type_conversion.ads
│   │   ├── hac_sys-parser-type_def.adb
│   │   ├── hac_sys-parser-type_def.ads
│   │   ├── hac_sys-parser.adb
│   │   ├── hac_sys-parser.ads
│   │   ├── hac_sys-scanner.adb
│   │   └── hac_sys-scanner.ads
│   ├── execute/
│   │   ├── hac_sys-interfacing.adb
│   │   ├── hac_sys-pcode-interpreter-calls.adb
│   │   ├── hac_sys-pcode-interpreter-calls.ads
│   │   ├── hac_sys-pcode-interpreter-composite_data.adb
│   │   ├── hac_sys-pcode-interpreter-composite_data.ads
│   │   ├── hac_sys-pcode-interpreter-exceptions.adb
│   │   ├── hac_sys-pcode-interpreter-exceptions.ads
│   │   ├── hac_sys-pcode-interpreter-in_defs.adb
│   │   ├── hac_sys-pcode-interpreter-in_defs.ads
│   │   ├── hac_sys-pcode-interpreter-multi_statement.adb
│   │   ├── hac_sys-pcode-interpreter-multi_statement.ads
│   │   ├── hac_sys-pcode-interpreter-operators.adb
│   │   ├── hac_sys-pcode-interpreter-operators.ads
│   │   ├── hac_sys-pcode-interpreter-tasking-scheduler.adb
│   │   ├── hac_sys-pcode-interpreter-tasking.adb
│   │   ├── hac_sys-pcode-interpreter-tasking.ads
│   │   ├── hac_sys-pcode-interpreter.adb
│   │   ├── hac_sys-pcode-interpreter.ads
│   │   ├── hac_sys-pcode.adb
│   │   └── hac_sys-pcode.ads
│   ├── hac_sys-interfacing.ads
│   ├── hac_sys.ads
│   ├── hat-non_standard.adb
│   ├── hat-non_standard_oawin64.adb
│   ├── hat.adb
│   ├── hat.ads
│   └── manage/
│       ├── hac_sys-files-default.adb
│       ├── hac_sys-files-default.ads
│       ├── hac_sys-files.ads
│       ├── hac_sys-librarian-built_in_packages.adb
│       ├── hac_sys-librarian-built_in_packages.ads
│       ├── hac_sys-librarian.adb
│       └── hac_sys-librarian.ads
└── test/
    ├── all_noisy_tests.adb
    ├── all_silent_tests.adb
    ├── attributes_test.adb
    ├── case_statement.adb
    ├── constants.adb
    ├── declarations.adb
    ├── digitz.adb
    ├── enumerations.adb
    ├── exception_01.adb
    ├── exception_02.adb
    ├── exception_03.adb
    ├── exception_04.adb
    ├── floats.adb
    ├── forward.adb
    ├── future/
    │   └── block_statements.adb
    ├── hac_test.gpr
    ├── hac_test.prj
    ├── if_then_elsif_else.adb
    ├── integers.adb
    ├── loops.adb
    ├── object_init.adb
    ├── open_files.adb
    ├── optim.adb
    ├── recursion.adb
    ├── remarks_check.adb
    ├── remarks_k_ok.txt
    ├── remarks_r_ok.txt
    ├── remarks_u_ok.txt
    ├── remarks_v_ok.txt
    ├── shell_test.adb
    ├── silent_tests_single_build.adb
    ├── sorting_tests.adb
    ├── strings.adb
    ├── t.cmd
    ├── test.adb
    ├── test1.adb
    ├── test_tail_after_match.adb
    ├── testing_utilities.adb
    ├── testing_utilities.ads
    ├── tf.cmd
    ├── toa.cmd
    ├── ts.cmd
    ├── type_conversion.adb
    └── verif_hac.aru

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://www.paypal.com/donate/?item_name=Donation+to+the+author+of+HAC&cmd=_donations&business=esgm%40bluewin.ch


================================================
FILE: .gitignore
================================================
/obj/
/bin/
/hac
/hac_mini
/hac_multi

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2013 .. 2025 Gautier de Montmollin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: build.cmd
================================================
@echo off

gprbuild %1 -P hac           -XHAC_OS=Win64
gprbuild %1 -P demo/hac_demo -XHAC_OS=Win64

if %errorlevel% == 9009 goto error

echo Press Return
pause
goto :eof

:error

echo.
echo The GNAT Ada compiler was not found in the PATH!
echo.
echo Check https://www.adacore.com/download for GNAT
echo or https://alire.ada.dev/ for ALIRE.
echo The HAC project is available as an ALIRE crate.
echo.
echo Press Return
pause


================================================
FILE: debug.pra
================================================
pragma Initialize_Scalars;
-- pragma Normalize_Scalars; -- For all units!



================================================
FILE: demo/data_exchange/exchange_common.ads
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------
--  Package used by both HAC and         --
--  Native sides                         --
-------------------------------------------

package Exchange_Common is

  type Animal is (ant, bat, cat, dog);

  subtype Beast is Animal;
  subtype Insect is Animal range ant .. ant;
  subtype Mammal is Animal range bat .. dog;

end Exchange_Common;


================================================
FILE: demo/data_exchange/exchange_hac_side.adb
================================================
-----------------------------------------
--  HAC <-> Native data exchange demo  --
-----------------------------------------
--  HAC side                           --
-----------------------------------------

--  This file is meant to be compiled by the HAC compiler which is
--  embedded in Exchange_Native_Side (exchange_native_side.adb).

with HAT;

with Exchange_Common;

procedure Exchange_HAC_Side is

  use HAT;

  procedure Demo_Parameterless is
    procedure Parameterless_Callback with Import => True;
  begin
    Put_Line ("   HAC: I call a parameterless callback.");
    Parameterless_Callback;
    Put_Line ("   HAC: done calling.");
    New_Line;
  end Demo_Parameterless;

  procedure Demo_Data_to_Native is
    procedure Hello_Callback (message : in VString) with Import => True;
    procedure Ints_Callback (i, j, k : in Integer) with Import => True;
    procedure Floats_Callback (f, g, h : in Real) with Import => True;
  begin
    Put_Line ("   HAC: I send some stuff through callbacks.");
    Hello_Callback (+"I'm HAC and I say hello!");
    Ints_Callback (123, 456, 789);
    Floats_Callback (123.0, 456.0, 789.0);
    New_Line;
  end Demo_Data_to_Native;

  procedure Demo_Data_Bidirectional is
    procedure Hello_Callback_in_out (message : in out VString) with Import => True;
    procedure Ints_Callback_in_out (i : in out Integer) with Import => True;
    procedure Floats_Callback_in_out (f : in out Real) with Import => True;
    m : VString := +"I'm HAC";
    i : Integer := 12;
    f : Real := 11.0;
  begin
    m := +"I'm HAC";
    Put_Line ("   HAC: message before call: [" & m & ']');
    Hello_Callback_in_out (m);
    Put_Line ("   HAC: message after call: [" & m & ']');
    Put_Line (+"   HAC: integer before call: [" & i & ']');
    Ints_Callback_in_out (i);
    Put_Line (+"   HAC: integer after call: [" & i & ']');
    Put_Line (+"   HAC: float before call: [" & f & ']');
    Floats_Callback_in_out (f);
    Put_Line (+"   HAC: float after call: [" & f & ']');
    New_Line;
  end Demo_Data_Bidirectional;

  procedure Demo_Composite is
    type Matrix is array (1 .. 2, 1 .. 2) of HAT.Real;
    type Some_Record is record
      i : Integer;
      v : VString;
      e : Exchange_Common.Animal;
    end record;
    procedure Composite_Callback (a, b : in Matrix; r : in out Some_Record; c : out Matrix)
    with Import => True;
    m, n, o : Matrix;
    s : Some_Record;
  begin
    --  HAC 0.2: no aggregates, we have to write the matrix' contents cell by cell.
    m (1, 1) := 1.1;
    m (1, 2) := 1.2;
    m (2, 1) := 1.3;
    m (2, 2) := 1.4;
    n (1, 1) := -2.1;
    n (1, 2) :=  2.2;
    n (2, 1) := -2.3;
    n (2, 2) :=  2.4;
    s.i := 13;
    s.v := +"I'm a HAC record field";
    s.e := Exchange_Common.bat;
    Put_Line (+"   HAC: integer before call: [" & s.i & ']');
    Put_Line (+"        message before call: [" & s.v & ']');
    Put_Line (+"           enum before call: [" & s.e'Image & ']');
    Composite_Callback (m, n, s, o);
    Put_Line (+"   HAC: integer after call: [" & s.i & ']');
    Put_Line (+"        message after call: [" & s.v & ']');
    Put_Line (+"           enum after call: [" & s.e'Image & ']');
    Put_Line (+"        matrix product:");
    for i in o'Range (1) loop
      Put ("          ");
      for j in o'Range (2) loop
        Put (o (i, j), 2, 2, 0);
      end loop;
      New_Line;
    end loop;
  end Demo_Composite;
begin
  Put_Line ("   Exchange_HAC_Side is started.");
  New_Line;
  --
  Demo_Parameterless;
  Demo_Data_to_Native;
  Demo_Data_Bidirectional;
  Demo_Composite;
  --
  Set_VM_Variable ("Demo_Variable", Get_VM_Variable ("Demo_Variable") & "HAC... ");
end Exchange_HAC_Side;


================================================
FILE: demo/data_exchange/exchange_native_side.adb
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------
--  Native side                          --
-------------------------------------------

--  Native & master side of the demo.
--  HAC is embedded in this application.
--  Compile this program with a "full Ada" compiler like GNAT.

with Ada.Directories,
     Ada.Text_IO;

with HAC_Sys.Builder,
     HAC_Sys.PCode.Interpreter;

with Exchange_Native_Side_Pkg;

procedure Exchange_Native_Side is
  use Ada.Text_IO;
  use HAC_Sys.PCode.Interpreter;

  BD : HAC_Sys.Builder.Build_Data;

  procedure Build is
    hac_program_name : constant String := "exchange_hac_side.adb";
  begin
    Put_Line ("Native: building a HAC program: " & hac_program_name);
    New_Line;
    BD.Build_Main_from_File (hac_program_name);
  end Build;

  procedure Run is
    post_mortem : Post_Mortem_Data;
  begin
    Interpret_on_Current_IO (BD, 1, "", post_mortem);
    if Is_Exception_Raised (post_mortem.Unhandled) then
      Put_Line (Current_Error, "HAC VM: raised " & Image (post_mortem.Unhandled));
      Put_Line (Current_Error, Message (post_mortem.Unhandled));
    end if;
  end Run;

begin
  Put_Line ("Exchange_Native_Side is started.");
  New_Line;
  Exchange_Native_Side_Pkg.Register_All_Callbacks (BD);
  Exchange_Native_Side_Pkg.Set_Global_VM_Variable (BD);
  Ada.Directories.Set_Directory ("data_exchange");
  Build;
  if BD.Build_Successful then
    for i in 1 .. 2 loop
      Put_Line ("Native: Run #" & Integer'Image (i));
      Run;
      Put_Line
        ("Native: Run #" & Integer'Image (i) &
         ". Global string variable is: " & Exchange_Native_Side_Pkg.Get_Global_VM_Variable (BD));
      New_Line;
    end loop;
  end if;
end Exchange_Native_Side;


================================================
FILE: demo/data_exchange/exchange_native_side_pkg.adb
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------

--  Callbacks on Native side.

with Exchange_Common;

with HAC_Sys.Interfacing;

with Ada.Numerics.Long_Real_Arrays,
     Ada.Text_IO;

package body Exchange_Native_Side_Pkg is
  use Ada.Text_IO;
  use HAC_Sys.Interfacing;

  procedure Parameterless_Callback (Dummy : in out HAC_Element_Array) is
  begin
    Put_Line ("      Native: Parameterless_Callback is speaking!");
  end Parameterless_Callback;

  procedure Hello_Callback (Data : in out HAC_Element_Array) is
  begin
    Put_Line ("      Native: HAC is saying: [" & To_Native (Data (1)) & ']');
  end Hello_Callback;

  procedure Ints_Callback (Data : in out HAC_Element_Array) is
    i, j, k : Integer;
  begin
    i := To_Native (Data (1));
    j := To_Native (Data (2));
    k := To_Native (Data (3));
    Put_Line
      ("      Native: HAC has sent me the numbers:" &
       Integer'Image (i) &
       Integer'Image (j) &
       Integer'Image (k));
  end Ints_Callback;

  procedure Floats_Callback (Data : in out HAC_Element_Array) is
    f, g, h : Long_Float;
  begin
    f := To_Native (Data (1));
    g := To_Native (Data (2));
    h := To_Native (Data (3));
    Put_Line
      ("      Native: HAC has sent me the numbers:" &
       Long_Float'Image (f) &
       Long_Float'Image (g) &
       Long_Float'Image (h));
  end Floats_Callback;

  procedure Hello_Callback_in_out (Data : in out HAC_Element_Array) is
  begin
    Put_Line ("      Native: HAC is saying: [" & To_Native (Data (1)) & ']');
    Data (1) := To_HAC ("No, I'm Native, you loser!");
  end Hello_Callback_in_out;

  procedure Ints_Callback_in_out (Data : in out HAC_Element_Array) is
    i : Integer;
  begin
    i := To_Native (Data (1));
    Put_Line
      ("      Native: HAC has sent me the number:" &
       Integer'Image (i) & "; I will send it back squared.");
    Data (1) := To_HAC (i ** 2);
  end Ints_Callback_in_out;

  procedure Floats_Callback_in_out (Data : in out HAC_Element_Array) is
    f : Long_Float;
  begin
    f := To_Native (Data (1));
    Put_Line
      ("      Native: HAC has sent me the number:" &
       Long_Float'Image (f) & "; I will send it back squared.");
    Data (1) := To_HAC (f ** 2);
  end Floats_Callback_in_out;

  procedure Composite_Callback (Data : in out HAC_Element_Array) is
    m_pos : constant :=  1;  --  Index for matrix 1
    n_pos : constant :=  5;  --  Index for matrix 2
    r_pos : constant :=  9;  --  Index for record 1
    o_pos : constant := 12;  --  Index for matrix 3
    use Ada.Numerics.Long_Real_Arrays;
    package LFIO is new Ada.Text_IO.Float_IO (Long_Float); use LFIO;
    procedure Show (m : Real_Matrix) is
    begin
      for i in m'Range (1) loop
        Put ("          ");
        for j in m'Range (2) loop
          Put (m (i, j), 2, 2, 0);
        end loop;
        New_Line;
      end loop;
    end Show;
    --
    m, n, o : Real_Matrix (1 .. 2, 1 .. 2);
    e : Exchange_Common.Animal;
    --
    function To_HAC is new To_HAC_Any_Enum (Exchange_Common.Animal);
    function To_Native is new To_Native_Any_Enum (Exchange_Common.Animal);
  begin
    e := To_Native (Data (r_pos + 2));
    Put_Line ("      Native: Enum = " & Exchange_Common.Animal'Image (e));
    m := ((To_Native (Data (m_pos)),     To_Native (Data (m_pos + 1))),
          (To_Native (Data (m_pos + 2)), To_Native (Data (m_pos + 3))));
    Put_Line ("      Native: Matrix m:");
    Show (m);
    n := ((To_Native (Data (n_pos)),     To_Native (Data (n_pos + 1))),
          (To_Native (Data (n_pos + 2)), To_Native (Data (n_pos + 3))));
    Put_Line ("      Native: Matrix n:");
    Show (n);

    o := m * n;
    Put_Line ("      Native: Matrix o = m * n:");
    Show (o);

    Data (o_pos .. o_pos + 3) :=
      (To_HAC (o (1, 1)), To_HAC (o (1, 2)),
       To_HAC (o (2, 1)), To_HAC (o (2, 2)));

    Data (r_pos)     := To_HAC (Integer'(To_Native (Data (r_pos))) ** 2);
    Data (r_pos + 1) := To_HAC ("I'm a Native message now (niarg niarg niarg)!");
    e := Exchange_Common.cat;
    Data (r_pos + 2) := To_HAC (e);
    Put_Line ("      Native: Enum = " & Exchange_Common.Animal'Image (e));
  end Composite_Callback;

  procedure Register_All_Callbacks (BD : HAC_Sys.Builder.Build_Data) is
  begin
    Register (BD, Parameterless_Callback'Access, "Parameterless_Callback");
    Register (BD, Hello_Callback'Access,         "Hello_Callback");
    Register (BD, Ints_Callback'Access,          "Ints_Callback");
    Register (BD, Floats_Callback'Access,        "Floats_Callback");
    Register (BD, Hello_Callback_in_out'Access,  "Hello_Callback_in_out");
    Register (BD, Ints_Callback_in_out'Access,   "Ints_Callback_in_out");
    Register (BD, Floats_Callback_in_out'Access, "Floats_Callback_in_out");
    Register (BD, Composite_Callback'Access,     "Composite_Callback");
  end Register_All_Callbacks;

  procedure Set_Global_VM_Variable (BD : in out HAC_Sys.Builder.Build_Data) is
  begin
    Set_VM_Variable (BD, "Demo_Variable", "Native... ");
  end Set_Global_VM_Variable;

  function Get_Global_VM_Variable (BD : HAC_Sys.Builder.Build_Data) return String is
  begin
    return Get_VM_Variable (BD, "Demo_Variable");
  end Get_Global_VM_Variable;

end Exchange_Native_Side_Pkg;


================================================
FILE: demo/data_exchange/exchange_native_side_pkg.ads
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------

--  Registration of callbacks on Native side.

with HAC_Sys.Builder;

package Exchange_Native_Side_Pkg is

  procedure Register_All_Callbacks (BD : HAC_Sys.Builder.Build_Data);

  procedure Set_Global_VM_Variable (BD : in out HAC_Sys.Builder.Build_Data);

  function Get_Global_VM_Variable (BD : HAC_Sys.Builder.Build_Data) return String;

end Exchange_Native_Side_Pkg;


================================================
FILE: demo/data_exchange_simple/exchange_hac_side_simple.adb
================================================
-----------------------------------------
--  HAC <-> Native data exchange demo  --
-----------------------------------------
--  HAC side (simple version)          --
-----------------------------------------

--  This file is meant to be compiled by the HAC compiler which is
--  embedded in Exchange_Native_Side_Simple (exchange_native_side_simple.adb).

with HAT;

procedure Exchange_HAC_Side_Simple is

  use HAT;

  procedure In_Out_Callback (i : in out Integer) with Import => True;

  x : Integer := 1234;

begin

  HAT.Put_Line ("   [HAC]: before callback, variable x has value:" & x'Image);

  In_Out_Callback (x);

  HAT.Put_Line ("   [HAC]: after callback, variable x has value:" & x'Image);

end Exchange_HAC_Side_Simple;


================================================
FILE: demo/data_exchange_simple/exchange_native_side_pkg_simple.adb
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------

--  Callbacks on Native side.

with HAC_Sys.Interfacing;

with Ada.Text_IO;

package body Exchange_Native_Side_Pkg_Simple is
  use HAC_Sys.Interfacing;

  procedure In_Out_Callback (Data : in out HAC_Element_Array) is
    my_val : constant := 9876;
  begin

    Ada.Text_IO.Put_Line
      ("      [Native] (callback): HAC has given the following value:" &
       Integer'Image (To_Native (Data (1))));

    Data (1) := To_HAC (my_val);

    Ada.Text_IO.Put_Line
      ("      [Native] (callback): I just changed the value to..." & my_val'Image);

  end In_Out_Callback;

  procedure Register_All_Callbacks (BD : HAC_Sys.Builder.Build_Data) is
  begin
    Register (BD, In_Out_Callback'Access, "In_Out_Callback");
  end Register_All_Callbacks;

end Exchange_Native_Side_Pkg_Simple;


================================================
FILE: demo/data_exchange_simple/exchange_native_side_pkg_simple.ads
================================================
------------------------------------------------------------
--  HAC  <->  Native data exchange demo (simple version)  --
------------------------------------------------------------

--  Registration of callbacks on Native side.

with HAC_Sys.Builder;

package Exchange_Native_Side_Pkg_Simple is

  procedure Register_All_Callbacks (BD : HAC_Sys.Builder.Build_Data);

end Exchange_Native_Side_Pkg_Simple;


================================================
FILE: demo/data_exchange_simple/exchange_native_side_simple.adb
================================================
-------------------------------------------
--  HAC  <->  Native data exchange demo  --
-------------------------------------------
--  Native side                          --
-------------------------------------------

--  Native & master side of the demo.
--  HAC is embedded in this application.
--  Compile this program with a "full Ada" compiler like GNAT.

with Ada.Directories,
     Ada.Text_IO;

with HAC_Sys.Builder,
     HAC_Sys.PCode.Interpreter;

with Exchange_Native_Side_Pkg_Simple;

procedure Exchange_Native_Side_Simple is
  use Ada.Text_IO;
  use HAC_Sys.PCode.Interpreter;
  use Exchange_Native_Side_Pkg_Simple;

  BD : HAC_Sys.Builder.Build_Data;

  procedure Run_with_HAC is
    post_mortem : Post_Mortem_Data;
  begin

    Interpret_on_Current_IO (BD, 1, "", post_mortem);

    if Is_Exception_Raised (post_mortem.Unhandled) then
      Put_Line (Current_Error, "HAC VM: raised " & Image (post_mortem.Unhandled));
      Put_Line (Current_Error, Message (post_mortem.Unhandled));
    end if;

  end Run_with_HAC;

begin

  Register_All_Callbacks (BD);
  Ada.Directories.Set_Directory ("data_exchange_simple");

  for i in Positive loop
    New_Line (3);
    Put_Line
      ("[Native]: Run #" & i'Image &
       "   --------------------------------------------------------");

    BD.Build_Main_from_File ("exchange_hac_side_simple.adb");

    if BD.Build_Successful then
      Run_with_HAC;
    end if;

    Put_Line ("[Native]: Delay");
    delay 3.0;

  end loop;

end Exchange_Native_Side_Simple;


================================================
FILE: demo/hac_demo.gpr
================================================
--  This is a GNAT, GCC or GNAT Studio project file
--  for the demos of the HAC project ( https://sf.net/projects/hacadacompiler/ ).
--
--  Build me with "gprbuild -P hac_demo", or open me with GNAT Studio.
--  

project HAC_Demo is

   type HAC_Build_Mode_Type is ("Debug", "Fast", "Small");

   HAC_Build_Mode : HAC_Build_Mode_Type := external ("HAC_Build_Mode", "Debug");

   for Main use 
     ("exchange_native_side_simple.adb",  --  Data exchange demo between HAC and "full Ada" - "full Ada" (native) side, simple version
      "exchange_native_side.adb");        --  Data exchange demo between HAC and "full Ada" - "full Ada" (native) side
      
   case HAC_Build_Mode is
      when "Debug" => for Object_Dir use "../obj/debug";
      when "Fast"  => for Object_Dir use "../obj/fast";
      when "Small" => for Object_Dir use "../obj/small";
   end case;

   for Source_Dirs use
     ("../src", "../src/compile", "../src/compile/emit", "../src/execute", "../src/manage",
      ".", "./data_exchange", "./data_exchange_simple");
   for Exec_Dir use ".";
   for Create_Missing_Dirs use "True";  --  Flips by default the "-p" switch

   package Pretty_Printer is
      for Default_Switches ("ada") use ("-i2");
   end Pretty_Printer;

   Common_Compiler_Options := (
     "-gnatwa",                        --  Warnings switches (a:turn on all info/warnings marked with +)
     "-gnatwcijkmopruvz.c.p.t.w.x",    --  Warnings switches (run "gnatmake" for full list)
     "-gnatwCKMUV",                    --  Warnings switches (turn off some irrelevant for the tests)
     "-gnatwh",                        --  Warnings switches (h:turn on warnings for hiding declarations)
     "-gnatf",  --  Full errors. Verbose details, all undefined references
     "-gnatq",  --  Don't quit, try semantics, even if parse errors
     "-gnatQ",  --  Don't quit, write ali/tree file even if compile errors
     --
     "-gnatyaknpr",   --  Style: check all casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references
     "-gnatybfhiu",   --  Style: check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines
     "-gnatyx",       --  Style: check x:no extra parens
     --  "-gnatye",       --  Style: check e:end/exit labels present
     "-gnatytc"       --  Style: check t:token separation rules, c:comment format (two spaces)
   );

   Debug_Options := (
     "-gnata",         --  Assertions enabled
     "-gnato",         --  Enable overflow checking in STRICT mode
     "-gnatVa",        --  Enable all validity checking options
     "-fstack-check",
     "-fno-inline",
     --
     "-g"              --  Generate debugging information
   );

   Fast_Options :=
     ("-O2",
      "-gnatn", 
      "-fipa-cp-clone",
      "-fgcse-after-reload", 
      "-funroll-loops",
      "-fpeel-loops", 
      "-funswitch-loops", 
      "-ftracer", "-fweb",
      "-ftree-vectorize",
      "-frename-registers",
      "-ffunction-sections",
      "-g");
   
   package Compiler is
      case HAC_Build_Mode is
         when "Debug" =>
           for Default_Switches ("ada") use Common_Compiler_Options & Debug_Options;
           for Local_Configuration_Pragmas use project'Project_Dir & "../debug.pra";
         when "Fast"  => for Default_Switches ("ada") use Common_Compiler_Options & Fast_Options;
         when "Small" => for Default_Switches ("ada") use Common_Compiler_Options & "-Os";
      end case;
   end Compiler;

   Common_Binder_Options := ();

   package Binder is
      case HAC_Build_Mode is
         when "Small" => for Default_Switches ("ada") use Common_Binder_Options;
         --  -Es: Store tracebacks in exception occurrences, and enable symbolic tracebacks
         when others  => for Default_Switches ("ada") use Common_Binder_Options & ("-Es");
      end case;
   end Binder;

   Common_Linker_Options := ();

   package Linker is
      case HAC_Build_Mode is
         when "Debug" => for Default_Switches ("ada") use Common_Linker_Options & ("-g");
         when "Fast"  => for Default_Switches ("ada") use Common_Linker_Options & ("-g", "-Wl,--gc-sections");
         when "Small" => for Default_Switches ("ada") use Common_Linker_Options & (      "-Wl,--gc-sections");
      end case;
   end Linker;

   package Builder is
      --   "If -j0 is used, then the maximum number of simultaneous compilation
      --    jobs is the number of core processors on the platform."
      for Default_Switches ("ada") use ("-g", "-j0");
   end Builder;

end HAC_Demo;


================================================
FILE: doc/archeology/smallada_doc.txt
================================================
S M A L L A d a   1 9 9 1
IBM PC-family version

Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052 USA

This is a compiler/interpreter for a part of the Ada language, namely
the "Pascal subset" plus the Ada tasking support. It is not intended
ever to be a full Ada compiler, rather a vehicle for teaching, learning,
and experimenting with concurrent programming. The compiler is quite
fast, producing P-code which is then interpreted by the interpreter.

The system will run on an IBM PC (or compatible) with the following
minimum configuration: 640K of memory; one disk drive. A hard disk will
greatly improve the speed. The entire system runs in RAM with no disk
accesses, so expect capacity to be limited. 250 statements or so can
be safely accommodated.

SmallAda executables and demo programs are distributed as a self-
extracting archive created by LHA. To install SmallAda, just create a 
directory on your hard disk called, say, smallada, move to that
directory, and execute the self-extracting archive sm-archv directly
from your diskette. If your diskette is in drive A:, just type
A:\SM-ARCHV.

The current version is not particularly robust, rather it is a preliminary
step toward effective window-oriented monitoring of task execution.

This package may be copied and used for educational purposes but not for
profit; please let us know by e-mail or regular mail how you like the idea 
of this package and what you are doing with it. The more users we know
we have, the better our case for getting funding to continue the work.

project supervised by
Prof. Michael B. Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
202-994-5253 (voice)
202-994-5294 (fax)
mfeldman@seas.gwu.edu

authors:
1986 Charles Schoening             DOS version of CoPascal
1987 Frederick C. Hathorn          conversion of CoPascal to Ada
1988 Stuart Cramer and Jay Kurtz   refinement of tasking model
1989 Arthur V. Lopes               window-oriented monitoring for IBM-PC
1990 Manuel A. Perez               Macintosh version
1990 Arthur V. Lopes               integrated environment for IBM-PC
1991 Amr El-Kadi                   user-selectable task scheduling

HOW TO RUN THE PC PROGRAM
=========================

To run SMALLAda PC you will need the following files:

SMALLADA.EXE    -- Small Ada integrated environment
SMADA-IN.AVL    -- Small Ada interpreter pseudo code; it can be tunned
                -- to suit any level of interpreter monitoring

Type SMALLADA RACE <enter>. You will be placed in the editor mode. To compile
and run the race program follow these steps: press F10. A menu will appear
on the top of your screen. Press C, for compiler. Then a sub menu will be
displayed. Press E (or <enter>. This will start the compilation process.
If the program is correctly compiled then it will run thereafter. If an
error is found an error message will be issued and after pressing any key
the editor will be activated. The cursor will be at the line where the
error was found.

The program will run much faster if you disable the window-oriented
execution monitoring by pressing <INS>, which toggles monitoring on and
off. If monitoring is enabled, pressing <DEL> toggles step-by-step
execution on and off. With stepped execution on, pressing the space
bar moves through each source line.

You can create and compile your own Ada programs, but we make no promises
about which parts of the language will be handled correctly. We assure you
that there is no support for packages, generics, exceptions, access types
and dynamic data structures. Some of this may change in future versions,
but we make no commitment to support full Ada. And don't be surprised if
the compiler hangs here and there: error repair is in a rather primitive state.
If the compiler actually finds your errors, it will display the messsages in
a window.


THE SmallAda IBM-PC RUNTIME ENVIRONMENT
=======================================

The runtime monitoring of tasking is really the whole point of this
project.

Each task is given a window. If there are more than five tasks some tasks
will share a physical window.

To obtain help on the runtime environment press F1 while a program is running.
In summary, you can control the overall execution speed of the interpreter
(to "slow down the action"), and exert some influence on the open windows.
There is no magic in all this runtime monitoring: it all takes machine cycles.
If you wish your program to run faster, remove all the monitoring windows
(by pressing INS while they are open). You can also step through execution,
source line by source line, by pressing INS while windows are open. Then
pressing the space bar steps through one source line.


THE SmallAda EDITOR
===================

The editor was adapted from the Turbo Pascal Editor Toobox Version 4.0.
The editor works much like the Wordstar editor. Next some of its basic
options are shown.


Function                        Keystrokes

BASIC MOVEVMENT COMMANDS:

Character left:                 left arrow or ^S (^ ==> Control)
Character right                 right arrow or ^D
Word left                       ^left arrow or ^A
Word right                      ^right arrow or ^F
Line up                         up arrow or ^E
Line down                       down arrow or ^X
Scroll up                       ^W
Scroll down                     ^Z
Page up                         PgUp or ^R
Page down                       PGDn or ^C
Beginning of Line               Home or ^Q S
End of Line                     End or ^Q D
Tab                             Tab or ^I
Backward tab                    Shift tab

BASIC EDITING COMMANDS:

New line                        Enter or ^M
Insert line                     ^N
Delete current character        Del or ^G
Delete character left           Backspace or ^H
Delete word                     ^T
Delete to end of line           ^Q Y
Activate menus                  F10
Abort command                   ^U



THE SmallAda TASKING MODEL
===========================

We have tried to be reasonably faithful to Ada tasking. The scheduler is
designed to show some of the important issues of concurrent programming,
therefore time-slicing is implemented, and the length of the slice is
randomly determined. Also, at each rescheduling point the next task to
be scheduled is selected randomly. This is to give a reasonable model of
nondeterministic (unpredictable) behavior, and serves to highlight the
need for mutual exclusion. The dining philosophers examples on the
disk, taken together, show this point rather well.

Current incompletenesses in the tasking model: only named tasks (i.e. no
task types), no dynamically created tasks. We also don't support nested
task declarations; all tasks must be declared in MAIN's declarative section.

The "select" statement is functional including the "terminate" alternative;
checking for termination is tricky in Ada and you might find that some
select structures with terminate alternatives deadlock or don't work at all.
In general, be gentle with the select statement; try to avoid tricky or
pathological code, which will surely choke the compiler or interpreter!

You will also discover quickly that though the "delay" statement is functional,
the elapsed time to expiration of the delay is considerably more than was
requested in the delay statement. As it happens, this is correct Ada, as the
standard says only that a task will be suspended for _at least_ the amount
of time requested. This is to take account of the likelihood that contention
will make it impossible for a task to take immediate control when it wakes
up from a nap. Indeed, we think that the sometimes too-long delays
may be due to the interference in the interpreter caused by all the references
to the user interface for monitoring purposes. The relationship of the delay to 
reality depends upon your PC's speed as well. We are working on this problem
but do not yet see an obvious solution. So take the time given in a delay
statement with a grain of salt, please.

If you have tasks in finite (counting) loops, if they complete but there are 
other tasks with infinite loops that can never terminate, the system may 
detect no activity and report a deadlock state. 

The current version now supports user-selected task scheduling. Pressing
<alt-F10> during execution opens a window giving scheduler options.


THE SmallAda SUPPORT PACKAGE (SMALL_SP.PKG)
===========================================

A large number of "intrinsic" library subroutines are included in a
pseudo-package called SMALL_SP.PKG. It is not necessary (or proper) to
compile this package; it is included in the environment. It is necessary
to begin each program with a context clause

WITH SMALL_SP; USE SMALL_SP;

to give the effect of writing genuine Ada. A specification for this
package is included in the distribution; it includes I/O routines,
math functions, and the like. This is not really good Ada-like decomposition,
and we will change it in subsequent versions of the system. Meanwhile, use
the package spec as a guide to all the intrinsic routines. Note especially
that the formatting parameters supplied to the I/O procedures are more
Pascal-like than Ada-like. This will change later to look more like
standard TEXT_IO.


THE DEMONSTRATION PROGRAMS
==========================

We have supplied a set of what we hope will be interesting and instructive
programs illustrating both the sequential aspects of the Ada subset and
the tasking model.

TEST1 through TEST6 can be thought of as "validation" programs testing 
specific features of the language; reading them can serve a useful purpose 
in understanding our subset.

ATEST1 through ATEST4 demonstrate the differences in program behavior
under different scheduling policies. Each program contains a block
comment explaining its purpose in this demonstration.

SHELLSORT is what its name implies: a standard implementation of Shell sort
in which the state of the array is displayed on the screen as it is sorted;
RACE is a tasking program which we have used with success in concurrent
programming courses: three sort algorithms are activated as Ada tasks
and run in parallel.

4TASKSEM shows the use of the semaphore primitives "exported" by the SMALL_SP
pseudo-package. A semaphore SCREEN is declared and used to give mutual
exclusion on the terminal screen.
 
Attention: semaphores are NOT Ada primitives! SmallAda was originally 
constructed as a modification to the CoPascal system of Ben-Ari
(as described in "Principles of Concurrent Programming", Prentice Hall 1982),
and the semaphore primitives are still there from the system's last
incarnation. To show how to do it in "real" Ada, we include the program
4TASKMON, in which a screen monitor task is declared.

Finally, there are three versions of Dijkstra's legendary dining philosophers
problem. SmallAda has a capacity limitation of around ten tasks. We are
limited to four instead of the usual five philosophers, because four diners,
four chopsticks, and MAIN add up to 9 tasks. EATCHAOS is very instructive:
it demonstrates why it's nice to have monitors for mutual exclusion: without
a monitor guarding the screen, the display becomes rather chaotic. EAT-SEM
uses the SmallAda semaphore primitives; EAT-MON does the same thing but
with a "genuine" Ada monitor.

FINALLY
=======
 
In case you are curious, the system is coded in Turbo Pascal with the
Turbo Toolbox libraries used for the editor and environment. 

Please let us know about bugs; tell us what you're doing with
the sytem. Good luck; have fun!


Good luck; have fun!









================================================
FILE: doc/hac.txt
================================================
HAC - HAC Ada Compiler
======================

  HAC is perhaps the first open-source (albeit very partial) Ada
  compiler (and virtual machine interpreter) fully programmed in Ada itself.
  Note: HAC was not written from scratch, but is based on a renovation of
  SmallAda, a system developped around 1990 and abandoned since then.

Objectives
==========

    - Fun!
    - Have a simple, quick Ada compiler and execution tool.
    - Be useful for small Ada sandboxed prototypes.
    - Produce the smallest Hello-world executable!
    - Have a tool for script-like jobs (avoid long
        programming-compiling-binding-linking-running cycles).
    - Stay Ada-compatible (HAC programs can be compiled
        and run by other Ada compilers, through
        the compatibility package HAT).

  HAC will most probably never be a complete compiler.

Warning & legal
===============

  There is NO WARRANTY in this software.
  Read copyright notice and license in hac_sys.ads .
  The license is the open-source license MIT.

Getting started
===============

  Assuming you have the GNAT (*) compiler installed, do the
  following from a command line interpreter (please replace
  '\' by '/' on Unix-like platforms):

      gnatmake -P hac
      cd exm
      ..\hac gallery.adb

  If `gnatmake` doesn't work, try `gprbuild`.
  Alternatively, on Windows and with mouse only, you can go
  into the "exm" folder and double-click "e.cmd" .

  The program "gallery.adb" will run a bunch of demos that
  are located in the "exm" directory.
  You can test HAC on any other example of course (the "*.adb"
  files in the "exm" and "test" directories).
  As a bonus, you can build some examples with GNAT to compare the output.
  You can do it easily with the hac_exm.gpr project file.
  Since hac_exm.gpr is a text file, you can see there the progress
  (or the lack thereof) in the pieces of Ada code that are really
  working with HAC. See the "Limitations" section below as well.
  ___
  (*) On Debian-based Linuxes like Ubuntu, GNAT is part of the standard
  packages. For other systems, you can get GNAT from AdaCore's Web site:
  https://www.adacore.com/community or from other sites providing GCC
  (the GNU Compiler Collection) with Ada support.
  Check http://www.getadanow.com/ for instance.

Directories
===========

   src        sources of HAC, plus the compatibility package HAT
   doc        documentation
   exm        examples
   exm/aoc    Advent of Code solutions - also used for regression testing
   exm/pdf    demos of Acrobat (tm) PDF documents produced by HAC
   demo       demos of applications embedding HAC
   test       testing (notably, the all_silent_tests.adb regression test suite)

Key files in the main directory
===============================

   hac.gpr             project file for building HAC with GNAT
   hac_objectada.prj   equivalent project file with ObjectAda64 for Windows
   save.hac            backup program
   save_modif.hac      backup program

Documentation
=============

   hac.txt                             this file
   HAC Ada Compiler User Manual.pdf    an 80+ pages user manual; source here:
                                         https://github.com/sowebio/hac-doc
   hac_work.xls                        Excel workbook containing, notably,
                                         a bug list and a "to-do" list and
                                         a "done" (history) list

Some design points
==================

  - HAC is a single-pass, recursive-descent Ada compiler which, in its
      simplest form, emits machine code on the fly. It means that there
      are no advanced optimizations available, such as common subexpression
      elimination, that are provided by compilers like GNAT; but, the
      compilation is very fast, which is very pleasant for some usages
      like prototyping and programming-for-fun.

  - Current targets are:
      - p-code (a virtual machine specially adapted for HAC)
      - "Semantics", a pseudo-target that is used for smart editors
          (for example, LEA).
      - AMD x64/Windows (currently, only an embryo that can do
          "Hello World" only)

  - HAC reads Ada sources from any stream. In addition to files, it is able
      to read from a Zip archive (plan is to have sets with many sources
      like libraries in Zip files, for instance), from an internet stream,
      from an editor buffer (see the LEA project), from a source stored in
      memory, etc.

  - HAC Ada source file naming follows the GNAT convention: "parent-child.ads"
      for specification and "parent-child.adb" for body. An exception for
      HAC is the main program, where the extension can be anything. We
      recommend using ".hac" for programs that are meant to be principally
      executed through HAC. That way you can associate the ".hac" extension
      with the "hac[.exe]" executable on your operating system or your
      file explorer.

  - One goal is to complement or challenge GNAT, for instance in terms of
      compilation speed, or object code compactness, or useability on
      certain targets or for certain purposes (like scripting jobs).

  - HAC could theoretically be also used for tuning run-time performance;
      this would require a completion of the code emission for other targets
      than p-code (HAC's virtual machine), including, perhaps, an intermediary
      target that builds a syntax tree.

To-do list
==========

  The to-do list is located in the spreadsheet "To do", within the
  workbook "doc/hac_work.xls".

Language subset
===============

  HAC supports a small subset of the Ada language. On the other hand,
  Ada is very large, so even a small subset could already fit your needs.
  There is a growing list of programs that are working (in the meaning:
  the compilation succeeds and the execution gives a correct output).
  They are located in the "exm" directory and subdirectories (except
  the "not_working" one), as well as in the "test" subdirectory.

  The available Ada language subset supported by HAC is so far, roughly,
  the "Pascal subset", plus tasking, plus packages, less pointers.
  From a different perspective, HAC supports Ada 83, less pointers,
  less generics, less unconstrained types, plus a few items from
  later Ada versions: 95, 2005, 2012 and 2022.
  Since each Ada version is compatible with previous ones,
  one can say simply that HAC is a subset of Ada 2022.
  
    - Recursion and nested subprograms are supported.
    - You can define your own data types: enumerations, records, arrays
        (and every combination of records and arrays).
    - Only constrained types are supported (unconstrained types are
        Ada-only types and not in the "Pascal subset" anyway).
    - The "String" type (unconstrained) is implemented in a very limited
        way. So far you can only define fixed-sized constants,
        variables, types, record fields with it, like:
          Digitz : constant String (1..10) := "0123456789";
        ... output them with Put, Put_Line, do comparisons and
        concatenations with expressions of the VString variable-length
        string type.
        For general string manipulation, the most practical way with
        the current versions of HAC is to use the VString's.
    - There are no pointers (access types) and nor heap allocation,
        but you will be surprised how far you can go without pointers!
    - Subprograms names cannot be overloaded, although some *predefined*
        subprograms, including operators, of the Standard or the
        HAT package, are overloaded many times, like
        "Put", "Get", "+", "&", ...
    - Programmable modularity (packages or subprograms that you
        can "with") is implemented.
        See exm/unit_a.adb for an example with subprograms as modules.
        See exm/prc.adb for an example with packages as modules.
        See exm/pkg_demo.adb for a larger example with packages.
    - Generics are not yet implemented.
    - Tasks are implemented, but not fully working yet (they used to
        work on SmallAda). See in exm/tasking for what is working
        and exm/not_working for what is not.
    - Small parts of the standard Ada library are available indirectly
        through the HAT, Interfaces and Standard built-in packages.
        You can see the currently available HAT items in its
        specification, src/hat.ads .

  A systematic testing is done in the "test" directory, via
  the all_silent_tests.adb test suite.

Thanks
======

  - The authors of SmallAda (list below) for making their work open-source.
  - Stphane Rivire, for extensive testing, contributions, suggestions,
        remarks, feedbacks and the User Manual.
  - J-P. Rosen for the free AdaControl tool
        ( https://www.adalog.fr/en/adacontrol.html ,
          https://sourceforge.net/projects/adacontrol/ ) which was very
        helpful detecting global variables stemming from SmallAda's code.
  - Pierre van de Laar for running his Renaissance-Ada tool
        ( https://github.com/TNO/Renaissance-Ada )
        on HAC's sources.
  - AdaCore for providing their excellent Ada compiler for free:
        https://www.adacore.com/community (via the Alire crate system)
        https://www.adacore.com/download (versions till 2021, standalone)

HAC on the Web
==============
  Home page:     http://hacadacompiler.sf.net/
  Project page:  http://sf.net/projects/hacadacompiler/
  Mirror:        https://github.com/zertovitch/hac
  Alire crate:   https://alire.ada.dev/crates/hac

History of HAC
==============

    - Now:  HAC is being made more and more usable for real applications,
              with Ada compatibility, modularity, a library with I/O,
              system subprograms,...
    - 2020: Presentation at FOSDEM's Ada Developer Room:
              https://fosdem.org/2020/schedule/event/ada_hac/ .
              Starting a bit more serious testing and code cleanup.
    - 2013: January 24th: Day One of HAC: Hello World, Fibonacci
              and other tests work!
    - 2009: A bit further trying to make the translation of SmallAda sources
              succeed (P2Ada was improved on the way, for WITH statements
              and UCSD/Turbo/Delphi-style modularity)...
    - 1999: Automatic translation of Mac Pascal SmallAda sources
              to Ada, using P2Ada.
    - 1989: SmallAda is derived from CoPascal; works only within two
              very system-dependent environments (a Mac GUI, a DOS GUI);
              two similar source sets in two Pascal dialects (Mac Pascal,
              Turbo Pascal).
    - 1986: CoPascal (Schoening).
    - 1975: Pascal-S (Wirth)
              Reference: PASCAL-S, a subset and its implementation
              https://doi.org/10.3929/ethz-a-000147073

  Authors of SmallAda (in Pascal):
    1990 Manuel A. Perez               Macintosh version
    1990 Arthur V. Lopes               integrated environment for IBM-PC
    1989 Arthur V. Lopes               window-oriented monitoring for IBM-PC
    1988 Stuart Cramer and Jay Kurtz   refinement of tasking model
    1987 Frederick C. Hathorn          conversion of CoPascal

  Author of CoPascal (derived from Niklaus Wirth's Pascal-S)
    1986 Charles Schoening

  You can find the SmallAda sources and examples in the "archeology" folder.
  The Turbo Pascal sources files are smaller than the Mac Pascal ones,
  probably because of the memory constraints of the 16-bit DOS system.
  So the Turbo Pascal sources are especially cryptic and sparsely commented,
  full with magic numbers and 1-letter variables, many of them global - ouch!


================================================
FILE: exm/ackermann.adb
================================================
--  https://en.wikipedia.org/wiki/Ackermann_function
--  https://rosettacode.org/wiki/Ackermann_function#Ada

with HAT;

procedure Ackermann is

  function A (M, N : Natural) return Positive is
  begin
    if M = 0 then
      return N + 1;
    elsif N = 0 then
      return A (M - 1, 1);
    else
      return A (M - 1, A (M, N - 1));
    end if;
  end A;

  use HAT;

begin
  Put_Line ("Ackermann function");
  --  With M >= 4, numbers and recursions become HUGE.
  --  See table of values in the Wikipedia page!
  for M in 0 .. 3 loop
    for N in 0 .. 6 loop
      Put (A (M, N), 6);
    end loop;
    New_Line;
  end loop;
end Ackermann;


================================================
FILE: exm/anti_primes.adb
================================================
--  https://rosettacode.org/wiki/Anti-primes#Ada
--
--  The anti-primes (or highly composite numbers, sequence A002182 in
--  the OEIS) are the natural numbers with more factors than any
--  smaller than itself.

with HAT; use HAT;

procedure Anti_Primes is

  function Count_Divisors (n : Integer) return Integer is
    count : Integer := 1;
  begin
    for i in 1 .. n / 2 loop
      if n mod i = 0 then
        count := count + 1;
      end if;
    end loop;
    return count;
  end Count_Divisors;

  stop : constant := 15;

  results, div_count : array (1 .. stop) of Integer;

  procedure Search is
    candidate    : Integer := 1;
    divisors     : Integer;
    max_divisors : Integer := 0;
  begin
    for i in 1 .. stop loop
      loop
        divisors := Count_Divisors (candidate);
        if max_divisors < divisors then
           results (i)   := candidate;
           div_count (i) := divisors;
           max_divisors  := divisors;
           exit;
        end if;
        candidate := candidate + 1;
      end loop;
    end loop;
  end Search;

begin
  Put_Line (+"The first " & stop & " anti-primes are:");
  Search;
  --
  for i in 1 .. stop loop
    Put (results (i), 5);
    Put (" has");
    Put (div_count (i), 3);
    Put_Line (" divisors.");
  end loop;
end Anti_Primes;


================================================
FILE: exm/aoc/2020/aoc_2020.gpr
================================================
--  This is a GNAT, GCC or GNAT Studio project file
--  for the Advent of Code 2020 examples.
--  Some work with both HAC and "full Ada" compilers,
--  some (titled *_full_ada.adb) work only with "full Ada".
--  
project AoC_2020 is

   for Source_Dirs use (
     ".",
     "../../../src"   --  GNAT's access to the HAT package.
   );
   for Exec_Dir use ".";
   for Create_Missing_Dirs use "True";

   type AoC_Build_Mode_Type is
      ("Debug",
       "Fast",
       "Style_Checks" 
      );
   AoC_Build_Mode : AoC_Build_Mode_Type := external ("AoC_Build_Mode", "Debug");

   for Main use (
     "aoc_2020_25.adb",
     "aoc_2020_24.adb",
     "aoc_2020_23.adb",
     "aoc_2020_23_simple_array.adb",
     "aoc_2020_22.adb",
     "aoc_2020_22_full_ada.adb",
     "aoc_2020_21_full_ada.adb",
     "aoc_2020_21_full_ada_preproc.adb",
     "aoc_2020_20.adb",
     "aoc_2020_19_full_ada.adb",
     "aoc_2020_18_full_ada.adb",
     "aoc_2020_17.adb",
     "aoc_2020_16.adb",
     "aoc_2020_15.adb",
     "aoc_2020_15_full_ada.adb",
     "aoc_2020_15_full_ada_hashed_maps.adb",
     "aoc_2020_14_full_ada.adb",
     "aoc_2020_13.adb",
     "aoc_2020_12.adb",
     "aoc_2020_11.adb",
     "aoc_2020_11_full_ada.adb",
     "aoc_2020_10.adb",
     "aoc_2020_09.adb",
     "aoc_2020_08.adb",
     "aoc_2020_07.adb",
     "aoc_2020_07_full_ada.adb",
     "aoc_2020_07_full_ada_vectors_2x.adb",
     "aoc_2020_06.adb",
     "aoc_2020_06_full_ada.adb",
     "aoc_2020_06_full_ada_using_hat.adb",
     "aoc_2020_05.adb",
     "aoc_2020_04.adb",
     "aoc_2020_04_b_full_ada.adb",
     "aoc_2020_03.adb",
     "aoc_2020_02.adb"
   );
   
   case AoC_Build_Mode is
      when "Debug" | "Style_Checks" =>
         for Object_Dir use "obj_debug";
      when "Fast" =>
         for Object_Dir use "obj_fast";
   end case;

   Common_Options := (
     "-gnatwa",                        --  Warnings switches (a:turn on all info/warnings marked with +)
     "-gnatwCijkmopruvz.c.p.t.w.x",    --  Warnings switches (run "gnatmake" for full list)
     "-gnatf",  --  Full errors. Verbose details, all undefined references
     "-gnatq",  --  Don't quit, try semantics, even if parse errors
     "-gnatQ"   --  Don't quit, write ali/tree file even if compile errors
   );

   Fast_Options := (
     "-O3",
     "-funroll-loops", "-fpeel-loops", "-funswitch-loops",
     "-ftracer", "-fweb", "-frename-registers",
     "-ftree-vectorize", "-fipa-cp-clone", "-fgcse-after-reload"
   );

   Debug_Options  := (
     --  "-gnateV",  --  Validity check for parameters, GNAT > 4.6, redundant with -gnatVim ?
     "-gnatVa",  --  Turn on all validity checking options
     "-gnato",   --  Enable overflow checking in STRICT (-gnato1) mode
     "-g", 
     "-fno-inline", "-fstack-check"
   );

   package Compiler is
      case AoC_Build_Mode is
         when "Debug" =>
            for Default_Switches ("ada") use Common_Options & Debug_Options ;
         when "Style_Checks" => 
            for Default_Switches ("ada") use Common_Options & Debug_Options & 
             ("-gnatyaknpr",  --  Style: check all casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references
              "-gnatybfhiu",  --  Style: check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines
              "-gnatyO",      --  Style: check that overriding subprograms are explicitly marked as such.
              "-gnatyx",      --  Style: check x:no extra parens
              "-gnatye",      --  Style: check e:end/exit labels present
              "-gnaty2",      --  Style: check indentation
              "-gnatytc");    --  Style: check t:token separation rules, c:comment format (two spaces)
         when "Fast" =>
            for Default_Switches ("ada") use Common_Options & Fast_Options & ("-gnatpn", "-ffunction-sections");
      end case;
   end Compiler;

   package Linker is
      case AoC_Build_Mode is
         when "Debug" | "Style_Checks" =>
            for Default_Switches ("ada") use ("-g");
         when "Fast" =>
            for Default_Switches ("ada") use ("-g", "-s", "-Wl,--gc-sections");
      end case;
   end Linker;

   package Binder is
      --  -Es: Store tracebacks in exception occurrences, and enable symbolic tracebacks
      for Default_Switches ("ada") use ("-Es");
   end Binder;

   package Builder is
      --   "If -j0 is used, then the maximum number of simultaneous compilation
      --    jobs is the number of core processors on the platform."
      for Default_Switches ("ada") use ("-j0");
   end Builder;

end AoC_2020;


================================================
FILE: exm/aoc/2020/aoc_2020_02.adb
================================================
--  Solution to Advent of Code 2020, Day 2
------------------------------------------
--  Password Philosophy
--
--  https://adventofcode.com/2020/day/2
--
--  Part One
------------
--  Each line gives the password policy and then the password.
--  The password policy indicates the lowest and highest number of times
--  a given letter must appear for the password to be valid.
--  For example, 1-3 a means that the password must contain 'a'
--  at least 1 time and at most 3 times.
--
--  1-3 a: abcde     -> valid (1 time 'a')
--  1-3 b: cdefg     -> invalid (0 times 'b')
--  2-9 c: ccccccccc -> valid (9 times 'c')
--
--  Part Two
------------
--  Each policy actually describes two positions in the password, where 1
--  means the first character, 2 means the second character, and so on.
--  Exactly one of these two positions must contain the given letter.
--
--  1-3 a: abcde     is valid   : position 1 contains 'a' and position 3 does not.
--  1-3 b: cdefg     is invalid : neither position 1 nor position 3 contains 'b'.
--  2-9 c: ccccccccc is invalid : both position 2 and position 9 contain 'c'.
--
with HAT; use HAT;  --  in ../../../src

procedure AoC_2020_02 is
  s : VString;
  f : File_Type;
  c, sep1, sep2, sep3, sep4 : Character;
  i, n, valid, arg1, arg2 : Integer;
  compiler_test_mode : constant Boolean := Argument_Count >= 2;
  verbose : constant Boolean := False;
begin
  for part in 1 .. 2 loop
    Open (f, "aoc_2020_02.txt");
    valid := 0;
    while not End_Of_File (f) loop
      Get (f, arg1);
      Get (f, sep1);
      Get (f, arg2);
      Get (f, sep2);
      Get (f, c);
      Get (f, sep3);
      Get (f, sep4);
      Get_Line (f, s);
      i := 1;
      n := 0;
      while i <= Length (s) loop
        if part = 1 then
          if c = Element (s, i) then n := n + 1; end if;
        else
          if c = Element (s, i) and (i = arg1 or i = arg2) then n := n + 1; end if;
        end if;
        i := i + 1;
      end loop;
      if (part = 1 and n >= arg1 and n <= arg2) or (part = 2 and n = 1) then
        valid := valid + 1;
      elsif verbose then
        Put_Line (+"Invalid: " & arg1 & ',' & arg2 &
                  ',' & c & "  -->  " & n & "  |----|  " & s);
      end if;
    end loop;
    Close (f);
    if compiler_test_mode then
      if valid /= Integer_Value (Argument (part)) then
        Set_Exit_Status (1);  --  Compiler test failed.
      end if;
    else
      Put_Line (+"Valid passwords (part " & part & "): " & valid);
    end if;
  end loop;
  --  Part 1: validated by AoC: 607
  --  Part 2: validated by AoC: 321
end AoC_2020_02;


================================================
FILE: exm/aoc/2020/aoc_2020_02.txt
================================================
1-4 m: mrfmmbjxr
5-16 b: bbbbhbbbbpbxbbbcb
7-8 x: qxrxmxccxxx
9-11 k: kkkkkkktmkhk
8-12 g: sgwvdxzhkvndv
6-9 v: zvmvvmvvvd
8-19 f: ffffsplmfflffhtfrfj
5-16 p: pppppppppspppjpcp
2-3 w: wwmw
7-19 j: jjjjjjjjjjjjjjjjjjvj
5-9 q: wqzqqqqqq
14-15 g: gggggggggglggfgg
4-6 p: tppzkppdt
11-14 p: vppgpktpppppptpppqp
5-9 f: bfflffrfgf
7-9 p: ppppptbzn
1-3 l: lllvn
2-4 g: qvcdg
1-3 m: wsmdv
1-5 v: vvvvvvvv
10-14 l: lckqlgjllltlwbl
3-4 t: bsttftltjhbqbgtm
15-17 j: jjzjjjjjhjjjjjjpzjj
2-3 t: thtt
6-17 f: ffwkwzjtjktvsfmfhvsf
3-5 b: rqxbb
4-7 m: nbcmcwmmxrxqvtjfmm
1-2 v: gzvvvv
1-3 w: hkwhv
7-8 p: pppppppp
3-4 h: hhnwh
2-4 t: ttrtjtththkr
3-4 w: wwww
4-6 s: xsntgrftmpx
4-7 s: ssskssmsbs
10-15 m: bmmrbmmmmlmmmmmm
12-13 w: wqpwdmwllnjwx
5-14 n: nnnnlnnnnnnnnmnn
5-6 k: kktkfczk
5-7 r: nrdrtrvr
4-6 c: ccqchcc
2-9 l: fnldtfnbxjlvnlsnjhml
1-13 d: dlchvkccnwrcc
5-7 j: jjjjjjj
3-5 z: zzzzz
6-12 f: ffffflvmfhfx
8-10 w: wwwwwwwwww
3-4 r: rrbtr
3-11 b: bbbrbbvphbxbqk
16-17 n: nqhknnnnsnnnnnnnnnb
18-20 k: kkkkkkkkkkkkkkkkkhtj
3-15 r: ktvzqbmbrvczprfcw
9-11 q: qnqqdqqqgrrqsqq
3-5 p: pvppp
7-11 m: mfcdmmxmmmp
7-8 t: ttttktnt
5-6 b: bbpbbbv
14-16 z: zzzzzzzzzrzzblzw
11-12 j: jkjjjkjjjjjjgj
7-9 q: qqqqqqqqqq
10-11 f: cfffffffffff
4-6 c: nccccc
7-8 r: gmdlqfpwmrr
6-8 v: nvvpdnjx
8-12 x: xxlxxbbxxxxx
8-10 s: ssxssssssss
5-12 z: zhzdfzgdzzhzlz
11-12 k: qbkhvqjpqzfq
2-11 w: wwmlttwjflwdjcpclww
2-16 w: twkkmcrxmvjtwxlwsksf
6-8 s: sssfxbskvs
5-6 s: ssnsxsbs
10-19 l: ndzmdxqlnllxsbbwvsl
2-4 g: gggg
5-10 x: zxxxsxxxxxxxsxx
7-15 f: ffbrbdtzvdffktxfm
7-8 m: xmkmmmmmtmm
9-13 s: hksrdhzlsdmps
15-17 b: bbbbbbbrbbbbbbbrbb
3-5 x: xxxxxxx
2-6 t: wtltztnct
3-15 v: vvwvvvvvhvvvbwwvmdvr
12-14 p: ppphsppppppbphp
8-9 t: ttttvttttttt
2-3 c: cchvj
8-9 z: vzzzzzzgl
11-12 q: qqmqqqqqqqsnqqqqqqq
12-13 d: dddddddddddmd
8-9 t: wttttttqt
7-8 p: ppppvvcw
4-5 g: gncgj
12-13 s: sssssssssssmw
7-9 f: pswpnjftf
11-16 p: ppppnpkpkzppcpzbppp
1-12 q: ksqrqpqnqmqxqb
2-10 l: lllllllllll
17-18 z: zzzzzzzzzzzxzzzzzz
11-12 g: qggbjgggggssgggrk
3-4 s: bpss
6-8 v: vwvvvrvvv
3-4 t: tglktt
4-12 l: kvrnzqslwrdkfll
12-16 b: fbbbbbnbbvbbbbbcbbb
5-6 t: ttttzz
5-8 w: sqwhwwxw
8-9 z: zzzvztzrzzzz
3-6 l: llvdlt
7-8 r: mrcvnrrr
10-11 k: kkkkkkkkkmc
1-3 n: nnnmn
4-16 c: dqlcbclcrxkkszvcv
9-10 g: fxssmlmgbh
5-6 p: nwpfpp
3-7 w: cwhgrfshdwhwwll
14-16 l: llllllllllllllpll
3-4 f: ffff
4-9 d: dcdddxzvmrd
4-11 w: jwwnwwwwwvx
3-4 t: ttvc
4-17 r: rrsrrrrrrrrrbtrrrr
8-9 x: wqxxxcfdx
6-8 d: qgddwddtdddlc
12-13 v: vvjvvvvvzvvtvv
3-4 g: sghxg
3-4 b: ckbbmprfbbmzgqtkbw
5-6 x: xxxxxv
10-13 f: zpfffbfchxfffffjff
5-6 f: ffffwf
12-19 l: mlllllplllldllnsllql
4-5 v: vvvvp
5-8 w: vjwvghggwww
1-3 n: lnnn
16-18 p: ppppppvpppppwppppppp
15-18 z: zzzzzzzzzzzzzzjzzg
4-6 b: bbmbbb
5-7 z: wzlwzmzzzzzzzzzzzwz
8-12 p: gppmpppvppkzpcnpb
16-19 h: hhbhhhhhhhhhhhlnhhw
2-3 n: nnnn
3-10 m: mmntfkdjftmtmmbm
3-5 j: jjjjw
4-6 z: zjnzzzdzz
1-7 s: zsvsssf
6-7 v: vtvvvcg
3-12 f: qsrtmnxkvlcmt
5-11 q: mqgqqqqqrpch
5-9 g: msxkggnggg
3-8 v: vvvvhvjvdvxtr
4-6 k: jcklxdhkwhsqhq
6-7 x: vppxbhcjzxdqx
2-3 n: ntrg
7-8 g: gggwgjdhg
1-3 d: dddd
14-18 l: llllllllwlllxllllllz
8-19 g: ggggghggkhgrtzcgrrk
7-14 q: phzxvmbxxfsfwr
8-14 r: hbjmdrhnpxnwgz
15-17 d: dddddpddddldddtdgddd
6-7 k: kkkkkgkkq
2-12 w: wwzwwwwwwwwww
5-8 q: qqqqqqqzqqwqqzqcq
5-6 z: czzzrz
14-15 b: bbbrzhbbbbnxbgbb
12-13 d: dgddddddddtvddddvbz
3-5 v: vvvvv
13-16 q: qqqqqvzwqqqqqqqq
2-3 n: jpznnwfpchs
7-10 w: jwwpwkwwwpw
6-7 b: bbcnbcjxbbb
14-17 w: wqtwwwwwnwcwwbsww
3-14 w: gwwwwwwwhwwnxwwwww
4-9 w: mwllcfjfwwwjp
9-12 n: nnnnnnnhnwjnn
2-4 j: jjjjj
3-6 t: mrmttccttqt
16-17 p: ppmjpgptzgbppphfbp
12-17 v: vvvvvvvvvvvvvfvvvv
13-15 x: xxxxxxxxxxxxxxgx
2-4 d: dddddddd
2-5 t: ttmvt
13-14 j: jjjjjjjjjjjjtj
3-5 r: ggmrdf
7-8 f: ffdfflszfsfffqff
10-11 t: ttpttttttrgtt
8-12 j: jjjjqdhzjhjdj
19-20 z: zbzzzzzzzzzzzzzzzzrq
7-11 b: bbbbbhbbbxbbb
4-9 p: gzmkkbtpkzpgthklpq
2-5 b: bbbbxgb
4-13 k: kkkkkkzktckkkwkjkk
10-12 q: vrxznfqqnqgq
15-16 m: mmmmkmmmmmmmmmmmm
15-18 h: hlhhvhchthhhhtphhh
2-3 m: mftzmc
6-11 s: ksssssssssszs
5-6 q: qqqpqkq
7-8 n: nnfnnnnpn
6-8 c: chfcllrvxcnnjhtc
6-8 k: kkkkkxlk
2-4 s: tsspb
9-12 q: qqqqqqqqqqqqqq
17-20 h: hhhhhhhhhhhhhhhhhhhh
6-13 r: rrrrrgrrrrrrn
4-8 f: fffrfffz
13-14 n: nbnnnngnnnnnnpz
8-11 f: fvffsfqftcffff
3-5 w: vwhxz
8-10 x: nmxxknlptx
3-4 p: pppt
17-18 v: vvvvvvhkvvvvvnvvjlvv
10-15 z: twnsdkmgpvzfmzg
3-5 n: njnjnkghp
10-12 q: qvqqqqqqqqqq
6-7 r: rrrrrrrr
3-4 t: qltt
2-16 f: gffflcvtpfkfcjfrjvfs
3-5 s: swssp
11-13 l: lrpllllllvtslwllllld
1-3 n: nnnn
3-5 g: jjggnvg
4-5 b: bvbbb
13-15 l: llvllllllllllnll
5-6 j: hjjjjfsj
3-4 b: bkfbnb
5-8 z: zdzzzzzzzrzzz
3-4 r: rrrx
2-12 c: mczhvchkmjdrjh
12-16 x: sjxbcgdqtpfxflsxx
2-4 c: tcxf
4-5 w: kwjww
1-2 r: rrrwzc
4-7 d: ddddddkdd
5-6 q: qqqqqp
13-16 l: flljlllvnzlllllclldl
3-6 j: jjjpjj
3-4 g: gxgg
10-11 n: nnnnnnnnnnn
2-5 j: ztchj
4-6 j: pjzzrmjvhcxn
4-11 c: jchcccgccckc
11-12 d: dddddddddddd
6-7 n: nznnnnnntnnnnzpjfjnn
8-9 k: kbkkkkkkk
13-18 x: xbxxmxqxxxmxkxsxxxx
7-16 r: rrrrrrzrrrrrrrjmrrr
3-5 h: hhqhd
1-2 b: bbmb
2-3 n: rlnntn
2-8 q: qnfqnqhx
2-5 b: bjbbh
5-11 t: twtjnpttqtvtttptt
16-17 w: wtmwwhxtgwrrswwfblll
8-16 g: ggggghshggdggggcpwg
1-3 l: lsllzl
11-13 n: nnnvncnnmvnqnnnnn
6-7 s: ssqssss
10-18 t: tttnmjxttjttttttdzt
4-10 n: nkvncgtdpz
16-18 p: cphtrgffcpphfspxppgp
2-6 k: kkhgkskkm
6-20 r: fhrwtrzwrddfrndnrlgr
2-8 w: lkwnccgw
6-10 x: lxxxxxxgxwxxxrxqxx
4-9 q: tqtpgqjzdmqfq
9-12 k: kkkkkqbkkckkkjkql
5-9 r: rrrrrrrhcr
17-20 h: hhshshhhhhhhshhhbhhq
7-9 s: dngddfsss
12-13 q: qqqqqqqqqqqcq
2-6 v: vqtvvvv
8-10 c: cccfcncccccc
14-15 m: mmmmmmmmmmmmmmdm
7-14 s: ssslssfdssflvvsj
2-5 z: wcllj
2-11 n: cvnrlftcjct
8-16 k: krzkfbkkqkhnsjkjgkk
2-7 q: mvhvqnzdjw
5-8 l: lgbnlnclkllll
4-12 l: llllmllrlgllrklnlrbt
7-10 j: jjjjjjnjjcjsj
1-2 k: dgwmgsn
2-5 z: zjmxc
6-7 c: ccccccccc
14-17 k: bkkkkkkkkkkkndkkkk
2-4 x: xxjxtxbq
7-9 w: drjcfwzwwwfwwfzxww
4-5 p: pppwc
4-5 r: rrrvm
1-8 r: qrrrmrrrrr
16-18 l: llllllllldllltlklk
1-11 p: pwcpppbppppppp
5-19 w: wwwwwwwwwwwwwwwcwww
17-18 k: kkkkkwkkkkkkkkkkkxk
12-15 f: fsffffffflfqgfx
6-13 d: zddpdvddrvrdxq
1-10 f: ffffffrfkb
13-14 x: xxxxxxxxxxxxxxx
16-20 j: jjjjjjjdwjjfjjjjjjdj
8-11 r: rrrrrrrrrrrr
15-16 x: dxjxxxdxxxxxxxxxwxx
3-9 m: mjhqdgkmzmsmtdmhfn
2-7 k: kkkhwgtxlkmkqkk
11-15 m: mmgmmmmnsjmmlmmm
1-2 v: wvvk
8-14 s: zssssssssssssts
3-4 z: ztbzzr
4-10 x: xxkmqxxxxx
3-5 p: pkppppppppzpp
3-15 q: qpqmkqfqqlqqdfqtkqq
16-17 d: ddddddzbxcdddcddq
4-5 s: nqssf
4-5 s: sssbks
4-5 s: tsjlhsbsmt
1-5 z: zzzbztzf
1-4 l: pvsgtvt
3-6 b: bbbjbb
2-4 d: wkdvd
16-18 w: wwwwwwwrwwwwwwwzwkw
15-17 t: tqttjttttttttvtttt
5-9 q: qcqqqqdtqq
8-11 s: sssssssfssssssssssss
5-6 x: xxxvcpbxr
13-15 d: ddwdtctnjdcdpch
5-6 z: zzzwzzzq
3-7 v: bsphcnvwvtvphdp
3-4 q: vhcprqqgdmlfpwqqw
11-18 b: bfbbbfbbbbvhwbbbzlb
12-15 c: cccccccccccccqfcc
4-10 j: jjjjjjjjjjjw
8-14 s: ssssssspmssssssssms
6-15 b: jxnbdvxbbbcbrsbxrs
10-12 s: ssssjsssssfs
8-12 f: ffffdfkqflfpf
8-9 w: wwwwwwwwz
7-10 z: fzzlzzbtmthzzzz
2-3 k: kqzzb
11-12 s: ssssssssssls
16-17 r: rrrrhrrrrrrrrrrnr
3-11 b: czpbpbzswgcddm
4-8 z: cnzztzgzqz
18-19 m: mjmmmmmmmmmmmmmmmpk
10-13 q: gqqqqqqsxqqqqdtqkq
10-11 x: nxmbxxxrgpmxxxfnxxxz
2-5 x: xbxzrxd
9-14 l: llllpljlllfllwv
1-2 m: mmmmmm
1-3 b: fblbbfbbbbbtbbgbbb
3-4 g: gnnccg
8-9 f: fffffffkffff
5-6 r: rrrrhf
7-8 l: lwlwllllllctl
5-7 j: jrjjwgjvkkncnjbqc
3-4 b: bbsbb
4-13 c: jmcczvkbxccdf
4-5 g: wgrgg
7-8 d: dgddddzh
3-8 h: hhbhhhhhhhh
15-16 l: llldllllllldlllllll
11-15 r: rrgrrrrrrrnrrgxr
10-11 l: lllllllllll
4-5 x: xfdbjsmbbcxdphvlfkxr
9-12 m: rqmnmrmhcmmms
3-8 b: tzsnnndnbwgbskbb
4-10 v: vvkvvdrvwvc
9-11 j: jjjdjjjjjsj
6-11 b: hbbmbbbbbbjbtrbbbz
13-16 v: vvpvvvbvcvvvvvvvv
11-14 j: jjjjjjljjjtjjmj
7-11 v: cvdglnvjxkvvgptxvp
1-6 t: ttjqtttzt
7-10 f: ffwpzfxjfgffzf
4-7 d: dddgddp
4-19 n: mjbdzqxhtfbnbfxrpgnh
6-13 d: ddddddddddddd
2-4 t: rhkd
5-9 c: ccrcxzjdzccx
3-4 j: fwjj
15-19 q: qqqtxqqqqqqqqqqqqqqq
1-11 c: gcccccmccctcc
3-5 d: dxhhdr
8-12 k: pkvrkkkvkkmbkcxjwktk
9-11 p: ppnpppppxppp
11-12 p: dppcsppppppqppp
7-8 b: bbbbbbmbqp
7-8 c: cbccccccc
8-9 b: bbbbbbbcrbb
2-6 z: gzlnpzpkhjwwqtswcrz
5-6 d: dddsdkd
1-5 w: dxwkgwwwwwwmwwwww
4-7 q: qqqnwqlqrqdcqpq
6-9 m: lmmmdmmvmmmm
7-8 h: hhhghhxh
2-3 j: jjjj
1-4 r: rrrw
4-7 m: mmjmmrm
4-5 j: vljjrj
19-20 j: jjjjjtjjjjjjjjjjjjgx
2-6 h: xhltfh
5-11 s: ssssjsssssss
3-4 b: bbbb
1-5 g: chgmtgnn
6-7 j: jjjjjjz
3-8 c: cccccrccccc
3-17 s: sslstssssssssspsgs
17-18 x: bxxxxxxxqxxxxxxxkwxx
9-10 q: qfqqzqqqsddqqqqqqq
6-10 k: kmkkkxvqkrk
5-9 f: kffffffffcdfffffplf
5-6 r: rrrrrz
2-5 d: hdgzt
7-10 k: zkrllwkkkjrkqfkkk
9-11 b: bbrkbbbbcbqqb
8-12 g: gfgkgggggggggggggg
12-14 s: sssjsspstlvlsrsssss
4-8 g: pqgzcgvgflgntlp
13-14 j: jjjjjjjjjjjjjx
4-6 k: kkkmqpk
3-5 j: sjjbjlvjjvjr
2-9 c: ckccjxzcrcctbfn
10-12 n: hvnnnnxnntnlnn
11-15 m: mmrmmmdmmmlmmmjqm
6-8 p: qpzrrpcpbxg
5-8 w: xwdzcgclxwsvfwtwbxnw
3-8 q: qzqzhlzc
2-3 v: hvvvvltft
5-12 s: tgvsswttkwfssnsqjsxk
5-17 b: bbbbbbbbbbbrbcbbbhb
3-6 p: ppjpzw
3-5 k: kkxvkswk
4-8 v: vbvrvxvgrvvwwvvm
3-12 v: njvvgvdcjvvtvvcnvg
4-5 n: bnnnrn
8-9 l: jlvxdlpll
12-14 w: fkwwwwwwcwwjwmwc
1-4 q: wmqrzpqhj
4-7 t: tctsttlt
13-14 h: hhhhhhhhhhhhhf
2-3 j: jmjjjjj
5-6 v: vvvvlv
5-13 v: fnxvvvvvnvqvvvvvws
16-17 l: gllllllllllgwqlll
1-2 s: pnpfsqw
6-13 g: ntzqggvbnwxrgskg
5-12 k: krxmbxqbkhxlnvdxdkkq
14-18 d: ddddddddjdddbdddddd
4-7 z: zzzzxzzs
15-18 d: dddddddddbddddpddh
8-11 x: slxxxxxjkxxxrsdx
4-6 n: nnnfzzn
1-4 h: gslcmnhhfhvz
1-4 d: tddqds
2-3 c: fccp
2-5 k: mkqrknj
9-16 g: gpggdggwgwgwglggg
2-5 h: hhjds
4-5 b: zbnvld
6-14 m: mfqmnmqtdmmzmm
7-8 j: thvcsgjn
1-5 x: xwjdxdqjtc
4-17 r: fqbrqrnpslndrmjdhpjp
4-5 c: ccccw
5-6 v: vvvvdm
5-12 n: nnqzjntfnnnd
3-4 c: nccqlccq
1-10 p: nrvvzpppqpn
9-16 v: jvvrpvvvvvzvhhvvgz
12-13 s: sjsslsssfxxkrssstkss
1-3 t: vtwbh
5-16 q: sxxfrqhqtvzbzqwg
5-9 z: dnzlhzzzsdzz
15-16 d: pdddddjddpkdddtdddd
3-4 p: pplqppp
7-9 s: scsslshsqssw
2-3 v: vxvxv
8-9 w: wqwwwwwgshww
8-9 k: kkkkkkkkc
9-10 v: vhfvvnvvtvvb
1-12 z: zzzbzzzzzzzdzzzz
6-7 b: bbbbbwhb
12-13 z: zzzsvtlzzzzzz
1-3 s: pssssssxw
8-9 w: xwwwwwwdzw
1-4 x: xxkxxx
10-12 f: fffffffpffvffff
18-19 w: wwspwwzwwqcrwwhwwww
6-8 s: ssssstsks
5-6 j: jjcjgm
2-5 p: wprwpxbdkrfpmppqpd
8-18 n: nnnnnnnnnnnnnnnnnn
4-11 c: txncpqclrlc
2-10 f: ffcffftfffxrxf
1-4 t: ttttttt
4-9 f: zdpjffffbfbl
6-7 f: kfsffffffm
1-4 b: bbdn
6-12 k: kkhkkkkdqkbkjkkkl
3-4 n: kmnn
4-11 l: kllcllldllclll
7-19 w: pfwdwdnkblwzgkfnfmh
3-9 z: zzphzdnhqwlzzwzz
15-16 h: hhhhhhhnhhhhhhhd
1-4 l: vllll
2-13 l: hdhvgdrlltlmjptzq
1-3 p: njvpltppbkxpfpppp
1-2 j: kkjv
10-11 c: ccccccmcccjcc
5-8 v: tqvmvtwvzfczvvvvw
6-9 x: xxmxxxfxxxxx
1-10 z: zgzzztmdtkzzpxztbgpp
10-12 g: ggwzjgdsgbnggl
5-6 j: jvxjvjj
4-7 x: xnxxmgxxtjxxkj
13-14 d: ddddmddddddddd
12-15 c: cccccccccccnccc
16-17 n: nnnnnnnntnnnnngnmn
1-12 m: bzckgvmmbdcxtgtmb
4-7 l: ljllllljl
5-11 w: wzvzwwrkmtwh
11-13 l: lmtpwxlllhlgllwvqnp
6-10 f: fvgkffqvcfffdbfff
3-5 j: kbfjjj
1-2 h: hhztdpbttnc
8-10 b: bbbbjbbqkbbbd
1-13 c: hccvcxtcclpckzd
6-10 w: wwwwwtwwzrwwf
2-3 j: fjnnj
2-4 j: njtjjjxrjv
4-5 w: fwwzw
7-9 k: qbnkghdbqlz
2-9 s: dsdftlzsszlf
4-5 v: vvvvd
1-2 w: fbfwwb
4-7 t: tttttmt
3-10 h: hhhhnhhhskhh
3-8 w: qwswwswfl
1-3 p: pmpgpp
2-7 n: nmmgnssmtn
2-3 j: djvjgjp
6-13 x: jxxbxxgnxvbxx
6-10 v: vrvvvvvvdz
2-3 b: bbbbjrkwnc
1-2 h: fshnf
1-5 n: htsknrzqnntknfnjx
5-9 d: kkgtwrdjmxkzc
12-13 x: xxxxxxxxxxxxx
2-10 m: wmmmmmdpmmmmh
2-12 n: xttqcmfkvnlkzskjhmzn
6-9 m: mmmmmxmkp
10-16 m: gmmdqmjmflmmmmmcmmm
13-14 p: pprprppppspxfgnptppp
1-16 b: gcnbbnbbmsjxnbppcb
10-11 d: dkdddddfjmpvdddd
1-9 f: zlfwstnzp
14-15 n: nnnnnndnnnnnrnnvcndn
2-6 l: lvvldlzdzgdf
6-10 z: zzzzztzzzhzz
13-14 n: nnnnnnnnnnnngln
8-9 z: zjqztzztqzzbxzz
2-3 v: dwcv
4-6 m: kmmmkmm
5-9 g: wtgfgdmxkx
3-5 b: vbzbf
10-11 w: wwwwwwwvwwz
2-8 s: sztstsnssq
2-6 l: lldzcslxdwghmn
1-2 n: vmznndnnnbrhknjwzkzx
3-4 k: kknp
1-5 h: hhhhhhh
12-13 z: zzzzzlszzzzzxz
1-12 m: mtbspfpdgpznrsmvgq
11-13 q: qqqqkqnqhqrqrq
14-18 d: dtdrdddddddddxfddddd
1-6 q: bqqqqqgqqqq
1-7 c: dlmvcsztzpx
4-6 g: gmgggg
5-6 s: ssswsssgdghv
8-9 k: kkkkkkkgn
1-17 s: ssssssssssksssssss
4-5 b: qqtlsh
5-6 g: gggggg
2-11 r: drkpvrrlrtrvrjhpd
3-7 k: fkkhmddh
6-7 h: hhhwhnfph
3-4 p: ptppmwpnps
3-6 w: hwcshlrm
7-8 d: dtddqddzn
1-6 s: sslsbssbsg
12-15 n: tbnnjknnkwnnnnsnnnz
8-9 z: zzzzzzzzz
2-5 w: kjnwn
4-7 m: mmmtdjmmmmtl
4-7 h: dqfhzrqhfhntzhkhhdvb
3-5 g: zvflgg
5-12 s: lvsvqnvssgcx
11-19 p: pcppvppplpwppppjlps
5-19 p: gkpmfxlmppczdnhbqcw
5-17 b: mdzljsdvxdmbbbbddvrw
1-5 s: shpdss
2-5 t: btggtltvw
1-6 b: sbbbbbb
3-6 w: wwpsfkwnrrr
13-18 f: ffffwfffsfffwffffn
4-5 m: mpmmmxmmggvnb
5-6 z: pwsqhcztlf
8-11 d: ddddddddddlf
1-2 t: xttt
6-8 m: mmmpmvmmm
16-17 h: hhhhhhhhhhhhhhhrw
1-5 g: gpgpgg
3-7 p: gplrpzp
11-18 t: ftqnxttzttxtgttntrtt
10-11 z: zzzzzzdzzlgzzz
3-10 z: lzfzzzzszbzzztj
2-10 l: khdbddnxltnk
4-8 b: tbbcjsnbrbhfb
3-6 x: xgsxmn
9-13 t: ttttttttmtttt
7-11 l: fllllllzllmdshrll
18-19 g: hffqfwssgqpcnmddkcw
3-4 m: mmhvmc
1-3 w: vwnw
5-6 r: rrrrrb
2-4 j: rjqj
5-7 b: kgblcbbdrb
3-5 g: jgggggg
1-11 v: vvrvvhxvrvvnrvvv
3-14 w: ncwphcwvjwhdpwqkg
6-7 x: xxxfqmkvxx
13-14 v: vvvvvvvvvvvvkt
2-12 x: xzcvvxhhwwxxc
6-14 m: mdtnmjmhmnmmmmm
15-16 z: zzzzzzzzzznzzzzzzz
4-6 s: mcssdssjshscvcl
11-12 b: bnbbbmbjsbxbbbbbj
7-13 c: cccfhccczccwcccsc
3-4 m: cgtmmm
5-10 l: hxhbggrllmtgn
6-8 d: sdfdddlv
4-9 x: xxxxxvxxcx
11-12 c: rcmqkzjccccrdccmc
1-3 g: jgng
4-5 l: lvlll
9-16 n: rnnnqjnvqnnnlnnwdnnn
4-10 x: crdxgxrfjhr
1-5 f: tgdffffffqf
15-16 q: qqqqqqqqvqbfqknqqqqq
9-11 s: sssnffssksq
3-4 v: vqvvv
5-19 z: jthjzpgmwjbftzvmnpzk
3-10 w: mpxhrrnqdvncwssqwlxz
14-15 b: bzbbbbbsbbbbbbbbbbb
3-5 j: jpjvjjrjtmjj
3-6 w: wwmwwzw
1-6 c: ccccvzcccm
10-11 m: mmvwgmjmmmrqjmmmglm
2-3 f: fffw
6-12 m: bmbzmmrshmmz
5-6 n: nnnnnn
4-5 k: kmsgkwvkk
6-8 t: tttttbttt
4-5 j: vtmvsqjl
5-6 q: qshzdqqk
1-3 w: dwgw
8-9 q: qbqqqqqwq
5-10 m: lmmmkgmmwb
6-9 n: nnnlnnnnn
4-5 t: tntct
6-8 g: hgngghgw
6-9 t: gttwtgvpgtlt
6-7 l: lllllll
4-5 j: jhjkjjm
13-15 h: hhhhhhhhhhhhxnh
1-4 m: mmmmm
4-6 q: cqrtqsdqqzrknf
9-13 f: fffffffffzfvff
2-16 p: prxdxjpkppgpxsjwpppp
3-4 r: rrzh
1-2 g: cglblsnkg
1-3 f: xqnfwjmmwqffd
13-14 q: qqqqqqqqqqqqvjqq
18-19 g: dggggggggggggggggvgg
5-6 s: dsssssss
4-6 z: szdzzb
9-12 t: xtltpgftttmtt
10-16 m: mqmmmmmmmcmmmmqx
3-7 c: cpccngcvccm
2-16 s: jsdfsjsjtswhkvmsskj
2-3 c: kccc
4-16 k: qhndnqmrvjcczfkpds
4-6 n: nnnrkxl
9-10 s: ssssssssds
2-3 z: hfzcz
2-3 s: sssz
8-10 b: qbbbjbbbbw
7-16 k: gcvskkjkkkkwkzkz
7-9 n: nnnnnnhnnnn
1-10 q: qjxqmqxcgg
9-11 l: jdhjbbcnlzll
7-14 l: llrlxlllllltlnl
3-6 f: wfdqfbrf
3-8 t: ttzttmtvttzpl
10-12 v: vfvvvvvvvsvv
5-6 v: vvvvvm
11-13 t: ttttxtttttptttctttt
3-4 k: kkdm
4-6 n: nnnlnt
13-15 m: mmmmmbmmmbmmmmmm
5-6 l: klllnl
2-3 f: flzff
3-4 r: frrs
1-5 d: cqwkvsdqdvb
9-15 l: jvtfqczlnlwdpclxwp
12-14 t: ttttttlqtpttnt
11-12 m: mmmmmmmmmmmm
4-5 j: jjjkbjjjjj
9-12 w: wwwwwwwwkwxkwcb
6-12 q: tcqrqqqqxjqqqqmqhq
5-6 m: mmmsmmmm
2-5 t: mttbttprttddtv
10-13 t: tttttttttttztt
10-11 f: kmqfxttfkfd
5-7 v: vrlzpvjtvv
6-7 l: nlllllj
1-5 q: szdbqqkqqtkmssq
3-4 q: kcmlwqzczwms
13-16 b: bsbbbbbbbbrbsbbpzbb
9-11 d: dddsdbddkdkdd
2-15 j: xkjnntffvvxfnntcv
4-6 v: hvvvcvqvrwv
9-12 j: qjjjjdjgqhrjjfjrdj
8-10 v: vvvvvvvnvnvv
4-9 t: ttttthttt
8-16 g: ggggklggcggggxgg
1-3 z: wpqz
4-5 g: wgdnmxccgj
8-11 r: rrrrrrrxrrmd
1-9 f: ffffsfgdbsqfffzf
7-8 q: qzqqqqrrq
12-13 n: nnnnnnnnnnnnnn
8-12 j: jpjjjmjjjjjzj
1-4 j: nvjw
7-13 z: zzzzsnzxzznzrzgzzzz
14-16 z: zzzzzzzzzzzzzzzm
1-4 x: xxxxnxh
8-15 k: gnrkktkpcmklkksnkk
2-4 h: klph
11-16 c: ccckzdccgckpcccsc
15-16 l: dlllllllllllllll
2-3 s: dsxss
1-4 v: jvvv
2-8 t: ktkdtxkt
1-3 t: ftftttttt
4-5 k: kkkbkk
4-6 g: llqcggg
4-14 r: fmdvrrwlstlbjr
2-16 p: rpdfhpbqfwxlxhhc
6-8 j: jjjjjjjjj
1-7 f: fnnffblbqffkrff
1-3 k: rfqwlnnkzdq
15-16 s: ssssswssssssskssss
11-13 z: zzzzngfzzzzzz
5-7 h: hhbhhcnhfghhhv
2-7 j: zjrmjgmjdkp
5-8 z: bzzzpzzrzzzz
12-16 j: jtjnjjjjgjjjjjjsj
5-9 s: ssssssssms
2-3 s: ssss
13-14 d: ddddddddddddkt
12-13 r: wfdtrknrhvrrc
6-8 p: vpxphxngzhnkppppfp
2-3 j: jtjx
3-6 k: tkkvjkb
2-6 t: tvftftvbfx
5-7 z: zzzqzzz
14-15 h: whdhxhhhhhhhfxzhhh
3-4 g: ngjgg
9-10 z: zzzzztzztq
2-7 f: fffffqfszchff
4-6 f: lfqjnzccffjslsdf
5-6 z: lpzzzzsz
11-13 t: tttttwtttttttttttt
2-6 z: zzzzzz
9-10 m: mmmmmmmmjm
5-6 w: xwggfcwvwlx
1-4 j: jjjjjljjjjjjj
8-10 t: ttttttwttt
5-12 x: zxxxxxxpxxxn
3-4 v: vvlrv
3-6 h: hhhwhlxhlrhl
2-5 p: cptsjktp
4-11 j: bmjjjjjjnwwdk
15-17 p: ppppppppppfpppvpp
7-11 m: wnnmmwmtmmxmm
9-19 k: kkkkkjkkhwkcvkkkmknw
11-15 s: sspssbshssscssssss
1-8 s: sssssmssssssssssss
4-8 x: xxxxdxxx
9-10 n: nnnrnlnnnnnnnnnnnnnn
10-11 d: ddddddddddn
5-9 z: tzzzqzbmzzzqzjkzlr
9-20 f: fffffnfffffffsfnffff
5-6 g: gvggggg
13-14 x: xxxxxxxxxxxxxxx
6-7 v: vvvzvvvv
5-10 l: kbcvlfvlszndtlldjlh
4-9 s: vkcsdvszthkwmmmxs
3-4 b: jbmb
2-4 w: nmwm
5-10 z: tztzzfzgdzzszq
2-8 k: kzkkkkzwf
16-17 d: vxvzdgzwssqdcgbdb
4-5 b: bbbbb
7-9 w: wwfwwwjwln
5-12 k: ljkkkqfvqtkkxsd
5-7 q: qqqqhqqq
8-9 n: vnnnnnnpstnn
5-10 m: mmgzmmmmmm
3-14 q: qgbvqjxqnqqqqqqq
2-4 c: cccc
3-7 b: szbbkbdbmbbzbqs
1-5 m: mhmmc
3-6 n: nnlvnnvnq
2-3 c: mccc
11-12 m: ddmmmmxmmmmwfmmm
8-10 n: nnnnnrnnnn
1-12 g: sgbggglnggddgggsngrx
7-9 p: phppppppp
4-5 q: qxqqqq
3-7 v: vwsvvrvxvvvvvvwvvdlv
8-18 j: jmjcjjltjmjwjzrllgcj
2-14 r: rdrrrrrrrrrrrp
2-4 r: cxcbkmr
6-9 r: vtlnnvbcndqhrxkkjp
2-3 s: hxssnsswzc
10-16 r: csrsrxrrrrrrfrfdrr
7-9 w: wwbwmvrwdxww
12-14 p: pppbpppppppgpt
2-7 n: nnnnnnnn
3-12 f: mhjxfxgbbvffpclfffg
10-14 l: lllskllljllllll
11-16 l: lwlklllglzllllllll
13-14 h: hhhhhhhhhhhhhdhhhh
1-2 t: tttb
1-6 z: zzzrrzzbf
1-6 v: jrvzvvrs
3-6 g: jggbnl
17-18 x: xxxxxxxxxxxxxxxxrx
8-17 f: xnmffffbwfdcfrdfw
3-9 k: jmkdvkdnk
7-9 m: mmmmmmdml
9-11 c: cdmshccckqmcccccckp
16-17 g: gggggngggggggggggdg
7-8 n: nnknnnnnnn
3-13 n: fjhgrspsnkmnf
14-17 z: zzzzzzzzzzzzzqzzzzzt
13-14 r: rrrtrrfsvrzngw
7-8 k: kvkvkpvc
1-2 b: bbpbb
1-7 n: tchnrtbtldnmnnvvnn
3-4 s: sssssjv
1-9 l: cllllztmlllrzfl
9-10 x: qjxxxxxxdhxxxxxh
6-7 p: ppppfppv
3-8 q: mkqzqqbqzjrqbq
6-8 x: xxxxxxxx
1-7 f: ffffffff
5-16 b: jbbbbbqcbbbbbbfb
9-11 c: ccccccccccq
1-2 x: fqkx
4-12 z: znzzzzzzzzzzzzz
3-4 l: lglll
9-11 m: mmmmmmmmmms
14-17 x: xrxpxgkxxzdrxxxxckxv
3-5 t: gxjbbfcpmkbkxbtwbt
5-6 j: jmjjjj
14-15 g: ggggggggggggggx
6-7 l: lllllbl
2-14 q: qqtsqkqvqqqpxzqqcqq
2-4 w: fwhw
4-5 m: mzmtkm
2-4 g: ghghgp
5-6 r: rrrrnl
1-4 h: chghhw
7-12 r: rrrzglvrrrrsrr
1-7 x: xxcxdwxjmx
5-12 r: rrgrrffwtrrnrrqrrjnr
2-5 r: srdqrlxrkrrdkr
3-4 t: ttdg
11-12 s: bfjrkqqgdtlwrskmfrp
3-5 n: nnrnfzsnm
10-15 z: zzzzhzzqqczxwzqztv
2-7 f: ffgdfgff
7-10 d: ddtbdddddjtdqfdddfq
2-9 k: gkrkkkkkkkkhkqkx
13-14 n: nngnlnnnhnnnnnnnn
6-9 r: qrxrxzrff
7-9 m: mmmmmtmqqmml
11-12 p: pppppppppppp
10-13 j: jjjjjjjjjznvbjj
1-2 c: ccvc
7-8 m: mmmmtdmckkpmcbkjmm
5-8 j: sjptjjbjjjjj
6-8 d: jchdwrhd
5-6 z: lqzzzzkrzzvzwbbzktp
6-8 l: ztbltlll
2-3 z: zkrxzp
7-18 g: phgpgggqgzgnmwlpkwd
8-9 f: hffffffqf
17-19 p: pppppphpppppppppzpp
2-3 z: zzzfg
1-2 v: bfvj
4-8 b: bcbbbbbb
15-16 s: ppsnsssssssnssss
2-3 m: mnsm
2-4 h: hwfshh
9-15 h: hhwhhhhxhhhhhhh
17-18 n: nnnnnnnnnnnnnnnnnn
7-11 n: nnnnnqpnlbgqnqnshn
15-16 j: cdjmbcwdppvvjqvv
6-11 p: ppplppppxpt
4-5 r: rrrrrr
10-11 w: wwwwwwwwwww
3-7 p: pzppzspppmkxbldwpnwf
2-12 w: zwdljlzwgxfwvtdm
2-10 f: mzfjqfspgfrfhst
14-15 m: mzmmmvhwmdmmdpz
1-12 r: vrxrrtrxgvrd
4-5 n: nnnnnnpn
6-12 x: xkbwfsxxxxxkxxxxk
4-6 n: mncnxn
9-10 f: ffffpfqftbf
3-5 b: bzwbk
4-7 c: ncdcccc
11-12 t: dgdkrjgsgtlf
8-11 z: rqzdjqznrpkzmblbt
1-3 z: zfzx
2-4 z: kzgzkp
6-10 v: jvvvvvvvvs
2-9 v: vrvvvvvvvc
5-6 q: qqqqqqc
6-10 p: ppdknlgpqkp
10-13 z: zzzzzzzzzzzzvz
19-20 g: dtckblrmggknmxwnrjgg
4-18 p: ppcjpqfpcxtphlppmhcx
6-7 n: nnsnnknthn
10-11 f: fffffffffff
2-4 f: ffccltsfgk
6-11 d: dsqddtddddjcnssrcd
7-13 x: xxxxxqlxxxxfw
12-13 r: rrrdrrrrrmrrrr
15-17 p: pqppppppppppvppppppp
7-8 j: jjjjjrdp
4-6 v: vvvvvt
1-4 t: tltftjtjhz
9-15 j: jjjjjjhjjjjjjjkjj
6-7 c: ccccccccz
8-9 x: xxjxxxxxsx
4-5 h: hhrhh
2-3 g: cgnm
8-10 l: llqlgllzlvrllg
12-13 c: cvnbccpzzxcccfh
3-8 z: zbzrwzzzwrzbqnr
6-7 n: nnnnnnn
8-11 j: tjqjrjggjxxjggjj
7-12 l: bsvxdhljlcsj
3-6 j: jjfjjjjb
2-3 z: dzztwhmzqdx
9-12 v: vvvvvvmvzvvcv
13-14 v: vvvzvvvvvvvvvk
6-7 g: fgggghgng
13-14 h: wcghlwdbjhpdphkcv
1-2 t: nncsg
6-7 w: kwjwwxlwz
4-5 z: zzztvz
3-4 n: nvbvngnw
15-17 z: zzzzzzzzzzzzzzzzzzp
8-10 r: rrrstrgxrhrr
8-10 g: cggggggvgcg
1-4 m: mmvbz
3-14 j: bdbhbjnjnrldhwlbrkrj
1-4 r: rrkrnnd
2-3 f: fvwc
4-13 c: ccccvcgwbhwrcqf
3-9 c: jcghltcfkjchxmccccbs
3-5 h: hhhshm
5-9 h: hhhsjhhhhgthfgldw
4-12 h: mcwvwwphwwbc
6-11 g: gqgggvggggh
9-15 x: xxxxxxxxxxxxxxsx
16-18 t: rmqqtbtvttsdtjvbttl
9-20 f: cllnvlfkfrwzpqxwqgnn
9-18 v: vvvvvvvvzvvvvvvzvxvv
4-5 f: fzffbfvfff
1-5 p: pppppp
1-7 z: zjvchwzqjrtxzgz
4-9 v: vvvvvvvvvv
5-8 w: cwwwzwwb
7-8 r: rrrrxrrr
8-9 f: sgdcqfhfcfsflb
3-7 g: gdgtnfggq


================================================
FILE: exm/aoc/2020/aoc_2020_03.adb
================================================
--  Solution to Advent of Code 2020, Day 3
------------------------------------------
--  Toboggan Trajectory
--
--  Count trees (#) at integer locations, on a straight line
--  going through a map.
--  The line has a given rational slope.
--
--  https://adventofcode.com/2020/day/3
--
with HAT;
--  ^ For a build with "full Ada": files HAT*.ad* are in ../../../src
--  See also the GNAT project file aoc_2020.gpr .

with Interfaces;  --  Needed for GNAT (Integer_64).

procedure AoC_2020_03 is
  use HAT, Interfaces;

  i_max : constant := 323;  --  1-based
  j_max : constant := 30;   --  0-based
  --
  --  n : VString := +"example_03.txt";
  --  i_max : constant := 11;
  --  j_max : constant := 10;
  --
  map : array (1 .. i_max, 0 .. j_max) of Character;
  --
  --  Count trees on a trajectory with a rational slope (y / x).
  --
  function Trees (y, x : Positive) return Natural is
    ii : Positive := 1;
    jj, t : Natural := 0;
  begin
    for i in 1 .. i_max loop
      if map (ii, jj) = '#' then
        t := t + 1;
      end if;
      jj := (jj + x) mod (j_max + 1);  --  Map is periodic horizontally.
      ii :=  ii + y;
      exit when ii > i_max;
    end loop;
    return t;
  end Trees;
  --
  test_mode : constant Boolean := Argument_Count >= 2;
  f : File_Type;
  prod : Integer_64;
begin
  Open (f, "aoc_2020_03.txt");
  for i in 1 .. i_max loop
    for j in 0 .. j_max loop
      Get (f, map (i, j));
    end loop;
  end loop;
  Close (f);
  --
  prod := Integer_64 (Trees (1, 1)) *
          Integer_64 (Trees (1, 3)) *
          Integer_64 (Trees (1, 5)) *
          Integer_64 (Trees (1, 7)) *
          Integer_64 (Trees (2, 1));
  if test_mode then
    if    Trees (1, 3) /= Integer_Value (Argument (1))
       or prod /= Integer_64'Value (To_String (Argument (2)))
    then
      Set_Exit_Status (1);  --  Compiler test failed.
    end if;
  else
    Put_Line (+" a) Trees met with slope 1/3: " & Trees (1, 3));
    Put_Line (+" b) Product of total met trees with different slopes:" & Integer_64'Image (prod));
    --  Part 1: validated by AoC: 218
    --  Part 2: validated by AoC: 3847183340
  end if;
end AoC_2020_03;


================================================
FILE: exm/aoc/2020/aoc_2020_03.txt
================================================
....#...##......##..#..#.#...#.
..######...#......#....#..#.##.
..#.#...##......#.#..#..#....#.
..#.....#..#.#........#.#..#..#
#......##..###...#.#..#.....#..
#.......##...###...#....#......
.....##...#......##.#.#..#.##..
.........#......#.....#......#.
..#.#..#....#....#......##.#.##
.#...#..#.............#.#..#.#.
....#..#.#.##.#....#..#..#....#
...#..#.....#.......#...#..#..#
.....#.....#.......#..#...#....
.##.......#...#..#........#...#
...#.......#.#.#...#.#.#......#
#....#..#.....#......##....#..#
###.#......#.#.#.#..#....#....#
......##......#.#...#...#..#...
.....#......#.#.#......#.#.....
...##...#..#........#..#.##....
..##.#.#..#...###..........#.#.
.#..#..#.....#.........#.###.#.
....##.....#...#...##..#.##...#
....#.##....#.....##......#....
........#.#.........#.#.......#
#....##.#....#..#...#..........
#..###......#....##..........##
....##.#.....#..#.##......#....
#..#......#......#.............
...##.....##.......#.......#...
#...#.#.....#..........#...###.
#.....#..#.#.###...#......###..
...##.#......#........#..#.....
......#.....###.#...##........#
.#......##......##....#....#...
..#.#..#.....##....#....#..#...
..#.#.....#.##.#.....#.....#...
....#.......#...#.........##...
.#....#..#.......##.......#....
..#..##.....#...##.##.#.#......
.##.#....#............#.......#
.......#...#..#.#.##.....##..##
..###....#..#.##........##.#...
....#.#..#.....#..#.#.....#....
..#..#.#..............#..#.....
.......#.#.#.........#......#..
...##..#.#...#......##.#.......
#....#.#.........#...#....#..##
.#..#.#...#.......#.#.#....#.##
.#..###.#..#.#.....#..#........
#.#..##.###.....##.........#..#
#...##...#..##..#..#..........#
.#...#..#......................
...##..###...........#.#...##..
..........#.#....#.#...........
..#....#....#..#....#.#.#......
.#..#.....###......#...#...#...
#.##..#..#.........#..#....#...
........#......#...#.........#.
..#.....#.#..##...#.#.#...##...
..#...........#.##..#.#..#.##..
..............##...#.#......#..
#.#..#....#...##.###........#..
.#...#..#........#........##..#
.....##..#...#.....#.#.........
.#...#...#....###...#.#.#..##..
....#.........#....###..##....#
.#....#...####...##....####.#..
..#..#.......#..#......#.#.#...
....#....#.......##..#.#.......
..#....#...........##.#.##.....
#..#..#...##.##....#.#.#.###.##
...#...#....#.#...##...#....###
......##........#.........#.#..
....#####..#..##.......#.#....#
....##..#...###....#..#.....#..
..#........#..#.#.....#....#...
..#....#......#..#...#......#..
...#.....##...#.#..##.....#..#.
...#..#.......####.##...#......
.....#..#..#.##..##....#..#.#..
..#..#..##.#.#.##..#..#...#....
...#..........#.........#....##
.##.....###...............#.##.
...##...........#.#.#......#..#
.#...#.#.##....#....#..#.......
.#...###.#....#..#..#..#......#
#..#........###...........#..#.
..#...#......#.#.#......####.#.
...#.#....##.#.....#.....##....
...###..#.#.#...#.....#.###..#.
.#.#..#...##......#..........#.
##.....#.......#.#..###...#.#..
##.###....#.....#.....###.#....
#...#..##....#.#...#...#......#
.....##.#........#.###.........
.#..#..#.#......##.#...#.#.....
#..#.#........##...........##.#
#...###..#..####..#.#..........
..#...#....#...##.#....#....##.
......#.#........#.....#..#....
#.........#...#.....#...#..##..
#....#.........#...#.##..###.#.
#...###...#.##.#.#.............
#.#....#....#......#....#.#...#
##...#.##......#..#.#....#.....
....#...#.##....#..............
.........##..........#..##..#..
......##....#.#......#.........
..#.#..............#......#..##
...........##.......#.#.#......
##...#........##.......#.#.....
....#...#...#....#.#......##...
...#..#.#.#.........#..#.#....#
.##.#...#.#.........#.....##.#.
#.#.....#.#.....#..............
..#.#..#....#..........#..##...
...#..#....................#..#
...........#...........#...#..#
............#...#............##
..#....##......##...........#..
..#..#..#....#....##......##.##
##..........#..##.##.#...#.....
............#..#........###.#..
###...##.#.#....#....#.#....#..
...#......##...#.......####....
.......#..#..#.#.....#.........
........##.......##.....#......
#.#...#.###....#..#...##.......
...#.#....#..#####.#..##.#.....
..#.#..##.......###...#.....#..
..#.......#..#...#...#..#.##...
......#..#.......#.....#....#..
.......#........#.#.......##..#
.#.#.....#.......#.......##..#.
..#.#....#.#.#####.....#...#...
#..#............###.......#..#.
........##.........#..#...###..
.#............##...#.....#.....
.#..##..#....#....#.......#....
....##..........##.............
.##..........#..#..#....#...#..
...#..#..#............####.....
.............#..#.##..#.#.##...
.....#........#....#.#.......#.
###.#..#.#...#....##...........
....#......#...#....##.......#.
.......#.#...#.#...#........##.
..........#........#..#.##.....
##..#.#.....##.#...............
.....#....#................#...
...##....#........##.#....#....
.....##...###....#.#..#.......#
.....#.#.........##....###.....
.#.....##......#..##..##...##.#
.#..............#.....#.#......
.##......#..#..#......##.......
.......#..................#....
...#.#...##......####.........#
#....#####.#.#..#..#..#...#...#
##.#...#.......#....#...#...###
...#........#.....#...#.##.....
..##....#.......#....#.......##
#......#..##...#..##.#.....#.#.
..###........#.#..#........#.#.
...#.###..........#.....#.#.#..
#.###.....#...#...#..##..###...
#....#.#.....#.#........#......
........#.......##.......#.....
...........#...#......##.......
............#...#....#..#.....#
#.#.#.#....#.....#.#..........#
#.##...#...#..#....##.#.......#
...#..#......#..#...##..##..#..
#....#......#.#.....##.#..#....
#....#..##.#......#.#.....#..##
.#..##....##....#.#...#...#....
#.#.###....#.#............#...#
.#.#....#..#..........#....#.#.
......#..#.#...............##..
..#......###.#..........#.###..
....#.##.#..#...##..#.#...#....
..............#...##.......#.##
.#...........#....#....#.##....
#..#....#.....#...#.....##...#.
.........#...#.##.......#...#.#
.....#......#.........#.#..#...
##..........#.#..##...#.#.#....
##..##.#..#..#.....#.##....#...
........##....#.#.#....#......#
.#.##...#.###....#.........#..#
..........#....###..#.........#
#.#..#.#...#.......#..##.......
..#....#...###..............##.
#..###.....####...#..#..#...#..
......#..#...###........###....
..#.....#...#.......#....###..#
.#.........#.#.#....#.#.......#
#.#.###.#.#...........#........
......#..#.........#........#..
...........##.#........#.#...#.
.....#.#......##.......#.....##
...##...#............#..#.....#
.....#..##....##...##.#..#.#...
...#...#........#.#......##....
........#..##..#..#......##.#..
.#.#.....#.....#...........#.##
.#...#.#............#......#...
.....#...#........#....#..#.#..
...##....#..#...#..............
#....##.#.#............#.......
#..#..#.....##..#........##.#.#
##..#.#....#....##.......###..#
.#.#.#.....###.....#.#......###
.....#..#...###...#....#.#...#.
.##.....................##....#
.#.....#.........#....#.....##.
#...#....#.#...###.......#.#..#
...#.................#.#....#.#
.##...#.#......................
.##.#........#...##............
.#....#.....#.........#.##..##.
#......#...##..#.........##.##.
......#......#...####..#.##....
.###....#..##......#.##......#.
..#...#....#..#.......#.#......
#....#...#.................#.#.
....#.#.#..#...#..#.......#.#.#
#.#...##.......#.....##.#......
#.........#.....##..##..#......
....#..##..#.....#..#..#.#..#..
......#.#..#.#.#....#.#.......#
.##......#..#....##...##..#....
..#..#......#...##..#.##.....#.
..#..#.......#.#....#.....#...#
....#.#.....###...#.......#.#..
..#....##.....##.#........##...
#...............##....#.....##.
.#.........#....#...##.###.##.#
.#.##..#.............#.#.#..#..
.#.....#.................##....
..####.........#.#......#.#..#.
#.......#..........#.#........#
.#.#...##.....#.#.......#....#.
..#.##.#.......###....#....#...
.#....##.............##.#.#.#..
#.#.....#.#.#.#..#......##..#..
.............#..........#.#.#..
...#.#.............#.#...##....
.......#..#.#.......#..#.#....#
.............#.........###..#..
.#.#..#....#.....#..#.....#...#
#.....#....##..##.#..#........#
..##..###.....##....#.#..#.....
..#...##....#...#.#..........#.
...##..##.#.....#....#.........
..#...#........##.#..#........#
#.............#.###......#.##..
.#...#........#...........#...#
..##.......#.#..##.##......#...
...#.#...##....##..#...........
.#......##........#....##....#.
.........#..#....#...#..##.##..
....#..#.#...#.......#.#.##....
...#.#......#.#..#..#.#....#..#
.......#........#.........###..
#.#..#.#.........##............
##..##..#.##..###...#.#...#....
.#....#.#..#...#....#.##.....#.
.#.#.#.#........##...#..#.#.##.
.#..#.#..#...........#..#......
..#.##.#...#....#.........#...#
.....##...#.#...#...#....#.....
..#..........#.#.#.......##.#..
#.#............#..#.....#..#...
..#...........##.#.##.#....#..#
#..####.....#............#.....
.##......#####.#..#.....#....#.
...##..#.#......#.#..#..#...##.
#....................#.##...#.#
...#............#.............#
....#.##..........#.....#......
....##..##....#.#..............
...........#....##.#.....#.....
....#.....#....#....#......#...
#...##........#...#........#.#.
........#.....##..#.##.#..#.#.#
....##......##....#.....##....#
...#.#........##.......#...##..
#......##..#.#.#....##......#..
..#.......#.......##..#.##.....
.#...#...#.#.............##....
......#.#.#.........##...#..#.#
.....#..####....#.##..........#
...#...#.#....#.....#..#.....##
.........#.......#......###....
........##..##..#.#.#...###...#
.#..##.#....#...##.....#.#.#...
........##...#...##..#.........
.........#.......#.##..#...####
#......#.....#..............#.#
##..##.#.##.....##...........#.
#.............#.........#......
...####.#.##..#.#.#.##.#......#
..#.....##....#...#............
#..............#......#...###..
..#..#.#...#.##.........##.....
..#...##..#........#..#.##..##.
......###...#..#....#..#.###...
...##.##.###.....##.#.......#..
#....#..###..#.......#.#.#..#..
..##.............##..##...###.#
.#.#..#.........#..........#...
.........#.#.....##...#..#...##
....#..#....#####..#...#..#....
...#.....#.....#...#.#..#.#....
.#..#.............#.......##.#.
...##.......#.#.....##......#..
...........##..#.##..###...#.#.
...........#...........#...#..#
..#....#.##.#..#..#...........#
..#.....##...#......#...#......
...###.###.....##..........#..#


================================================
FILE: exm/aoc/2020/aoc_2020_04.adb
================================================
--  Solution to Advent of Code 2020, Day 4
------------------------------------------
--  Passport Processing
--
--  https://adventofcode.com/2020/day/4
--
-------------------------------------------------------------------------
--
--  HAC 0.084 "nice to have"'s detected in this exercise:
--    *   exception handling to catch invalid values
--    *   Index with From parameter
--    *   'Image attribute for enumerated types
--
--  Solved in HAC 0.098:
--    *   "and then", "or else"
--
with HAT;  --  For a build with "full Ada": files HAT*.ad* are in ../../../src

procedure AoC_2020_04 is
  use HAT;
  --
  function Val_Num (s : VString; hexa : Boolean) return Integer is
    c : Character;
  begin
    if Length (s) = 0 then
      return -1;
    end if;
    for i in 1 .. Length (s) loop
      c := Element (s, i);
      if not (c in '0' .. '9' or else (hexa and then c in 'a' .. 'f'))
      then
        return -1;
      end if;
    end loop;
    if hexa then
      return Integer_Value (+"16#" & s & '#');
    else
      return Integer_Value (s);
    end if;
  end Val_Num;
  --
  function Val (s : VString) return Integer is
  begin
    return Val_Num (s, False);
  end Val;
  function Val_Hexa (s : VString) return Integer is
  begin
    return Val_Num (s, True);
  end Val_Hexa;
  --
  cats, total, cat_idx, tok_begin, tok_end, nb : Integer;
  s, tok, cat, un : VString;
  compiler_test_mode : constant Boolean := Argument_Count >= 2;
  f : File_Type;
begin
  for criteria in 1 .. 2 loop
    Open (f, "aoc_2020_04.txt");
    cats := 0;
    total := 0;
    while not End_Of_File (f) loop
      Get_Line (f, s);
      if s = "" then
        cats := 0;
      end if;
      if criteria = 1 then
        if Index (s, "ecl:") > 0 then cats := cats + 1; end if;
        if Index (s, "pid:") > 0 then cats := cats + 1; end if;
        if Index (s, "eyr:") > 0 then cats := cats + 1; end if;
        if Index (s, "hcl:") > 0 then cats := cats + 1; end if;
        if Index (s, "byr:") > 0 then cats := cats + 1; end if;
        if Index (s, "iyr:") > 0 then cats := cats + 1; end if;
        if Index (s, "hgt:") > 0 then cats := cats + 1; end if;
      else
        cat_idx := 0;
        loop
          s := Slice (s, cat_idx + 1, Length (s));
          cat_idx := Index (s, ":");
          exit when cat_idx <= 3;
          tok_begin := cat_idx + 1;
          tok_end := tok_begin - 1 + Index (Slice (s, tok_begin, Length (s)), " ");
          if tok_end >= tok_begin then
            tok_end := tok_end - 1;
          else
            tok_end := Length (s);
          end if;
          tok := Slice (s, tok_begin, tok_end);
          cat := Slice (s, cat_idx - 3, cat_idx - 1);
          if cat = "byr" and then Val (tok) in 1920 .. 2002 then cats := cats + 1; end if;
          if cat = "iyr" and then Val (tok) in 2010 .. 2020 then cats := cats + 1; end if;
          if cat = "eyr" and then Val (tok) in 2020 .. 2030 then cats := cats + 1; end if;
          if cat = "hcl" and then Element (s, tok_begin) = '#'
                         and then Val_Hexa (Slice (s, tok_begin + 1, tok_end)) > 0
          then
            cats := cats + 1;
          end if;
          if cat = "pid" and then Length (tok) = 9 and then Val (tok) >= 0 then cats := cats + 1; end if;
          if cat = "ecl" and then Index (+"amb blu brn gry grn hzl oth", tok) > 0
                                --  ^ Idea: Maxim Reznik, replaces checking each value
          then
            cats := cats + 1;
          end if;
          if cat = "hgt" then
            nb := Val (Slice (s, tok_begin, tok_end - 2));
            un := Slice (s, tok_end - 1, tok_end);
            if (un = "cm" and then nb in 150 .. 193) or else
               (un = "in" and then nb in 59 .. 76)
            then
              cats := cats + 1;
            end if;
          end if;
        end loop;
      end if;
      if cats = 7 then
        total := total + 1;
        --  Prevent incrementing total if there is garbage
        --  or a "cid:" until next blank line:
        cats := 0;
      end if;
    end loop;
    Close (f);
    if compiler_test_mode then
      if total /= Integer_Value (Argument (criteria)) then
        Set_Exit_Status (1);  --  Compiler test failed.
      end if;
    else
      Put_Line (+"Valid passports (criteria set #" & criteria & "): " & total);
      --  Part 1: validated by AoC: 228
      --  Part 2: validated by AoC: 175
    end if;
  end loop;
end AoC_2020_04;


================================================
FILE: exm/aoc/2020/aoc_2020_04.txt
================================================
pid:827837505 byr:1976
hgt:187cm
iyr:2016
hcl:#fffffd
eyr:2024

hgt:189cm byr:1987 pid:572028668 iyr:2014 hcl:#623a2f
eyr:2028 ecl:amb

pid:#e9bf38 hcl:z iyr:2029 byr:2028 ecl:#18f71a hgt:174in eyr:2036

hcl:#cfa07d byr:1982 pid:573165334 ecl:gry eyr:2022 iyr:2012 hgt:180cm

cid:151 hcl:#c0946f
ecl:brn hgt:66cm iyr:2013 pid:694421369
byr:1980 eyr:2029

ecl:brn
pid:9337568136 eyr:2026
hcl:#6b5442
hgt:69cm iyr:2019 byr:2025

cid:66 hcl:#efcc98 pid:791118269 iyr:2013
eyr:2020 ecl:grn hgt:183cm byr:1993

eyr:2022
hgt:160cm iyr:2016 byr:1969 pid:767606888 ecl:gry hcl:#6b5442

hgt:157cm eyr:2026 ecl:oth hcl:#efcc98 byr:1938 iyr:2014

byr:1931 iyr:2015
ecl:gry
hgt:76in
cid:227 hcl:#09592c eyr:2024 pid:276365391

ecl:gry hgt:170cm iyr:2014 cid:285 pid:870052514
hcl:#866857 byr:1925 eyr:2025

eyr:2021
byr:1960 pid:569950896
iyr:2010 hgt:179cm hcl:#888785 cid:167

hgt:154in cid:194
pid:8142023665 byr:2010 hcl:7d22ff ecl:utc iyr:2026 eyr:1976

ecl:blu eyr:2030 hgt:192cm
pid:363860866 iyr:2019 hcl:#ceb3a1 byr:1963

byr:1947 hgt:167cm hcl:#7d3b0c ecl:amb
cid:70 eyr:2022 iyr:2019 pid:756932371

hgt:185cm pid:871945454
iyr:2020
hcl:#866857 ecl:amb
byr:1989 cid:184 eyr:2030

byr:1935 pid:322117407
hgt:153cm iyr:2011
cid:244 eyr:2022 hcl:#efcc98 ecl:hzl

ecl:blu hcl:#5e6c12
eyr:2029 iyr:2011 hgt:191cm byr:1992

hcl:#7d3b0c eyr:2029
hgt:163cm
pid:625292172 byr:1932 ecl:brn
iyr:2020

hgt:158cm
eyr:2030 iyr:2016 byr:1969
cid:173 pid:092921211 hcl:#602927 ecl:grn

hcl:#733820
iyr:2016 eyr:2029
ecl:hzl hgt:180cm pid:292904469 byr:1984

ecl:amb pid:901224456 hgt:190cm
iyr:2013
hcl:#733820
byr:1922

pid:262285164 iyr:2010
byr:2018 eyr:2026 hcl:#602927 hgt:179cm ecl:gmt cid:349

byr:1956 eyr:2027 pid:351551997 hgt:71in cid:277 hcl:#cfa07d iyr:2010 ecl:grn

eyr:2027 hcl:#602927 hgt:157cm ecl:gry
cid:128 byr:1953
pid:231551549 iyr:2012

iyr:2011 pid:771266976
cid:264 byr:1955 hcl:#b6652a
hgt:189cm ecl:blu
eyr:2030

eyr:2026 pid:698455242
byr:1949 ecl:gry hgt:190cm
iyr:2013 hcl:#efcc98 cid:139

ecl:blu hgt:181cm byr:1977 iyr:2011 eyr:2022
pid:454163967 hcl:#b6652a

pid:534506872 hgt:155cm iyr:2012
byr:1968
cid:333 eyr:2024 hcl:#623a2f
ecl:amb

hgt:162cm
iyr:2020
hcl:#733820 eyr:2027 byr:1995 ecl:gry pid:084994685

iyr:2016 byr:1990
ecl:amb pid:185689022 eyr:2025
hgt:184cm hcl:#866857

byr:2016 hcl:z iyr:2022 hgt:166in
eyr:2040

byr:1943 hgt:152cm hcl:#cfa07d ecl:hzl iyr:2016 cid:300 pid:376088014

iyr:2020 eyr:2026 hcl:#602927 ecl:gry byr:1962 pid:453907789 hgt:172cm

eyr:2023 hgt:185cm
hcl:#623a2f pid:963767258 byr:1977
iyr:2019 ecl:oth

hgt:159cm byr:1965 cid:349 ecl:blu pid:962908167
iyr:2013 eyr:2024
hcl:#fffffd

eyr:2026
pid:912822238 hgt:66in byr:1985 iyr:2018 hcl:#c0946f ecl:hzl

hgt:167cm hcl:#ceb3a1
byr:1990 eyr:2027 ecl:grn
iyr:2011 pid:642877667

hcl:#7d3b0c byr:1921 pid:976412756 hgt:192cm
iyr:2013 ecl:gry

iyr:2030 pid:283599139
eyr:2039 cid:203
hcl:f943cb
hgt:111

hgt:190cm
iyr:2027 ecl:blu hcl:z
byr:2004 eyr:2039
pid:734570034

hcl:#6b5442 hgt:191cm
ecl:oth byr:1989 pid:669414669 cid:196 iyr:2016 eyr:2023

ecl:brn eyr:2028 byr:1965 pid:630674502 hcl:#602927 iyr:2020 hgt:61in

iyr:2016 eyr:2022 cid:225
hcl:#733820 ecl:hzl hgt:166cm
byr:1934
pid:232742206

ecl:amb hcl:#602927 eyr:2029
pid:897535300
hgt:189cm byr:1952
iyr:2017

pid:853604345
hgt:161cm cid:269
hcl:#fffffd eyr:2030 iyr:2011 ecl:grn byr:1966

hgt:151cm hcl:#18171d eyr:2026 ecl:grn iyr:2016 pid:176cm
byr:2000

hcl:#341e13
eyr:2022
pid:536989527 cid:73 byr:1971
ecl:hzl

pid:739005658 hcl:#b6652a
eyr:2026 hgt:154cm ecl:hzl
iyr:2019 byr:1935

pid:373465835 ecl:oth byr:1932 cid:333 hgt:165cm
hcl:#b6652a eyr:2021 iyr:2014

byr:1967 pid:486658617 hcl:#18171d hgt:174cm
eyr:2021 iyr:2015 ecl:gry cid:53

eyr:2024
cid:124 iyr:2017 hgt:152cm pid:095649305 hcl:#341e13
byr:1920 ecl:oth

hcl:#623a2f
byr:1951 pid:993284548
cid:106
hgt:186cm
ecl:amb iyr:2017 eyr:2029

cid:308 pid:080673934
hgt:193cm
byr:1967 hcl:#623a2f iyr:2016 ecl:hzl
eyr:2021

iyr:2010 eyr:2024 byr:1946 hgt:156cm
cid:199
ecl:blu hcl:#866857

ecl:blu byr:1955 eyr:2022 cid:95 pid:139391569
iyr:2019 hgt:180cm
hcl:#efcc98

ecl:brn pid:579889368
eyr:2023 hgt:158cm byr:1935
iyr:2018 hcl:#cfa07d

byr:1920 pid:90919899 hcl:#18171d
hgt:152cm
eyr:2029 ecl:oth iyr:2014

byr:1961 eyr:2024
ecl:#d401e3 iyr:2011 hgt:172cm pid:919145070
cid:100
hcl:#efcc98

ecl:gry
hgt:168cm
hcl:#888785 byr:1942 pid:731032830 iyr:2014
eyr:2028

hcl:#6b5442 pid:265747619 hgt:191cm
cid:217
eyr:2028
iyr:2019 ecl:amb
byr:1948

iyr:2011 ecl:brn
hgt:183cm hcl:#fffffd cid:258 byr:1983
pid:835909246

byr:2030
iyr:2024 ecl:#f66808
hcl:fd548d cid:183
pid:#fced33
hgt:160in

ecl:utc hgt:183in hcl:a92c31 pid:0394222041
iyr:2008
eyr:1976 byr:2020

pid:126195650 iyr:2019 hcl:#341e13
ecl:blu
hgt:150cm
eyr:2025
byr:1964

cid:71 iyr:2016 hgt:157 ecl:grt
hcl:#18171d pid:#1ab5ea eyr:2027

eyr:2026 hcl:#b5266f
byr:1971
cid:269 hgt:192cm iyr:2012
pid:736578840 ecl:amb

pid:152109472 hcl:#ceb3a1 ecl:grn hgt:188cm eyr:2027
byr:1923

hcl:#341e13 pid:535175953 hgt:63in eyr:2028 iyr:2015 byr:1999 ecl:gry

hgt:183cm pid:611738968 byr:2001
eyr:2020 hcl:#a97842 iyr:2014
ecl:gry

eyr:2038 ecl:gmt pid:113210210 iyr:2012 byr:2011
hcl:z
hgt:157cm

hgt:157cm
pid:699449127
iyr:2014 ecl:gry byr:1980 hcl:#fffffd eyr:2029

iyr:2028 hcl:z pid:152cm
eyr:2039
ecl:#4760fb hgt:177in
byr:2017

eyr:2026 hcl:#efcc98
iyr:2020 hgt:180cm ecl:hzl pid:747449965 byr:2016

byr:1974 iyr:2019
cid:89 eyr:2023 pid:421418405
hcl:#fffffd hgt:192cm
ecl:gry

hcl:26c2ef eyr:2029 cid:309 byr:1931 ecl:grn pid:#4eb099 iyr:2024
hgt:174cm

ecl:gry
hgt:183cm
cid:281
eyr:2022 pid:050492569
byr:1968 hcl:c88145
iyr:2015

eyr:2028
iyr:2014 pid:712984515 hgt:187cm cid:206 hcl:#866857 byr:1927
ecl:brn

byr:1936 hgt:61in ecl:oth iyr:2012 pid:447813841
hcl:#c0946f
cid:126 eyr:2021

ecl:gry pid:791970272
eyr:2020
byr:1932 hcl:#623a2f hgt:161cm
iyr:2015

hcl:#c0946f
byr:1935 pid:721144576 eyr:2025 hgt:162cm
iyr:2017 ecl:oth

byr:1959
pid:551109135
ecl:hzl hgt:68in
eyr:1977 hcl:#888785
iyr:1955 cid:100

hgt:190in eyr:1993 pid:8358180772 iyr:1975
ecl:oth
byr:2024
hcl:3de172

eyr:2030 hgt:190cm hcl:#a40ef3 byr:1935 pid:484932501
ecl:amb iyr:2016

iyr:2015
byr:1964
hgt:176cm
pid:819552732 hcl:#c0946f ecl:amb cid:263
eyr:2024

hgt:65cm cid:59 eyr:2027 pid:074880819 ecl:utc iyr:2023
byr:1954 hcl:#623a2f

byr:1954 hgt:167cm iyr:2020
eyr:2023 hcl:#602927
pid:280295309
ecl:hzl cid:168

hgt:168cm pid:311043701 iyr:2017 byr:1965
ecl:hzl
eyr:2026 hcl:#fffffd

hcl:#fffffd ecl:grn pid:672987232 iyr:2012 eyr:2022 hgt:66in

iyr:2012 ecl:#6f4f9f
hgt:133 byr:1937
eyr:1953 pid:7177768428 hcl:#602927

iyr:2010
byr:1922 hcl:#c0946f
eyr:2029 ecl:gry
hgt:165cm
pid:893045052

iyr:2013 eyr:2028 hcl:#866857 pid:137143403
ecl:brn hgt:170cm byr:1940 cid:194

hgt:161cm
eyr:2027 pid:3966920279 ecl:gry iyr:2015 byr:1997 hcl:#cfa07d

ecl:amb
hgt:157cm byr:1971
pid:562746894 cid:305 hcl:#0b0e1a eyr:2021 iyr:2016

hcl:8b821d hgt:157cm pid:187cm cid:298 eyr:1926 iyr:2019
ecl:amb
byr:2030

hgt:155cm hcl:#341e13 byr:1924 pid:779847670
ecl:hzl iyr:2015
eyr:2024

pid:768590475 hcl:#a97842 iyr:2014 cid:128 eyr:2029
ecl:oth hgt:164cm byr:1990

iyr:2019 hgt:181cm cid:342
eyr:2020 ecl:gry byr:2001
hcl:#623a2f
pid:473165431

byr:1928 eyr:2026 hcl:#42a9cb iyr:2010
ecl:grn hgt:157cm pid:638074984

eyr:2028
byr:1951
pid:239781647 iyr:2020 hgt:156cm
ecl:hzl cid:215 hcl:#efcc98

pid:636605355 ecl:hzl
iyr:2017 cid:323 eyr:2025
byr:1995
hcl:#18171d hgt:187cm

byr:1933 hcl:#866857 hgt:152cm ecl:oth iyr:2014 pid:900790914 eyr:2030 cid:267

ecl:brn byr:1999 eyr:2027 hcl:#623a2f iyr:2017
pid:853165955
hgt:152cm

eyr:2030 pid:316704688 hcl:#c0946f ecl:brn iyr:2014 hgt:193cm

iyr:2012 byr:1928
hgt:154cm pid:570535769 hcl:#623a2f eyr:2026 ecl:hzl

iyr:2016 cid:252 eyr:2030 hcl:#888785
hgt:177cm ecl:grn byr:2002 pid:568715162

pid:570999226 iyr:2012 hgt:150cm
byr:2024
ecl:brn hcl:z eyr:2029

pid:174002299 iyr:2019 hcl:#cfa07d ecl:brn byr:1927
cid:77 hgt:159cm eyr:2027

ecl:#d16191 eyr:2022 pid:166cm hgt:165cm hcl:#18171d iyr:2015

pid:112585759
hcl:#341e13 eyr:2025 byr:1962 hgt:164cm ecl:hzl iyr:2018

pid:478415905 eyr:2025 cid:315
ecl:amb hgt:91
iyr:2014 hcl:#cc9d80
byr:1985

pid:561885837 hcl:#7d3b0c
hgt:169cm
byr:1921 iyr:2014 cid:178
eyr:2022 ecl:gry

ecl:#c87497 hcl:5321a2 eyr:2020 hgt:74in
pid:#7a62c6 iyr:1976

eyr:2037
pid:858202391 hgt:162cm
ecl:grn byr:2003
cid:278
iyr:2010 hcl:cbf662

ecl:blu iyr:2012 hgt:183cm hcl:#623a2f pid:848200472 byr:1997 eyr:2027

byr:1942
hgt:164cm
pid:464257339
iyr:2016
hcl:#7d3b0c ecl:gry

iyr:2012 hcl:#ceb3a1
hgt:193cm ecl:amb
pid:667987561 eyr:2024 byr:1960

hgt:187cm
pid:222340640
iyr:2018 eyr:2022
ecl:oth
byr:1957
hcl:#336667 cid:83

eyr:2025 iyr:2015 hcl:#733820
ecl:brn
pid:131195653

hgt:185cm eyr:2026
ecl:amb byr:1998 pid:938587659 hcl:#733820
iyr:2016

ecl:oth pid:300949722
eyr:2028 iyr:2016
byr:1933
hgt:179cm
hcl:#cfa07d

byr:1974 iyr:2019
ecl:hzl hcl:#c0946f eyr:2024 pid:484547079
cid:112
hgt:185cm

eyr:2022 iyr:2018 hcl:#fffffd pid:118568279
hgt:153cm ecl:gry byr:1941 cid:341

iyr:2018
eyr:2027 hcl:#888785
byr:1970 hgt:165cm pid:773715893
ecl:amb

hcl:#623a2f hgt:156cm byr:1938 iyr:2012 pid:745046822
ecl:amb
eyr:2030

iyr:2012
pid:097961857
eyr:2023 hgt:66in hcl:#fffffd byr:1962 ecl:utc

byr:1943 hgt:150cm
iyr:2012
pid:740693353 eyr:2023
hcl:#18171d cid:101 ecl:blu

iyr:2018 pid:183728523 byr:1924 hgt:154cm eyr:2030
cid:167 ecl:blu hcl:#ceb3a1

hgt:69cm
eyr:2025 hcl:z ecl:brn byr:1982 pid:250782159
iyr:2011

byr:1998 iyr:2018 hcl:#341e13 eyr:2022 hgt:157cm pid:497100444 cid:266 ecl:gry

eyr:2027 iyr:2011 hcl:#6b5442 hgt:156cm pid:494073085
byr:1998
ecl:hzl

byr:1947 hcl:#b6652a
iyr:2011 pid:228986686 eyr:2030 hgt:175cm cid:70 ecl:brn

eyr:2026 hgt:159cm
byr:1946 pid:534291476
iyr:2018 ecl:gry cid:225
hcl:#18171d

pid:439665905
cid:311 ecl:amb iyr:2018
eyr:2030
hgt:186cm byr:1950
hcl:#cfa07d

pid:250175056 hcl:#efcc98
byr:1981 cid:262 hgt:154cm ecl:gry iyr:2020 eyr:2027

pid:461335515 iyr:2014 hcl:#f1cf00 hgt:180cm ecl:amb eyr:2027
byr:1956

iyr:2014 eyr:2030 cid:194
pid:234623720 hcl:#733820
hgt:164cm byr:1929
ecl:blu

byr:1992
eyr:2024 hcl:#ef8161 cid:216
ecl:brn hgt:177cm iyr:2018
pid:101726770

hcl:#341e13 hgt:178cm iyr:2016 eyr:2029 byr:1945 pid:045325957 ecl:grn cid:99

ecl:gry
iyr:2012
cid:52 hgt:168cm byr:1943
hcl:#cfa07d
pid:899608935 eyr:2030

cid:241
byr:1934 hgt:161cm eyr:2027 iyr:2011 hcl:#c0946f ecl:amb pid:346857644

iyr:2019 hgt:178cm
hcl:#c0946f byr:1957
eyr:2026
ecl:brn pid:222885240

ecl:blu
eyr:2021 cid:312 hcl:#733820 hgt:186cm iyr:2012 byr:1969
pid:821704316

hcl:#6b5442 cid:159
hgt:180cm
iyr:2018
eyr:2028
ecl:hzl byr:1966
pid:#e0238e

pid:622400994 eyr:2022 hcl:#5b6635 iyr:2012 byr:1980
hgt:190cm ecl:oth

byr:1976 ecl:gry eyr:2020 iyr:2020 hgt:171cm pid:219878671 hcl:#6b5442

hgt:163cm byr:1968
pid:003521394 ecl:oth
iyr:2010
cid:61 hcl:#888785

cid:115 pid:810722029 hgt:166cm byr:1955
ecl:blu eyr:2030 iyr:2018

hgt:176cm
eyr:2025
pid:617393532 hcl:#733820 byr:1975 iyr:2018 ecl:grn

hcl:#733820 byr:1979 pid:838168666
hgt:190cm ecl:oth cid:330
eyr:2029 iyr:2018

eyr:1940 hgt:67cm iyr:2009 ecl:gry pid:#e76a62 byr:2020 hcl:z

hgt:190cm ecl:brn pid:396113351
byr:1956 iyr:2010
hcl:#6b5442 eyr:2024
cid:256

hcl:#efcc98
hgt:178cm byr:1984 iyr:2013 pid:752620212 eyr:2021 ecl:gry

iyr:2014 hcl:#a97842
hgt:166cm ecl:blu eyr:2024
byr:1935
pid:836748873

cid:236 ecl:amb hgt:168cm iyr:2010 hcl:#602927 byr:1950 eyr:2026 pid:404810674

eyr:2030 ecl:grn
byr:1975 pid:064596263 hgt:193cm
iyr:2019 cid:71 hcl:#a97842

iyr:2014
pid:298386733 hcl:#c0946f
hgt:180cm ecl:hzl cid:115 byr:1940 eyr:2023

iyr:1960 hgt:139 ecl:#9db7b8 byr:1980 pid:#ef597b cid:54 eyr:2028 hcl:fdcda3

iyr:2015 byr:1954 ecl:blu hgt:62in hcl:#ceb3a1 pid:253593755 eyr:2028

eyr:2025 ecl:blu pid:216388098 iyr:2017 byr:1968 hgt:151cm hcl:#602927

eyr:2022 hcl:#a97842
pid:606979543 iyr:2013 ecl:grn cid:63
hgt:186cm byr:1992

ecl:gry
hgt:168cm hcl:#18171d iyr:2017 pid:670898814 byr:1983
eyr:2022

hgt:155cm ecl:grn iyr:2012 pid:837979074 eyr:2024 hcl:#888785 byr:1972

iyr:2015 pid:970743533 hcl:#866857 eyr:2027
byr:1921 ecl:brn

eyr:2022
hgt:160cm
byr:1964 hcl:#efcc98 iyr:2019 ecl:oth pid:141923637

byr:2029 pid:3313111652 ecl:brn eyr:2034
iyr:2013 hgt:193cm hcl:z

pid:853890227 eyr:2029
hcl:#efcc98 iyr:2021 byr:2003 ecl:#037c39 hgt:160cm

iyr:1927
byr:1992
eyr:2030
hcl:#efcc98
ecl:amb hgt:152cm pid:436765906

iyr:2014
hcl:#c0946f pid:207052381
eyr:2024 ecl:hzl
hgt:177cm
byr:1923

ecl:blu
iyr:2014
eyr:2025 hgt:165cm
hcl:#733820 pid:343011857 byr:1967

ecl:xry
eyr:2028
iyr:2011 hgt:166in hcl:#c0946f
pid:805297331
cid:167 byr:1926

byr:1947
pid:468012954 eyr:2026 ecl:oth iyr:2018 hgt:170cm hcl:#b6652a

hcl:#6b5442 ecl:brn
hgt:180cm cid:233
pid:029789713
byr:1920 iyr:2010 eyr:2024

iyr:2010 eyr:2027
hgt:156cm
hcl:#c0946f
byr:1960 pid:312723130 ecl:hzl

eyr:2023 byr:1959 iyr:2010 hgt:186cm pid:066768932 ecl:grn hcl:#602927 cid:310

eyr:2030 pid:460535178 hgt:171cm ecl:gry iyr:2020 byr:1934 hcl:#888785

hgt:64cm eyr:2021 byr:1995 cid:336
ecl:gmt pid:926714223 iyr:2017 hcl:#18171d

eyr:2022 iyr:2010
ecl:grn pid:285994301 cid:215
hgt:186cm byr:1978

hgt:63in hcl:#866857
pid:386128445 iyr:2020 byr:1971 eyr:2021 ecl:gry

hgt:183cm hcl:#733820 iyr:2015
ecl:blu pid:216205626 eyr:2022 byr:1941

cid:150 ecl:amb pid:872515243 byr:1926
eyr:1996
hcl:#dedc39 hgt:67in iyr:2020

byr:1927 ecl:brn cid:153 iyr:2011
pid:165190810 hcl:#fffffd
eyr:2028 hgt:64in

pid:502603734
byr:1966 iyr:2015 hgt:176cm cid:205 ecl:brn hcl:#fffffd eyr:2021

hcl:#18171d hgt:158cm byr:1943 iyr:2019
pid:058840094
eyr:2023

byr:1962 hcl:#b6652a ecl:grn
cid:297
iyr:2010 pid:990422650
hgt:154cm eyr:2020

eyr:1934 iyr:2011
ecl:gry
hcl:z byr:2004 hgt:63cm pid:6173356201

pid:329432364 eyr:2029
ecl:grn hcl:#18171d iyr:2013
hgt:158cm byr:1960

hcl:#efcc98 iyr:2016 hgt:186cm cid:215
pid:852781253 eyr:2027 ecl:blu byr:1937

hcl:#623a2f ecl:gry iyr:2020 byr:1972 hgt:182cm pid:073426952 eyr:2027

hcl:#3317b9 byr:1950 pid:304511418 hgt:177cm cid:124 eyr:2020 ecl:hzl iyr:2014

eyr:2029
pid:034754507 byr:1936
cid:265 ecl:#b50997 hgt:183cm
hcl:#623a2f iyr:1924

eyr:2024 byr:1927 cid:243 ecl:gry hcl:#6b5442 pid:714355627 hgt:160cm
iyr:2016

hgt:152cm
ecl:gry hcl:#a97842
eyr:2029 byr:1952
pid:555308923 iyr:2010

byr:2008
pid:19681314 hgt:180in iyr:2030 ecl:gry cid:272
eyr:2023
hcl:#b6652a

cid:234
iyr:2014 byr:1940 ecl:hzl pid:042231105 hcl:#3bf69c hgt:172cm eyr:2029

hcl:#efcc98 pid:831567586 hgt:190cm iyr:2017
byr:1966 eyr:2024 ecl:blu

hcl:#341e13 ecl:blu
eyr:2022 cid:161 pid:197839646 iyr:2014

hcl:#cfa07d
byr:1957
iyr:2019 hgt:181cm
pid:543775141 ecl:oth eyr:2021

hcl:z
pid:#596c41 eyr:2035
byr:2008 iyr:1975
ecl:#c66ee6
hgt:150in

ecl:grn
hcl:#7d3b0c iyr:2016
pid:804255369 eyr:2028 byr:1983 hgt:69in cid:82

eyr:2022
iyr:2013 hgt:191cm ecl:gry
hcl:#a97842 pid:186827268 byr:1969

pid:871672398 eyr:2026 byr:1946 ecl:oth
iyr:2015
hcl:#866857 hgt:185cm

byr:1973
hgt:150cm
pid:905076707
iyr:2017
hcl:#2edf01 ecl:oth cid:221 eyr:2026

eyr:2024 ecl:grn pid:955444191 hcl:z iyr:2015 byr:2008 hgt:151cm

byr:1958 hcl:#fffffd pid:218986541 cid:203 ecl:brn hgt:154cm
iyr:2014
eyr:2026

hcl:#623a2f byr:1964 ecl:oth iyr:2010 pid:525843363 hgt:164cm eyr:2025

ecl:blu iyr:2013 hgt:193cm byr:1990 pid:612387132 hcl:#18171d cid:280 eyr:2028

ecl:oth eyr:2022
pid:110447037 hgt:187cm byr:1967 hcl:#efcc98

byr:1930
eyr:2026 hgt:159cm
iyr:2011
ecl:hzl hcl:#6b5442 pid:923471212

cid:350
eyr:2029 pid:823592758 iyr:2018
ecl:grn byr:1972 hgt:167cm hcl:#18171d

cid:76 eyr:2027 hcl:#6b5442 pid:099579798 byr:1930
iyr:2020
ecl:gry hgt:153cm

byr:1957 ecl:brn
hcl:z iyr:2016 pid:352677969 hgt:189cm
eyr:2029

cid:143 eyr:2035 pid:602952079
ecl:#9b73f0 hcl:#602927
iyr:2022 byr:1975
hgt:174cm

byr:1971 pid:741305897 hgt:192cm
ecl:amb hcl:#888785 eyr:2028 iyr:2011

ecl:oth iyr:2016
byr:1942 hgt:189cm hcl:#888785 eyr:2024 pid:054290182

hcl:#a97842
byr:1945
ecl:amb pid:370849304
eyr:2028
iyr:2016 hgt:168cm

hgt:154cm iyr:2015 eyr:2030 byr:1952 ecl:hzl hcl:#341e13 pid:996518075

byr:1941 ecl:amb iyr:2014
hcl:#fffffd pid:560990286 eyr:2022 hgt:173cm

ecl:blu byr:1974
hgt:150cm hcl:#ceb3a1 eyr:2020 iyr:2013
pid:827415351

hcl:#623a2f eyr:2027 iyr:2011 pid:913199234 ecl:oth
byr:1990 hgt:178cm

ecl:blu byr:1989 hcl:#b6652a
eyr:2026 pid:724881482 hgt:185cm iyr:2014

cid:115 pid:255002731 eyr:2025 ecl:amb
byr:1934 iyr:2020 hcl:#7d3b0c

hgt:150cm byr:1969 ecl:blu iyr:2023
hcl:#866857 pid:754288625 eyr:2029

iyr:2011 hcl:#7d3b0c ecl:hzl
byr:1930
hgt:188cm
eyr:2023
pid:256556076 cid:136

iyr:2025 byr:1978
ecl:#fe30a9 hcl:#efcc98 eyr:2029
pid:392032459 hgt:178cm

eyr:2027 iyr:2017 hgt:160in
byr:1990 pid:131099122 hcl:#623a2f ecl:amb

ecl:grn
byr:1978
eyr:2029 hcl:#18171d
hgt:165cm pid:172369888
cid:93
iyr:2011

ecl:hzl
hcl:#733820 iyr:2010 eyr:2029 pid:127253449
hgt:156cm
byr:1963

hcl:#6c8530
iyr:2020
byr:1929 eyr:2021 hgt:177cm ecl:oth pid:347925482

eyr:2037 iyr:2026
pid:163cm
hgt:174in byr:2007 hcl:c1305f cid:134
ecl:#0cf85c

iyr:2011 pid:033811215
hcl:#a97842 byr:2002 eyr:2021 hgt:186cm
ecl:brn

hcl:#a97842
iyr:2020 eyr:2029 byr:1972 pid:535511110 hgt:160cm ecl:oth

ecl:grn cid:89 hgt:193cm pid:73793987 iyr:2021 eyr:2027 byr:1939 hcl:z

hcl:#623a2f
hgt:182cm cid:154
pid:873863966 iyr:2018 byr:1999 ecl:brn eyr:2031

iyr:2014 eyr:2029
cid:71 hcl:#fffffd byr:1924 hgt:63in
ecl:gry pid:897972798

hgt:76cm
hcl:z eyr:1955
iyr:2012 byr:2001 pid:9425090 ecl:hzl

eyr:2021
pid:501861442
ecl:grn hcl:#d71ae9
byr:1977
hgt:167cm iyr:2015

iyr:2014
hgt:170cm ecl:gry byr:1928 cid:314 hcl:#602927 eyr:2029
pid:836710987

eyr:2027 hcl:#efcc98 ecl:amb iyr:2016 byr:1995 pid:603705616 hgt:179cm

eyr:2030 hcl:#602927 cid:105 byr:1943 ecl:hzl
pid:381601507
hgt:188cm iyr:2020

iyr:2011
byr:1993 hcl:#c0946f pid:292649640 hgt:139 ecl:hzl cid:268
eyr:1999

cid:339 byr:1928
ecl:brn eyr:2022 hcl:#733820 hgt:191cm pid:282733347 iyr:2019

hgt:176cm
byr:1935 ecl:brn cid:252 eyr:2023 pid:105060622 iyr:2020 hcl:#18171d

ecl:hzl eyr:2029
hgt:193cm pid:770254253
hcl:#efcc98 iyr:2020 byr:1926

pid:977785261 eyr:2022 iyr:2015 byr:1978
hcl:#733820 hgt:172cm
ecl:brn

byr:2021
hgt:160in
ecl:gmt
eyr:2032 cid:345 pid:179cm
hcl:8f5c13 iyr:2029

iyr:2018 hgt:182cm ecl:gry
pid:897076789 eyr:2023 hcl:#866857
byr:1980

hgt:88 eyr:2039 cid:99 byr:2007 hcl:a1bb42 ecl:#a2f6bb
pid:2264966188
iyr:2022

iyr:2012 cid:59 ecl:gry eyr:2021
byr:1931
hgt:172cm hcl:#7d3b0c pid:862416147

byr:1962 eyr:2025
ecl:grn
hcl:#866857 hgt:180cm iyr:2014 pid:313647071

eyr:2030 hgt:157cm byr:1985
iyr:2020
hcl:#7d3b0c pid:911544768
ecl:grn

hgt:175cm
byr:1938
iyr:2020 ecl:amb hcl:#602927 eyr:2026 pid:144411560

iyr:2019 ecl:amb hcl:#888785 eyr:2025 hgt:187cm
pid:942054361 byr:1939

cid:168 pid:722146139 byr:1952 ecl:grn
iyr:2014 hgt:97
hcl:z
eyr:2023

eyr:2024 pid:567528498 ecl:gry iyr:2012 byr:1990
hcl:#733820 hgt:193cm
cid:293

hcl:#bc352c pid:321838059 byr:1930 hgt:178cm cid:213 eyr:2023 ecl:amb
iyr:2017

hgt:173cm byr:1925 pid:070222017 iyr:2013 hcl:#ceb3a1 ecl:gry eyr:2024


================================================
FILE: exm/aoc/2020/aoc_2020_04_b_full_ada.adb
================================================
--  Solution to Advent of Code 2020, Day 04, Part Two
-----------------------------------------------------
--  Passport Processing
--
--  Full Ada version.
--
--  https://adventofcode.com/2020/day/04
--
with Ada.Characters.Handling, Ada.Strings.Fixed, Ada.Text_IO;
with Interfaces;

procedure AoC_2020_04_b_Full_Ada is
  use Ada.Characters.Handling, Ada.Strings.Fixed, Ada.Text_IO, Interfaces;
  --
  function Val (s : String) return Integer_64 is
  begin
    return Integer_64'Value (s);
  exception
    when others => return -1;
  end Val;
  --
  type Cat is (byr, iyr, eyr, hgt, hcl, ecl, pid);
  ok : Boolean;
  f : File_Type;
  cats, cat_idx, total : Integer := 0;
  tok_begin, tok_end : Integer;
begin
  Open (f, In_File, "aoc_2020_04.txt");
  while not End_Of_File (f) loop
    declare
      s : constant String := Get_Line (f);
    begin
      if s = "" then
        cats := 0;
      end if;
      for c in Cat loop
        cat_idx := Index (s, To_Lower (Cat'Image (c)) & ':');
        if cat_idx > 0 then
          tok_begin := cat_idx + 4;
          tok_end := Index (s, " ", tok_begin);
          if tok_end > 0 then
            tok_end := tok_end - 1;
          else
            tok_end := s'Last;
          end if;
          declare
            tok : String renames s (tok_begin .. tok_end);
          begin
            case c is
              when byr => ok := Val (tok) in 1920 .. 2002;
              when iyr => ok := Val (tok) in 2010 .. 2020;
              when eyr => ok := Val (tok) in 2020 .. 2030;
              when hcl => ok := Val ("16" & tok & '#') > 0;
              when pid => ok := tok'Length = 9 and then Val (tok) > 0;
              when ecl => ok := Index ("amb blu brn gry grn hzl oth", tok) > 0;
                                --  ^ Idea: Maxim Reznik, replaces checking each value
              when hgt =>
                ok :=
                    ((Val (s (tok_begin .. tok_end - 2)) in 150 .. 193
                                 and then s (tok_end - 1 .. tok_end) = "cm")
                      or else
                     (Val (s (tok_begin .. tok_end - 2)) in 59 .. 76
                                 and then s (tok_end - 1 .. tok_end) = "in")
                    );
            end case;
          end;
          if ok then cats := cats + 1; end if;
        end if;
      end loop;
      if cats = 7 then
        total := total + 1;
        --  Prevent incrementing total if there is garbage
        --  or a "cid:" until next blank line:
        cats := 0;
      end if;
    end;
  end loop;
  Close (f);
  Put_Line ("Valid passports (criteria #2):" & Integer'Image (total));
end AoC_2020_04_b_Full_Ada;


================================================
FILE: exm/aoc/2020/aoc_2020_05.adb
================================================
--  Solution to Advent of Code 2020, Day 5
-------------------------------------------
--  Binary Boarding
--
--  https://adventofcode.com/2020/day/5
--
--  Binary space partition in the plane for
--  locating seats.
--    F means "front", B means "back",
--    L means "left", and R means "right".
--
with HAT; use HAT;  --  in ../../../src

procedure AoC_2020_05 is
  f : File_Type;
  x : Character;
  max, id, r, c, b : Integer;
  test_mode : constant Boolean := Argument_Count >= 1;
begin
  max := 0;
  Open (f, "aoc_2020_05.txt");
  while not End_Of_File (f) loop
    r := 0;
    b := 64;
    for i in 1 .. 7 loop
      Get (f, x);
      if x = 'B' then
        r := r + b;
      end if;
      b := b / 2;
    end loop;
    c := 0;
    b := 4;
    for i in 1 .. 3 loop
      Get (f, x);
      if x = 'R' then
        c := c + b;
      end if;
      b := b / 2;
    end loop;
    id := r * 8 + c;
    if id > max then max := id; end if;
    exit when End_Of_File (f);
    Skip_Line (f);
  end loop;
  Close (f);
  if test_mode then
    if max /= Integer_Value (Argument (1)) then
      Set_Exit_Status (1);  --  Compiler test failed.
    end if;
  else
    Put_Line (+"Maximum seat Id in the plane = " & max);
  end if;
  --  Part 1: validated by AoC: 835
  --  Part 2: validated by AoC: 649
end AoC_2020_05;


================================================
FILE: exm/aoc/2020/aoc_2020_05.txt
================================================
FFFFBFBLLR
BFBFFBBLLR
BBFFFFBLRR
FBFBFFFRLL
BFFBFFFRRR
BFBFBFFRLR
FFFBBBBLRL
BFFFFBFLLL
FFFFBBFLLR
BBFFBFFRRR
FBBFBBFLRL
BFBFFBFLRR
FBFFBFFLLL
FFFBFFFRLR
FFFBFBBLLR
BBFFBFFLRL
FFFFFBBRLR
BFFBFBBLLR
FFBBBBBLRR
FBBFFBBLLR
FFFFFBBLLR
FBBFFFBRLR
FFBFBBFRRR
FBBFFFFLRL
FFBFBBFLLR
BFBBBBFRRL
FFFFBBBLLR
FFBFFFFRLL
FFBBFFBLRL
BBFFFBBRLR
FBBFBBFRLL
FBBBFBFRRR
FBBBBBBRLR
BFBBFBBRRL
FBBBBFFRLR
FBFBFBBLLL
FBBFFFBLRL
BFFBBBFRLL
FFBFFBBLLL
FFFFFFBRLL
BFFBFBFRLR
FBBFBBBRRL
BFBFBFFLLR
BFBFBFBRLL
FBFBBBFLRL
FBFFFBFRLR
FBBBBBBRRL
BFBBFFBLLL
BFFFFFBLRR
BFFBFFFLRL
FBBBFFBLLL
BFBFBFFLRR
BFBFBFFRRL
FBBBFFFLRR
FFBBFFBRLL
BFBFFFFLRR
FFFFBBFRRL
FFFFBBFLRL
BFFBBFBRRR
FBFBBFBRRR
FFBFFBFLLR
BFFFFBBLRL
FBBFBFFLRR
BFFBFBFLLL
BFFBFBFRRR
FBBBFFBRLL
FBFFFBBRRL
BBFFBFFRRL
BBFFBBFLLR
BBFFFBBRLL
FFFBFFBLRL
BBFFFFBRRR
FBFBBFBRLR
BFBBFBFLLR
FFBFFFFRLR
FBBFFFBRRR
FFFBFFFLLL
FFBBFFFRLL
FBBBBFBLRR
BFFFBFFRLR
FFFBBFBRRL
FBFFBBBLLL
FBFFBBFLRR
BFFBFFBRLR
FBBBBFBRLR
BFBBBBFRRR
FBBFBBFLLR
FBBBFBBLRR
BFFFBFFLRR
FFBBBBFLRR
FBFBFFFRRR
FBBFFBFLRL
FBBFFFFLLL
BFFFBBBRRL
FFBBBFFLLL
FFFBBBFLRL
FBBFFBBLRL
BFFFFFFRLL
BFBBFBBRRR
FBBBBBFLRL
FFBFFFFLRR
FBFFBBFRRR
FFBBFBBRLL
FBFFBFBLLR
FFBBFFBLLL
FBFFFBBLLL
FBFBBFBLLR
BFFBFBFLLR
FBFBBFFLLR
BFBFBFBRRL
BFBFFBBRRL
FFBFFBFLRL
FBBFBFFLRL
FBFFFBBRRR
BFBFFFFRLR
BBFBFFFLRR
BFBBFFFLRL
FFBFBFBLRR
BFFFBBBLRL
FBBFBFBLRR
FBBFFBBRLR
BFBBBFBRRL
FBBBFBBRRL
BFBFBBFLLL
FFBBFBBLRL
FBBBFBFLLL
BFFBFFBLLR
FFFBFBBRLR
FBFBFBFLRR
BBFFBBBRLL
BFBBFBBLRR
BFBFFBFRLL
FBBBBBFRLL
FBFFFFBRRR
FFFBFFBLLL
FFFBFFBLLR
BFFFFBBRLL
FBBFBBBLRR
BFFFBBBLRR
BFBBFBBRLL
FBFBBFBLLL
FFBBFBBRRR
BBFFBFBRRL
FBFFFFFLRR
FFBBFBFRRL
BFBFFBFRRR
FFBFBBFRLR
BFBBBFBLLL
FBBFBFBRLL
BFBFFBBRRR
BFFBBFBLLL
BBFFFBFRRR
FFFBFFFRRL
FFFBBFFRLL
BFFFFBFRLR
BFFBFBFRRL
FBFFFFFLLR
FFFFFFBRRR
BBFFFFFLRR
FBFBFFBRLL
FFBFBFBLLL
FBFFBFFRRL
FBBBFFFRLL
BFFFFBBRRL
BFFFFBBRLR
FFFFBFFRLL
BBFFFFBLRL
BBFFBFFLLL
FBFFBBFLLL
FFFBFBFLLL
BFBFFFBLRL
BFFFFFFRLR
BFBBBBBLLR
FBBBBFBRRR
FFFFFBBLRR
FBFFFBBRLR
FBFFBBBRRR
BFBFFBFLRL
BBFFFFBRRL
FFFBBBBLLR
BFFFFFBLLL
BFFBFFFLRR
FBFFFFFLRL
FFFBBFFLLR
BFBBBFFLRR
FFBBFFBRRR
FFFFBFBRRL
FBBFBBBLLL
BFBFFBBLRL
BFBFBBFRLL
BFFBBBFRRR
BFFFBBFRRL
FFFFBBBLLL
BFFFFFFLLR
FFBBFFBLRR
BFBFFBBLRR
FBFBFBBLRR
BFBFFFBLRR
FBBBFBFLRR
FFBBFFBRLR
BFFBBBBRRR
FFFFBBBLRR
BBFFBBBLRL
FBBBFBFRRL
FFBFBBFLRL
FFBBBFBRRR
FFFBFBFRLL
FBFFFFBLLL
FBFFBBBLLR
FFBFBBFLLL
BFFBBFFRLL
FFFFFBFRRL
FBBFBBBLRL
FBBBFFBLRR
BFFFBBBRLL
FBFFFFFRLR
BFBBBFFLLR
BBFFBBBRRR
BFBFFFFRLL
BBFFBBFLRR
BBFFBFBLLR
FBBFFFFRRL
BFBBFBFRRL
FBFFBBBLRR
BFBBFFBRLL
BBFFBBFRRL
BBFFBFBRRR
FFFBFBFLRL
FBFFFFFRLL
BFFFBBFLLL
FBBFFBFLRR
FBFBBBBRRR
FBFFBBFRLR
FBBBFFFRRR
BFFFBBFRRR
FFBFBFBRLL
BFBFBFBLRR
BBFFBBBLLL
BFFBBBBRLL
FBFBFBFLLR
FBBBBBBLLR
BFBFFBBRLL
FBFBFFBLLR
BFFBBFBLRR
BFFBFFFLLL
FBBFBBFRLR
FFFBFBFLLR
BFFBBFBLRL
FFFFBBBRLR
FFBFFFBRLR
BBFFFFFRLL
BFFBBBFLRR
BBFFBBFRLR
FBFFFFFRRR
FBBFBFBRLR
FFFBFFFRLL
BFBBFFFRRR
FFFFFBBRRL
FBBFFFBRLL
FBBBBBFRLR
BFBBBBFLLL
FBFFFFBRRL
BBFFFFFRLR
FFFBFBBRRR
BFBBBFFRRR
BFBFBFBLLL
FFFFBFBLLL
FBFBFFBLRR
BFFFBFFLRL
FFFFBFFLRR
FBBFBBBRRR
BFBFBBBLRR
BFFBFBBRLR
BFBFBBFLRR
FFFBBFFRLR
BFFBBBBRLR
FBFBFFBLRL
FFFBBBFRLL
BFBFBBBRRR
FFFBFBBRRL
FFBFBBBRLL
FBFBBBBLRL
BFFBBFFRLR
BFFFBFBLLR
BFFBBBBLRR
FFBFFBFLLL
FFBFBBBLRR
BFFFBBFLRR
BBFFBBFLRL
FBBFFFBLRR
FFFBBBFLLL
FBBFBBBLLR
BFFFFBFLRL
BFFBFBFLRR
FBBFFFBLLL
BFBFBBFRRR
FFFBBFFLRL
FBBFFBBRRL
FBFBFFFRRL
FBFFBFFLLR
BFBBFBBRLR
BFBFBFFRLL
FFBFFBBLRR
FBFFBBFRRL
FBFBFFFRLR
FBFBFBBRLL
FFBBBFBLRL
FBFFFBFRRL
BFFBFFBRRL
FFBBBBBRLL
FFFBBBBLRR
FFFFBFFRRR
FBBBBFBRLL
BBFFFBFLRR
FBFBFFBRRR
FFBBBFFRRR
FBBFFBFRRR
BFBFBFFRRR
FFFBBFBRRR
FBBFBFFLLL
FFBBFFFLLL
FFFBFFBLRR
FFFBBBBRRR
FBFFBFFRLL
FBFBFFBLLL
FFFBFFFRRR
FBBBBFFLRL
BFBBFFFRRL
BFBBBFFLLL
BFBBFFFLLR
BFFFBFBRRR
FFFFBBFRLR
BFFFFFBRRR
BFFBBBFLLL
FBFFFBFRRR
FBFFFFBLRL
FFBFFFFLLL
BFBFBBFLLR
FBBBBFFLRR
FFBBBFBRLL
BBFFFFBRLL
BFBBFBFLRR
BBFFBFBLRR
BBFFBBFRRR
BFFFBBFLLR
FFBBBFFRLL
FFBFBFFLLR
FFBFFFBRLL
FFFBBFFLLL
BFBBBFBRRR
FFFBFFBRLR
BBFFFBBRRR
FFBFBBBRRL
FFBFFBBRLL
FFFBBBFLRR
BFBBBBFLLR
BFBFFFBLLL
BBFFBBBLLR
BFFBBFFLRR
FBFFBFBLRR
FFBFBFFLLL
FFFBBBBLLL
FFFFBBBLRL
BBFFBFFLLR
BFBFBBFRLR
BFFFFBFRLL
BFFFFBBRRR
FBFFFBFLLR
BFFFBBFRLR
FBBFFBBRLL
FBBBBBBRRR
FFBFBFFLRR
FFBFFFBLLR
FFFFBBBRLL
FFFBBBFRLR
FBFBBBFRRL
BFFFBFBRLR
FFFFBBBRRR
FFFBFFFLLR
FBBFFBFRRL
FBBBBBBRLL
FBBBFFBLRL
BFFBFFFRRL
FBFBBBBLLR
FBFBBFBLRL
BFFFFFBLLR
BFBBBFBRLR
BFFBFFBRRR
FBFFBFBRRR
BBFFBBFLLL
FBFBBBFLLL
FFBBBBBLRL
FBBFBBFLLL
FBBBFFFRLR
FBFBFFBRRL
FBBFFBBLRR
FBBBFBBLRL
BFFBBBFRLR
FFFFBBFRLL
BFFFBFBLRR
FBBBBBFRRL
FBFBFFFLLR
FFBBBFFLLR
BFBBBBBRLR
BFBBFBBLRL
FBBBFBBRLL
FBFFBBBRLR
FBFFBBFRLL
BFBFFFBRLL
FBBBFBBLLL
BBFFFBFLRL
FBFFBFBRLR
FBFBFBFRLL
FFBBBFBRRL
FFBFFFBRRL
BFBFBFFLLL
FFBFFBBRRL
BFBBFBBLLR
BFBBFFBRLR
BFFFFFFLLL
FBFBBBBRRL
BFBBFFFLLL
FFFFFBFLRR
BBFFFBFLLR
FFBFFFBLRR
FFBBBBBRLR
BFBFBBBLRL
BFFFFFBRRL
FFBBFFFLRR
BBFFFFBLLR
FBBBFFFLLR
FBBFFBFLLR
FBBFFBFRLL
FBFFFBBRLL
FFBFFFFRRR
BBFFBFFLRR
BFFBFBBLRR
FFBBBFBLLL
BFBBBBFLRL
BBFFFBFLLL
FBBFBBFRRR
FFBBFFFLRL
FBBFBBFLRR
BFFBFFFRLR
FFBBFBFRLL
FBFBFBFLRL
BFBFBBFRRL
FFFFBFFRLR
BFFFFFFRRL
FFFFFBBRLL
FBFBFFBRLR
FBFBBFFRLR
FFFFBBFRRR
FBFBBBBRLL
FFFBBBBRLR
FBBFBFFLLR
FFFBBBFRRL
BFBFFFFLRL
FFBBBFFRLR
BFBFBFBLLR
FFFFBFBLRL
FBFBFFFLRL
BFBBFBFRLL
FBBBBFBLLR
FBFBBBBRLR
FFFBBFBLRL
FBFFFBBLRL
FBFFFFFRRL
FFBBBBFLLR
FFFBBFBRLL
FBFBFBFRLR
FFFBBFFRRR
BBFFFBBLRL
BFFBBBBLLL
BBFBFFFLRL
FBFFBBFLRL
BFFFFFFLRR
FFBBFFFRRL
FFFFFBBRRR
BFFFBFFRRR
BBFFFFFRRR
BBFFFBFRRL
FBBBFBFLLR
BFFBBBBLLR
FFFFFFBRLR
FBBBFBBRRR
FFBFFFBRRR
BFFBFFBLRL
BFBFFBFRRL
FBFBFBBRLR
FFFBFBBLRL
BFBBBFFRLR
FBFFBFBRLL
FFFFFBBLLL
FFFFBFFRRL
FFBBBBFRLL
FBBBFFBRRR
BBFFFFBLLL
BFBBFFFRLL
BFBFFFBRRL
FBBFBBBRLL
FFBBFBFRLR
FFFBFBFRRR
BFFBBFFLLL
BFFBBBFRRL
BFBFFFFRRL
FBFBFBBLRL
FBFBBFFRRR
FBFBBBFRLR
FFBFBBBLLL
FFFBBBFLLR
FFBFBFBRLR
FBFBBFBRLL
FBBFBFBRRL
FBBBBBFRRR
FBBBBFBRRL
BFFFBFBRRL
FFFFBFFLLL
BFBBFBFLLL
BBFFFBBLLL
FBFBBBBLRR
BFFBBBBRRL
FBFFFFBRLR
FBFFBBBRRL
FFFBFFFLRR
FBBFFFFLRR
BFFBFFBLRR
FFBFBFBRRR
FBFBBFBLRR
BFFFFBFLRR
BFBBFFBLRL
FFBBBBBLLR
FBBBFBBLLR
FFFBBFFLRR
FFBFFFFLRL
FFBBFBFLRR
FBFBBBBLLL
FBBFFFBRRL
FFFBFBFLRR
BFFFBFFLLR
BFBFFBFLLL
BFBFFFFRRR
FFFFFFBLRR
FBFFBFBLRL
FBBFBFFRRR
FBFFBBBLRL
FBFFBFBLLL
FFBFBFFRLR
FFBFBBBRRR
BFBBBFBLLR
FFBBBFFLRR
FBBBBBFLLR
BFFBFBFLRL
BFFBBBFLRL
FFBFFFBLRL
BBFBFFFLLL
FBBBBBFLRR
FFBFBFFRLL
FFFFBFBRLR
FBBFBBBRLR
FFFBBBBRLL
BFBFBBBRLR
FFFFBBFLLL
FBBFBFFRLL
FFBFBFFRRR
FBBFFBBRRR
BFBBFFBRRL
BFBBBFFRLL
BFFFFFBRLR
FBFFBFFRLR
FFBFBFBRRL
BBFFBBBRLR
FFBFBFFLRL
FFFBFBFRLR
BBFBFFFLLR
FBBFFBBLLL
BFFFBFBLLL
BFFBBFFLLR
BFFBBFFRRL
BFBBBBBRLL
BFBBBBFRLR
BFFFFFBLRL
FBBFBBFRRL
FBBFBFBLLL
BFFBFBBRRR
FFBBBFFLRL
BBFFBFFRLR
FBBFFFBLLR
FBBFFFFRLR
FBBBBFBLRL
BFFFFBBLLL
FFBFFBBLLR
FBFBBFBRRL
BFFFBBBRRR
FBBFFFFLLR
FBFBBFFLRL
FFBBBBFLRL
FFFFFBFLLR
BFFFFFFLRL
BFFFBFFRRL
FBBFBFFRRL
BBFFFFFLLL
FFFFFBFRRR
FBBBFFBLLR
BFFBFFBRLL
FBFFFBFRLL
FFFBFBBLLL
BFBFBBBLLR
FBBBBFBLLL
BFBFBFBLRL
BFFBFFFRLL
BFBBFBFLRL
FBBFFFFRRR
FFBBBBFRLR
FFBBFBBRRL
BFBFBFFLRL
FBBBBFFLLR
FBFBFBBRRR
FFBFBFBLLR
BFFBFFBLLL
FFBFBBFLRR
FFBFFBBLRL
FFBBFFFLLR
BBFFBFBLLL
FBFBFBFRRL
FFBFFBBRRR
BFFFFFFRRR
BFBFBBBRRL
FFBFBBBLLR
FFBFBBFRRL
FFBBBFBRLR
FBFFFBBLLR
FFBBFBFRRR
FBFFFFFLLL
FFFFFFBRRL
FFBBBBFRRL
FBFFBBBRLL
BFBBBBBLRL
FFBBFBFLRL
BBFFBFBRLL
FFFBBFBLLR
BBFFFFFRRL
FFBFFBFRLR
BFFBFBFRLL
BFBBBBBLRR
FFBFFBBRLR
BFFFBFFLLL
BFBBBFBRLL
FBBFFBFRLR
FFBFBBBLRL
BBFFFBFRLR
BFFFFBFRRL
BBFFFFFLRL
BFBFFBBLLL
FFFFBFFLLR
FBFFBFFLRL
BFFFBBFLRL
BFBBFFBLRR
FFFFBFFLRL
FFFFFBBLRL
BFBBBBFLRR
BFBBBBBRRL
BFFFBFFRLL
BFBFBBBRLL
BFBFFBFRLR
FFFFBFBRRR
BFFBFBBLLL
BFBBFBFRRR
FBFBFBBRRL
FFBFFBFRRL
FBBFBFBLRL
FFBFFFFLLR
BFFFFBFRRR
BFFFFFBRLL
FFBBBFBLLR
FFBFFBFLRR
FFBFBFFRRL
BFFBFBBRRL
BBFFFFBRLR
FBBBFFFLRL
FBFBFFFLRR
BFFFBBBLLL
FFFFFBFLLL
BFBBBFFRRL
FBFBFFFLLL
BFBFBBBLLL
BFBBBBBLLL
FFBBFFBLLR
FBBFFFFRLL
BFBFFFBRRR
BFFBFFFLLR
FBFBBBFLRR
FBBBFFFLLL
FBBBFFBRLR
FBBBBBBLLL
BFBFFFFLLL
BFFBBFBRLR
BBFFFBBLLR
BFBBFFBRRR
BFFBFBBRLL
BFBBBFBLRR
BFFFFBFLLR
FBBBBFFRRR
FBFFFFBLRR
BFBBFBBLLL
FBFBFBFRRR
FFFBBBFRRR
FFBBFFFRLR
FBBBBBBLRL
FFFBFFBRRR
BFFFFBBLRR
FBFBFBBLLR
FFBBFBBLLR
FBBBFFBRRL
FBFFFFBLLR
BFFBFBBLRL
FFFBFBBLRR
BFBFBBFLRL
BFFBBFBLLR
BFBFBFBRLR
BFFFBBBLLR
FFFFBBFLRR
FBBFBFBRRR
FBFFBBFLLR
BBFFFBBRRL
FBFBFBFLLL
FFFBBBBRRL
FBBBFBFRLR
BFFBBBFLLR
BFBBBFBLRL
BFBBBFFLRL
BFFBBFBRRL
FFFBFBBRLL
BFFBBBBLRL
FFFBBFBRLR
FFBFBFBLRL
BFFFFBBLLR
FFFFFBFRLR
FFFFBFBRLL
FBFFFBBLRR
FBBBBFFRRL
BFFBBFFRRR
BFBBBBBRRR
FFBFFBFRLL
BBFFBFBLRL
FFFFFBFLRL
BFBBFFBLLR
FBBBFBFLRL
BFFFBBFRLL
BFBFFBFLLR
FFBFBBBRLR
BFFBBFFLRL
FFFBFBFRRL
BFBBFFFRLR
BFBFFFFLLR
FFBFFFFRRL
BBFFBBFRLL
BBFFBBBLRR
FFFBFFFLRL
FBFBBFFRLL
FBBBFBBRLR
FBBFBFBLLR
FFBFFFBLLL
FBFFFBFLRL
FBBBBBBLRR
FFBBBBFRRR
BFBFBFBRRR
FBFFBFFLRR
BFBBFFFLRR
BBFFBFBRLR
FFBBBBFLLL
BBFFBBBRRL
FFFBFFBRRL
BFFFBBBRLR
FFBBFBFLLR
FBFFBFFRRR
FFFFFBFRLL
FBFBBFFRRL
FFBBFBBLRR
BBFFFFFLLR
FFBBFFFRRR
FFFBBFBLLL
FBFBBBFLLR
FFFFBBBRRL
BFBFFBBRLR
FBFBBBFRRR
FFBBBFFRRL
FFFBBFFRRL
FBFBBFFLRR
FBFFBFBRRL
BBFFFBBLRR
FFBBBBBRRL
FBFBBBFRLL
BFBFFFBRLR
FBFBBFFLLL
BFBBBBFRLL
FBBBBFFLLL
FBFFFFBRLL
FFBBFBFLLL
FBFFFBFLRR
FFFBFFBRLL
FFBBBFBLRR
FFBBFFBRRL
FFBBFBBLLL
FFBBFBBRLR
FFFFBFBLRR
BFBBFBFRLR
BFFFBFBRLL
BBFFFBFRLL
FFFBBFBLRR
FBBFBFFRLR
FBBBFFFRRL
FFBBBBBRRR
FBBBFBFRLL
FBBBBFFRLL
FFBFBBFRLL
BFFBBFBRLL
FFBFFBFRRR
FFBBBBBLLL
BFFFBFBLRL
FBBBBBFLLL
FBBFFBFLLL
BBFFBFFRLL
FBFFFBFLLL


================================================
FILE: exm/aoc/2020/aoc_2020_06.adb
================================================
--  Solution to Advent of Code 2020, Day 6
------------------------------------------
--  Custom Customs
--
--  https://adventofcode.com/2020/day/6
--
-------------------------------------------------------------------------
--
--  HAC 0.084 "nice to have"'s detected in this exercise:
--
--    *     ` clear := (others => False); `
--    *     ` rg := rg and r ` for arrays of Boolean (i.e., sets)
--    *     ` aaa : constant Character := 'a';`
--                       HAC should detect an expression as a
--                       static (compile-time-known) value
--
with HAT; use HAT;  --  in ../../../src

procedure AoC_2020_06 is
  total : Integer;
  new_group : Boolean;
  subtype Answer_Range is Character range 'a' .. 'z';
  type Yes_Answer is array (Answer_Range) of Boolean;
  r, rg : Yes_Answer;
  --
  procedure Collect_Group_Total is
    g : Natural := 0;
  begin
    for c in Answer_Range loop if rg (c) then g := g + 1; end if; end loop;
    total := total + g;
    new_group := True;
  end Collect_Group_Total;
  --
  f : File_Type;
  s : VString;
  test_mode : constant Boolean := Argument_Count >= 2;
begin
  for part in 1 .. 2 loop
    Open (f, "aoc_2020_06.txt");
    total := 0;
    new_group := True;
    while not End_Of_File (f) loop
      --  Collect answers from every group on the plane.
      Get_Line (f, s);
      if s = "" then
        --  Blank line: group separator.
        Collect_Group_Total;
      else
        for c in Answer_Range loop
          r (c) := Index (s, c) > 0;
        end loop;
        if new_group then
          rg := r;
          new_group := False;
        elsif part = 1 then
          --  Count the number of questions to which anyone answered "yes"
          for c in Answer_Range loop rg (c) := rg (c) or r (c); end loop;
        else
          --  Count the number of questions to which *everyone* answered "yes"
          for c in Answer_Range loop rg (c) := rg (c) and r (c); end loop;
        end if;
      end if;
    end loop;
    Collect_Group_Total;
    if test_mode then
      if total /= Integer_Value (Argument (part)) then
        Set_Exit_Status (1);  --  Compiler test failed.
      end if;
    else
      Put_Line (+"Part " & part & ".  Total customs answers: " & total);
      --  Part 1: officially validated by AoC: 6532
      --  Part 2: officially validated by AoC: 3427
    end if;
    Close (f);
  end loop;
end AoC_2020_06;


================================================
FILE: exm/aoc/2020/aoc_2020_06.txt
================================================
qtmdwspah
sqwdamhpt
phwdaqsmt
stmdqwhap
pqawdhtms

bgsickuztovfwa
yiozauvgfsbtkwc
zygijavmtfkcuwobs
fvsuwtiadzrncboklg

dxgieku
dihnxkgf

mqybtd
yqbtd
btydq

rgpbcfxtzoewy
otbyrfgwxzpec
yocrwtebzxgfp

qcpngeodrszaky
ocaqrngsyuz

xwenu
nwsxuye

xapwvhsktlmr
twpslarxhvkm
vhlwmrapxkts
pmkxraswvlth
ksrxpvtmwahl

xhcepbdsltvk
khcdptsixbg
spbjtdchxk
cbkxspqtdrh

kaishmtdl
jcnprqigt

pjqtekodlmwcaginxfzrushbv
iuyzsfaxcvrotdmklgebpnjwqh
dirxeqbswlonhzumgafvckptj
zqpitfrjnmhvuxbcdlwkogase
khncmsfdzlgwpvriotxujbaeq

motb
twm
mvt
nomt

euwhdnlaxbtjiqz
dquxjznhtlwebia
atzdwxqiunhlebj
jnwlzxdiuaheqbt

jnktcwaovpbqzei
qcrljzskbvo

tangojspuvlwbryeicz
eujvkaporgwdilbyfscztn

pjrisxqwdoyze
cvyzmjlqxsgpeirw
xieqwcajzslryp
xjpzerwqyamis

rftxglbkpqnchvajs
cnsvqgpurtjfeb

m
mcx
wramgjy
mv

meacfoiqpbzy
zmvqpaibegoyfc
oiyzmaengcfbpq
uiaqprbycmzfoe

qjdnecvmsr
sdmecpqn

gt
tg

bndhmeupwszlqiycofkt
fcrptkulhixjnazvmdg

nrcytwdaozvbmhsjuk
owarihdekqzslvnxmubyfpj
suzlnmxvkwjyodhbrag

fz
zf
zefpk
fz
fz

zfnqcdhvjwxa
hxfazjcwd
xzhtajkfwcd

weusntyxblcdqpvgfzoam
oxiyslgabqvdhnwzm

jneuovbpgfxlsmkwd
kjbwonlspfdumcegthv
omvfbgejaiwnkdulsp
orfgdlbqjkvhumpewns

mhb
hb
dhjxb
boh

af
tzlbugdkq
j

qhgnav
ngvahqp
gvnqha

hoer
oufeq
u
gmy
td

naguhdzsmcxlye
pglwjsvxzduc
uosgxqzldct
xugcszld
qcxsgtlzoud

uoxacitdkeh
kypudjgbsefi

bjywqhgcps
uaybelqkjpiwc
yblwqpjec
jwvyrcpbqzt
qjgywbocp

cuvwxkmrnliodphaj
rvuzcdxknphol
hprvkucdonsxl

qtgjunkhaovbw
wkgvotljhbq

blfvtr
vrtfby
mbtvjdfnr
xbftpvrh
svbrhptf

rijakd
kadnijer
kqdwjifar
jdrihkmaz
ejnirkfda

ysukmtloxgjhvnwp
qjxlwnvpyzsgbutomd

gxpdqomijnhkyws
vyqgxmjpowhsnik
mnxqhgykwiopjs

fm
u
fc
zd
yplnbikosxj

welcjifhgnzupo
izfpwljnodctheg
dtlhgznwepcojif
hzwvgpcifnjleo
wgpqvtcnjofhlezi

azhipsvbx
xwbip
ixpb
xbip
bpxi

yxhpltiuvzorefqnwm
azwiylnohxmejqurftvp
hvuzwfxmnqyeltpro
kwxghtdyfreqmplvzuon

n
f
a
f

xfoaj
ofsqb
eqfo

canrzup
znarcpu
pzcnrua
czaupnr
puchnzra

hwxtaqvsci
rhxylbskwcjmoid
svqexwhaic
whxisc

xfamongdyrhjpizqbtswl
tsnermfbvidyqcwhlxuzg

jz
zj
zj

mohrs
rom
mro
orm

rnwbshdkxv
vkrjwsdthnxb
kjwrxhsvnb
rnbhvxowas

lbdahrf
ralbfhd
lhfadbr
radhflb

wztomybdgaqhu
rmuohgyqbdz
dgzqrumoayhb
hgqdmyubjpeoz
mgdquhzoyb

xiy
yix
bixoy
xyi
xiy

xvzqjwfkhctgeayu
kdjmlrow

vnlu
ulnvg
wluvn
lvun

btmcqewifuh
gqvakfzrmyuicsjpdbo

npfy
yznfx
ynf

b
b
b
b
b

zuhkqwfpm
mqpzwkhf
pnwfqchkzm
kfumpqzhw
qzwhkmpfu

pcevtdhgylnmsxaqiuzkr
pxanvcgiquethzksmylrd
vdszgiqyautrpxhcnmlek

bhru
ubhr
uhvopbr
trbizhud

omnpx
yp
cpf
p

fuhokrpewbyvlnjcdmqi
pcijvmskndtwohxylqeurf
cdvfhebukmjrqnolwpiy
qpwhymlcfjrndoeuivk

xwehzfud
wupfdexz

xbdh
jxdhb

hmkbuyl
rtcefpsaui

jlfsy
oknuy
kvpy

hcgzs
hegzs
sapzhd

vnhjbqk
bkvqnhjd
vhnkqjb
jhnkqvb
bnhjkvq

myjnp
wkyjamn
kmyjna

rupvd
pvrud
rpdvu

kvnlmhgizwdbjsxf
nmfdkzgjxlbvsiwh
zmsphibqwglkejfxrvn

ge
eg
g
g
ga

eivbk
vikeb
bkiyve

puvf
fvup
uvfp
pvuf
fvup

rydhgfbmpktzvlewjusn
wqgfnovcerskjad
ekrfsjgvowndcxq

muco
ouse

pxoihbg
bogpxhi

aik
k
k

qa
aq
aq
aq

snezvhbkwa
nvzuaksbh
zbvalskhn
xposdbmhnavgzk
thvfcbznkulas

jaxdfucymsghp
hfxaqcwunsjgmkpyd
glfdjpuzxacyhm

sp
ps

cesof
vsu
s
svu
sv

s
t
te
t

epnq
oeyqn
nqe
qen
qne

taxpglnzkejswbo
zekwtongjpbxas
gasokxnzbejpwty
wanzsfbgpxjeotk
wzxaengjkbptfso

imftvao
vtmif

pbjelcf
prnhgwqem

xopmzg
zfoxg
xzgo
ozxg

gmcybniqevotjda
ytiebavgdqojcnm

mr
m

f
n

mnhpxfircz
cihmvrxzyf

ygibvxud
ykubiqxgvd
xydibeuv
buvqdyxi
budxiyv

zjpqlmftionbgu
tzbfgjiqoumapn
nzcjuftibompqg
aztbmoiqnjfgup

chpnjmvlw
hlbrdvqemcnwp
pnkvcmlwh
lmcyfwpvhn
ynlmcjvipawh

kzhxeqfa
feaxqzkh
hzxkaeqf
zfqhexka
fqxahkze

blwqdpy
yqdaniplwbe
jhxbrwdylngqs
qwtdylukzvbm

asobzdl
jahzxpdy
daksz
zadufl

ahunxksgp
sakhpun
nukathps
uzhnsapk
pmusknahz

yzmogwp
tbqcp
bnpcr
xhp

dhyxojbvrqnml
nkr
rnc
wngra

kmdynhutpjlvxaroce
pbwohkjtmyfnzg
tjoikmhypnsq

zduqkfivgjo
oizvjfuqbd
zvjuqrfigdo
vudqiozjf
oidvqyzuftj

usmo
sm
sm
ms

njf
f
glft

auh
hwiavfug

xevqipr
gwxdmlsuakcyf

iltoavmycurph
luhcarivtomxy
yihcratumoevxl
louhcvmiytra
miqzdtolhrcayuvwg

xwtcmqso

xdnimfbyr
okimydfr
uhgzfyjqat

evjdtmcoxiklhpgwq
qgnxbkftmhiy
ixqrakuhngytm

hfzpe
uefphkb
afmwhqpek
fvpoygjinlhexds

oly
byoal
yol
koly
oyl

k
k
k
k
k

ofhrz
xhpruzq
zrh
hwgrbedykvsmzin

ginxcsjevrwyqz
egysvqncxzrij
syvgzcnreqijx
zcvxgsjrqenyi
qyfvzirnjcgxes

eyxfutwoqjbrvkgds
xsfjoutrbeqwkvgyd
vqwtjgdbrsfoyukxe
vfurtykqgebjwosdx
eypubrkojqvdsgtfwx

odwmeztifrjxn
nrgmwlxc
vgkxwrlnm

tz
tz
rtz

daze
ezyad

ujqdozgh
goujdmqkzh
jghuqdzo
gjozdqhu

erdnakojyfzchvxg
hfekdrnctgvzpyjaxom

hwi
wih
hiw
hiw

krqdscaoiwhnyz
rwjaknoxyidzsqhpc
rnyqdawcoskifghz
wahrqznyvdcskiuo

swlakrxjmtpv
inaylxhdjwkmsvur
qbxavfrlewkcsjm

ucxvtw
ue
u
lu

oztxeqjvgb
tpdbjgoqe

spyqunh
uypnhqs

fdw
safw
wfjh
wfomxi
lwfsdn

daibtezjo
qtxeaizjmdb
aoejitbkzd
etadizjb

jkeynazqvobiflrushcwtgdmxp
wnrjequcdxlkmtfobihsvy
iksvuebxtjwmhfrdqyocln

gkxq
pkw
kw

swy
ywsn

jzqurhixawto
gaojpfrzciq
izoxrtqawj
asoihjqzutr

wijlermdyzhstf
zjlrwfsdhmtiey
elymwztijfrdhs

qatxy
tyq

nja
yha
a
gfsav
kha

uebolhvntdkfsxap
fpnlskhdeuobva
oahteupksbvdlnf
oeulbvhdpfksna
ansgphkrfdlovebu

vpe
vedp
pev
pev
pev

zacfpshmrequykt
tuzarfpmknwc
pzuimacvfktr

cjeqourh
eouqcljr
rojueqc

ykoi
koyi
koyi
kiyo

fvkhuntrmpz
ckngmxirpuzvat
rfuvksnozpath
bntdrlyvkzupj
rukwpvtzcn

wczery
eczwrby
wrzcey

xjndayl
hnlyaxdj
lndayxj
ynjdlaxt

j
j
j
tj

awhrfvjbzduistx
gnyhcmteop

ym
y
sy
my

zkai
ajiz
aiz
aiz
ikaz

irgsokuwy
lnxtcqsiwmf
busyvhzidw

qxhpynjewsfmkd
hwpqenfkydm

aedbfmx
fwexa
jgckhspy

zpusakfeb
izpev
sdepzu
znpwe
pqjgehtxzr

vqmlkjznbeiofahucdtsgw
utmvhgqedbocfwkszjlain
yfbqzaspnlgotrdjxuhvkemiwc
idglcasthofkuemnbjwqzv

uqhdebp
chdbquepl
qedzphbu
hupdqbe
qbedhpu

ehnv
t

aksmbzu
wvlhktdqpjmsirz
fznykbsem
ksgmz
kzxsymc

vnoetrhlgkcmqxdp
nvdqtkolcrhxep
pxcedrnhoiltqvk
elrxnhitcpqdokv

ymuxitzqsagrkofcvbj
tauxskfigjymro

cnfdjwbxkisp
cpydkbjxwsifn
cipnkbufswdjrx
ybkxihfwejnscdp

yueaplwitfdvkoxnbjcmrqgz
jvlfmxoakzwiegpbdnrquct
manwikovgbpuhrcfesjlzxtqd

lptzwxfn
fpnxtlz
nxtflegzpj

dkpuyaefsijvlrhgqxmnt
bshiwokugpflvtmzeqxnyja

in
n
xzou

ng
gn

epqbvmi
vqembi
bvmeqizu
mbeqiv

cjapgriulbzeq
ugiqdzcvpobjlrek
zqleircpubjg
cirjuqbzgepl

nhpsreikdjzo
hkjsnodipzer
znoidphekjrs

dezf
edfz
efdz
rdfze

nzitsqrfp
qiznrfspt
rfqizspnt
nsqizrptf

xntrkogqfapj
nioagqtmrfkjyp

is
sgdi
qsity

pe
ep
ep
ep

uhvpiwdgsfr
uwlpcqrezykovni

aevu
ae
ea
ae

djzfhxmas
msdxhz
zexhdsymt
dxzshktm
dzemshxg

msqiuvncoltxejg
cqxfmsonlvute

wmfblsrogvjinpc
rplfngicojbkvwms
cfbolhnjvrsimwgk
gmisflrwnkcjbov
vmwrcbosjngfuil

kbxitoqvzajudfnsgmyc
ikfwcxzgvtjedmsyouqnab
aqknmufjiypcvxbgodstz

eshyzxbqncuomfpwgk
gzcxqpmhljeoyuikbfrn
bzhxveutpfyaqmkcong

evqyuicpfhl
yquckvlpiejf

anf
szydm

qt
qt
qt

mfyovqgpnlbcxidauzh
cqniopdhfgxlauvzbmy
idxofbaylmcznuvqhpg
qbcpihzogydlfvmnwuxa
qgvcumyizpnabxdfhol

btwjlohyfaq
ydlwprkj

rhisamcj
csirha
srcaih
icshar

mejydkgtnfovuzix
enuvirjogdmkyxztf
xefomztvkungysdijc
jxdginfktapovyzueqhm
fioktdsnemgjuzyxv

hrztvexlkob
lwekirhbxdzqtmo

etxv
arxtvue
exvft

fwdnqsomhtryxvcgzej
eczwytuhfsgmdqnxoj
ycdsqwznhftgjmkoxe
tsjnexcafwmhygzbvqod

xovcfts
cfsopxvdt
xoscfvt
osfxtvc

w
rc
t
zs
ik

lzm
zpl

romqvb
mvo

uy
y
y
y

govwliuabszqp
goiabwfusvzlpnq
qpiwgbvaosulz
apvguizblwsqo

s
m
s
s

ozpiljymxhswnfuevt
emvbwshnylzxpjti
nveblmzchtwjiypsx

nldfsb
sfblndt
sdblfn
bnflds
ndslbf

ieg
idew

wonxsab
wbsaoxn
nobaxws
wasbnox

alscukjbf
lsbjakfc

jxcduqioabwpyhlzef
ialdxwfzycqjhbepuo
jfzypowishadclxbueq

riydchjfnwqvtmbpsaloxe
dsbwfintzelormhvxcaqpyj
ejomaiyqsxcthfvpdlwbnr
lrycvtunboifgxawqemhpjd
xvtiafqrdwnoymclepbhj

jsydqempfvntrhui
miyefthpuqsrvnj
zsvyrmhbtuelpqinfja
nuphytvreqmfsji

cltvanwuh
tulachoyvwn
tuwclvanh

bixkgozashw
hakibzoswmx

poxkblmhqjftwsdcn
bhtykpvzjxuiengao

j
j
j

cqodguxrzles
loxqcrgeszudw
ocsdqruxglze
rugqoyxesdzlcf
ulzdorxgsqec

yvz
vyz

mfq
sztdnk
py

zawgmj
jawgz
gwapjz
sgzajw

ekoadscpwhg
jsuchbxmfyzlnwq

wlkrqcjux
xuqjclr
gjrqlcxu

afcosnhvprzblxtwd
abszvxoglnctfhpwr
bjhlvzfwceayksxtun
tzvnxrhwlmsfacbd

igreocyhquzjmvlx
liowjethfkqszvmxdyu

ljeqkvwpdazgocf
cqgdyvmjuwpeotainsr

mhoylsckuzxbiaevq
vyczxkjeoapsbifu
kxbdosyzavujiec

mwsfxbkjqazpiohgnyldc
xqgnadblfkwpcomshiy
wgvsalrhqbmieyxodpfnkc

eurqfmtkvjbosh
vyqrhkotfblmseu
brtfqkvoheums
rvtksmehoubqf
uwftdoarkmvqgehbcps

ctyalrqdxskjuoh
dlathrokujqxs
hxsqukdoaltjr
osrqkautljxdh

zfdlxtr
sburlzxd
zlrdx

ocfb
cbfo

uykhxqrtmnc
ahigrcuptnxdqmk

tckz
ktzc

vzgtxhkums
kvzmhtgus
sgthkzumv
vzxsgmkuht
znqmuhvkswgt

jtdwk
ydkti
kdt
dkjt

mwxehozbnqpad
ryjdeblzwxnpoucqahmtg

liumaz
izulam
zauloim
miludzaqr

rzkjguslxohwnfdivm
ofulwkhisgvjmnrxzd
dikwvojugxzfrmnlsh
sxjdzkcuworbnvgflmih
vlmxrzikndhwjofgus

fzqnodmx
a
v

lfoeh
leovfh
hofsle

djku
kjud
dukj

qtiwbxfhlzjnokvpadruymgse
onurjdisvgzwaqkybftlhpmex
fnmqwuhtyjrkepbgildovxasz
marndljbkegqxtupviscywfhzo
fdbqehtxkavjimzwporsugyln

aqkonbhvfdljigp
phaqrlkbjdin
phldcbkaumjvinq
iplbjxeykqhdazn

zsl
sz
xsyzh
zs

xdhlq
ndlkxjyu
xlde
xdl

blwmairvkofcuq
tedokrvbqm

pw
p

iqrbnglofs
grwuylifvkbq

yl
yl

xaizpuhlqo
kiloxm
ilkox

puaorhzmtvfg
mutoegrhzafv

lrzmpt
dpqyihnsa

jfiodcs
spi
swni
isn

ohdmyvlpbxjnqzfrswiuaeg
ceafhrujqtndivbxpwzsmg

mvoxyd
tvdoymx
xdymov

py
y

nutogsehiczykpmdvf
ngmueistpxkfodhvzrcy
yuhczioegpvmnfktsd

zp
z
zbc
z
z

creyt
uisfmova
er

dltugzhniyjro
lizndhrutojyg
jhgnzytuordli
lhgotuznirjydc

xtrckznswlueia
ivnwstaeulrkzjc
kcwaleiuznqrts
rkwiunqzatsecl

y
pqnae
ofm
fl
y

czoi
smvbnd
tzi

tzanvx
azgnjx
ingjzyuae
anrhzkq

eqhafrbmw
rjscmwxz
lrgnyfeukdvmiqwpt

tarsmxwveqdhjbk
xrajvebtdmwkh
taojykmefwbdzrxuvnp
wbdtmjrevakx
ctilgkbmaredjwvx

wp
p
p

zprwtogmdu
orwdmtzuxpg
omwputzdgr
umgrtpwozd
wgzdrtpmou

xtkjsm
ylqptfjmk

pzgyknr
kyorpngz
pnzykgra

rtsiypahgecuvj
rsudtcgjiheyvp
rpyehvtijcgsu
cyprhvestgjui
uvigershtyjpc

jlmhtfbsoq
gbtohjsqm
mbstojqh
mhkecsqtabjox

xrhinjamvo
hproxvnma
mzscorhnx

utwprfqjyhsvzaomcb
yesrijzcagmhbwoutvpnqk
porcxwmyutzajbhqsv
uvrcpyzsmhajowtqb
ycpwuzovatbsmjqhr

fbkgycqutlmw
wuybgqmlcfk
xycgbkqmulwf
bgcfwyuqklm

vntsimju
boegqz

edotgsi
dgoism
iogds
gdstio
sogdixz

fdi
ifd

rx
v
x

qibkwyvmtxargjldc
bykzitxevgrwsnqflcdjm

dborhtpxjsflciveyq
xbuijhdqafnsrvepozytcl
qhlopsdtebcjyfrixv
hlvdyqxtcroegfjbisp
ormifqdhyvxjpclebst

qtzumogwrclaiex
iburltzgexdocwapq
ixuwtoqlegnrzc
xizeklwrugtqhoj

iynjbsahtvfeurqkgd
rtnwjgeukyadicflq
deytfqknlpjuairgc

oy
to
po

wyj
q

vatgy
xegndfrv
smgv
sgzbacv

ifmepunrdszgh
mvgdesianluzpfrh
eypfughdnmszitr
nepugsfimzrdh
fzuiqesnjcdwoxmhkpbrg

goycuvjqnpix
ytwnigvcjq

bsiczfhkne
gwxp
ojdl
a
uvgm

kaxzjpmwutcqnv
isadmolbtrfugxyhcj

vxqhfryiakbn
txhqbavyknri

ptbqifxcwyjgordls
dbpvkeauyc

kovpawxf
ovwxkpfa
xbknwjpcoaftq
oxapvfkw

ybjvaftkzheqgiuposnmxc
ungfezmiskqvyjaphobxtc
yjqimsvbktaonpeucfzhgrx
nepvgsifuqytahxzmjkocb
qmaexzipshcvjkfyonutgb

u
u
u
u

tpgqyvjaedlkbhwr
nytwkpqlvmgrbehxjad

vsruxht
rdmb
rfb

khqyd
ycj

aidrbmzkxvt
yzvbkiorxamdt

mzwvhblrxtn
vqalzwcbrxjmtnd
wlvnrtxmzcbg

ow
ow
ewuob
wo

gl
mnacgl
lg
gul
kdflg

oqvd
qodvy
qdvo
qvoda

rd
fus
thoi

rtnz
tqagrnlb

wemlvjbhuqcfrtodkxzn
pjbtruvdmhowfznlxekq
eoyadnxbuktqshgwfmvzirlj

kumotnwel
lmezwoutkn
nuemkwlot
efnlduohmtkw

mhaubleozw
zwulbhmo
mhbzouwl
hmwulbzo

hvjpdoiswzbenma
ojndsepwhiq
dwsjnhiope
tsohjdpwien
joipwhesnd

edbhi
fisdhbe

r
v
v
v

ezlc
czei
azlcei
czie
eynczs

ngfuhekmzxvopy
twogyeknxvmhbjzpuf
zxpfnygeomukvh

ktxduimz
vtgmurjiqk
mtkbuia

uykwh
kuyhnw

dzjqnwbrouh
qfncpvszdeg
cydmlqnz
dzqtn

xga
hmxpdg
fnxgeu
nxeogu

nsxrgu
xngurs

jvmudzscnalhwktry
lrvucmjkwztsyna
wyruzcjxlbtemsknva
yzwvklpcqustojrmnai
zyjntswcuarkmvl

zq
qz
qz
qz
zqt

gbpnqrxu
dqnxyvwhbtgi
csqmbfjeaokxlz

rdtuqpxnbzj
yzsnpu
fcnrzpou
penzu
nvukhlmizwpag

tdvfgahbiw
gtbpsdo

ucdprxmznhbw
rcumdzpwnx
dxnpzrmcuw
drpxcmnzuw
zxwcnpmrdu

dhouqlfvsakg
uaofqkdsvhgl
uoalfhvqsgkd
klgvfudqosah
auhslqfkgvdo

qkwfimrogubyhljda
shuprevacxlndiqfjwy

crpsetajviwmqhl
szqdpfvimaekgbj

geyqpl
gzqlei
qleg

kcfipzjwyugsrtahboneqxdm
uwkcmtdfopayenqbshxi
eudhcyfpwamoxvkqlistnb

yfqbtnwuzsdl
lszfnquwbtyd
fsjznbdwytulq
bfgldzqyutwsn

n
uv

vjfzuhqgaypbmcd
hqmbpsjyugrvfzatndc
ovfazbdipqxeclykjgum
vmbzptjwydaguncfrq

k
w
k
k

eipruzqndlys
elrysidnzqu

pzlgeciqys
wjvrdxmunfsb

kdy
kd
kd
dlk
kd

yretjs
g
kahzubo
rjd
r

hlxpawm
xmyeltpqw
gmpxicbv
burmxc
ozxmsfjdn

dtskziwy
qxzycupgs

iflherjytpxg
thienjgrfxly
heyftrgjlix
igyfjurphtexl
gtyxrjleihf

nuswkhz
xosqihvwfrez
hgszyw

ukphojt
hotkpzju
htupjbko
mjpkouhd

luhsi
shliu
lihqsu

iqr
ybndlhzrgwtmkf
rxcuq

j
j
j
j

rwqsbyoe
fweujxcoliya
mpowrey

wvn
wv

frbuexwg
xmqgdwfeb

rbyjsiqxtfcvlup
vqpuyrifcsjxtlb
yvtqirslxpjfbcu
vsribxjcufylqpt

ikcvoguphqtyjdswzexa
ptjocgxiuhwavydsqzek
ipcuohvqdwyxsetkagjz
vpgdhzqckoywxaijuest

erhdoyugavcq
doqsvahugec
cnhezgfavbuixdo

lhgvknmequsctapxzbjdorf
fodnxkrlqthcubmzvpjaeg
fcvqmordxhklpybujgenatz
nlmbxvpcokearhdzjtqufg
uthcdpbvojlqewrknafgxzmi

hwjpevzgrtmoqknydfs
jvzstyfdhgkoqpmw

ncw
gwivun
wnl
nxw
najwbzdrke

ckyowhxblrt
flabyrdwctk
lbwripvjtykcs

pn
eonwtzp
yxsirvqhcm
fapu
njwb

lsjdymwpz
zmrhuajxvewysp

lyisuvcbdqxotkmh
bkmrldugxsycohqitv
xlhcvtmyqibdosuk
hscubvoelkyqdximt

mb
mjbf
rbm

zvqlg
gnlvjbz
zvdgl
dslgvzt
vczwgl

bem
yqpgj
dxflhwokatuvnzs
irqc
jqp

gqolch
hnozqgcl

dnhwl
hdo
fduc

lug
lug
gurkal
lgu
ulg

uahmzdyxbr
htkmwpcxbqy
cbhyxmp

ajv
mjt
j
ji

bfpygmtxajnk
kpnmfbxtgayj
pcynamktgbjxf
tfympjvqxgnkab

x
x
x
mxf
vqx

wlzsgdhixr
hgcoaiwpbluv
wyhlig
iwfnlhqgs
jfgqihmxwlr

cqrdbpoehiwfuzvgalxm
ularwipqxcfedozmbvg
vurqezjkoysgpalbfimxwcdt
mcvfzqplaxwrgoebiud

mydhxfvgzcleojiq
ixcozgyvjdfl
njxuwiaovpycslrzgdf

gfwtnr
mojdinwkf
rfnwqhcg
wfn

lwise
arl
trzbvl
bal

y
y
y
y

sayqdimthfrpjvgn
crdphnmayqbgf

sfgtqwbzej
pnmlcyitj

yvtng
tyn
nyutg
ytgenh
onpty

bleicngomsqhwfdy
mrbnfygxpiwucoldqshke
cqdeimynwhsfoblg
gqesldbcijmwhonfy
enblgcmfwdhyqois

ufmsgkbcxz
xfsckzmub
umbkoxzhrsvcnf
kzmcsbfxgu

tuiwqd
hbtdou

t
t
t
t
t

ureltqfji
ohzkrul

oievpqgs
sqdvopigle
easvqpkgio

upkr
urpk

wrbipknheldxjfm
rhjexfldkwpb
lhrpejxfwbdk

drybxszfetlnwjigk
fngbltzjywsroixk

hodteualp
dtrpuile

tqrbsjni
sbcirnqt
rsbaitqv
qbsrit
gbtsriq

ovjmetdznlw
dtjvlmonze
zdjntemolvw
mlouvjngzkdter

ckrnly
rclkyn
cyjlkrnh
crynkl
ylckrn

zjk
zkj
djkz
jzk
jzk

xoj
mjro
kjuxro
ybsjeahf

zhwvtialqegufxmrcj
hwljxrecaqmztgifv
vgibmzlxwrdeacfqhjt

nxicerwtzolfgky
hogmsvdplbweja

w
clq
i
gi

cilrkspgjqmw
xhvadtlyfjobnzue

ckytg
nqtyg
gyxbt
kygtc

fwcd
wfc
oebwhmil
fdwxr

lomdtfsihk
sfyitokldmh
dimyotfkls
iovdstlmkfj
smulideqtfok

frazxb
ahfbxz
bafzx
aftbxpz

ubdarimsqvgtlhfjze
eqfrvhsguzjamtidl

hjidpgrc
vrp
zpxwsulqrona
drhpftvi
kbrdhype

xidcskygjwmbzr
bsqexaypghjkv

tgxmy
atxym
txym

qjrbmxtluews
ulbrwtjsxqop
fzbksturwmxlqj
tbxvnsjqriuwcl

edhvzwqxojuplbkyf
wfphdjyczxvlkbqo
jhxbpkvyfzdloqw
yhmlfwoqkjpvdxbz
qfmxikhozbvwydplj

seyq
yogxm

jzbgatxhrplowqsyecvdn
nzjvohtguxpydsrlcewab

apzf
zanwg
pza
az

sapxfnyhbowujlcdveqiztkm
tzskjxqcoebdunyfphi

caruks
rhlwsv

cnswqfaztmdh
uxszromtanqdfb

cjnmstxqvdik
qmjdcksitxvn
cjktvxqmdnis
cjnrsqdkxptivm

oq
qaion
omq
qo

kzymeqtbasgn
cuktvbsorim
lpjxwhdf

knflw
ezvkn
yuhakrnc

vidhwxfrmnsyuct
rzumskdfeqx

p
p

duicxvgnbeopfzlqyrks
skdetoclpbmzqfghwixr
gfozcdskprxeaiqbml
plkhqcifedxbgosrz

ydtjolrxzefiaschwng
tdoerngfhzwxjcylia
zrawdytxhcojlgenfi

ghvjqlifws
sfiqklwjehrgv

q
q
s
a
s

et
tme

a
a
a
a
a

qng
g
wg

nvmlaui
audrigo
atnjdu
hybxcpszkwuq
fnu

zmngdceqikxyuapwv
ciwyqekgamdzvp
ikcpavfgbwmerqyz

mcvyjezqxrpkiu
wlfatnmghs

awkqenuiorcd
lkuowsracdtzqgei
joxhucpqrmfyvikawe

cdn
ndc

fybj
bjfy
byjucsf
flybjx

zfcphgxqno
zhmxyncpqr
iqhwaclzupsne

oscpyvdebfhz
pbonsjyrelkfxvz
wfpvyigbmaeztoqus

ypbfhaivmkx
xpjfhikyoca

wkzvxlebarsmcdpi
xidcbpswmazekr
zsxwidpmekacrb
pwczxsedakirbm

vfupqwdshxygkmrzol
wslmypfkogrxzqdvh
qwlxsrfzpgdomvyhk

cmkdiapszuyb
bkpyduimascz

vjpxmdzfwkuq
eycbgsnhltmapxo

xmnklfpugdewtj
okzerxjuihqcptdmysf

yajvhbtowixds
dvynabxjiwhs
asydoixzbh
ihjdxbasyk
lifxrbspedahyumcg

snragze
gmszrnae
egrazsn
ensragz

odi
odi
ido
odi

mvogdzfker
veongkrpzmdf
vgekmrzdfo
ombjdfqykergvz
hzsormkdgfve

l
l
l
ly

kgnpliuwmsebhjfrcyqxotvazd
mzqryvgsftauxpcknehbiwojld

vczkrabfmhpyjteui
merjtikybvaugz
aieydktjrmzvubg
yeslqoibauvtkmrjz

vi
vip
eigv
vix
iv

mcuknbexfowszpvtyi
ztmfwonvcsapqxyieb
etowynxzcpirmbvsf
wjfnyvopzetkmiusbcx

ywhqemsx
banksxwemy
ymsexw
smyewx
szxeywm

yvqtnsahzpwebgr
zgtjnevyapwbhrs
jzynhrpvwgsbat
obtynrfwslcahvzgpm
eytrpagzwsjvbkhn

ynwutpmvhj
mvwjpuyt
wupzyjvmt

kwnyatozcmdqbpsvejfrxug
vkzjaogfmqsxhnyctpu
cozypjmtvlxquakgfnsi

qrwtgecs
daley
emh

qmbjwe
qebfwjm
qewjm
qjiwem

dqc
tad
qdcs

zrvjnfpe
zpefunyvqc
fzpvern
pnefvz
envpfz

nduhkvstxqmbfyr
ufmhbtkqvxdnpy
hdntqxuvmbkfy

ot
o
yv
xp

evkrifstpzgbahl
vzkmdtchgseajyfub
bgtnkxvheoaqifsz

wxec
wfuie
awmj
ghsnkvwbqor
mcexwf

teosna
tnkb
ptm
t

r
na
ykx

jdl
mzjtp

xbpj
tzrkxba
xnbjmgosv
mhxbw

j
j
j
j

xn
lrvt
htg
mr

hafkb
fkab
afbk

zlyxomawvuib
vxwzbaymolui

tcdfzgx
ql
luo
uh

ixtbluahoeqgsv
eovsiglhuqanxtb

ntychjig
chyijtgn
hcnjtiyg
tgjnhiyc
tgjiychn

khomqatzscydwunfe
ygoazrdukh
zokbrlyaudjh

uojynifthzvcgqp
phnvryfbtucl

sbeizdtjopxu
nouqbeykmszd

cga
gca
cag

hiogxbslyptfc
pilwxcthogysb
holsibtcypfgx

oahyr
pkjro

qgfkj
gjzk
jgvk

kw
wk
kw
wk

bxvmnks
sfmbva

fsocn
ygfopn

wbarmxtfyjzenicvlhps
aefdirlyvzjpwtcmnh
rqymwfzjpevchiaotnl
lietnypmcrvhowfjaz
ztjcehympnavirlwf

gqsnyhtafdcbki
yncbhxiakgpqt

mikyzoxflndetbp
ebqdwiopkhyfxnl
jbscverlgfyauo

bkewpj
n
solnxmfr

ybxa
ybxa
xyba
byax
abxy

sgbo
sg

unvqlyhzdaxrcwg
dxvhaugicrzqnlw
mrplcqatdxzbuvgnwh
vzaurnhdgqlxwc
ucdwavqhylxrngz

frhdaek
fpuwosv

qm
m
smg


================================================
FILE: exm/aoc/2020/aoc_2020_06_full_ada.adb
================================================
--  Solution to Advent of Code 2020, Day 6
------------------------------------------
--  Custom Customs
--
--  https://adventofcode.com/2020/day/6
--
--  Full Ada version.
--
with Ada.Strings.Fixed, Ada.Text_IO;

procedure AoC_2020_06_Full_Ada is
  total : Integer;
  new_group : Boolean;
  subtype Answer_Range is Character range 'a' .. 'z';
  type Yes_Answer is array (Answer_Range) of Boolean;
  r, rg : Yes_Answer;
  --
  procedure Collect_Group_Total is
    g : Natural := 0;
  begin
    for c in Answer_Range loop if rg (c) then g := g + 1; end if; end loop;
    total := total + g;
    new_group := True;
  end Collect_Group_Total;
  --
  use Ada.Strings.Fixed, Ada.Text_IO;
  f : File_Type;
begin
  for part in 1 .. 2 loop
    Open (f, In_File, "aoc_2020_06.txt");
    total := 0;
    new_group := True;
    while not End_Of_File (f) loop
      declare
        s : constant String := Get_Line (f);
      begin
        if s = "" then
          Collect_Group_Total;
        else
          for c in Answer_Range loop
            r (c) := Index (s, (1 => c)) > 0;
          end loop;
          if new_group then
            rg := r;
            new_group := False;
          elsif part = 1 then
            rg := rg or r;
          else
            rg := rg and r;
          end if;
        end if;
      end;
    end loop;
    Collect_Group_Total;
    Put_Line ("Part" & Integer'Image (part) & ' ' & Integer'Image (total));
    Close (f);
  end loop;
end AoC_2020_06_Full_Ada;


================================================
FILE: exm/aoc/2020/aoc_2020_06_full_ada_using_hat.adb
================================================
--  Solution to Advent of Code 2020, Day 6
------------------------------------------
--  Custom Customs
--
--  https://adventofcode.com/2020/day/6
--
--  Full Ada version, using the HAT package.
--
with HAT; use HAT;  --  in ../../../src

procedure AoC_2020_06_Full_Ada_using_HAT is
  total : Integer;
  new_group : Boolean;
  subtype Answer_Range is Character range 'a' .. 'z';
  type Yes_Answer is array (Answer_Range) of Boolean;
  r, rg : Yes_Answer;
  --
  procedure Collect_Group_Total is
    g : Natural := 0;
  begin
    for c in Answer_Range loop if rg (c) then g := g + 1; end if; end loop;
    total := total + g;
    new_group := True;
  end Collect_Group_Total;
  --
  f : File_Type;
  s : VString;
begin
  for part in 1 .. 2 loop
    Open (f, "aoc_2020_06.txt");
    total := 0;
    new_group := True;
    while not End_Of_File (f) loop
      Get_Line (f, s);
      if s = "" then
        Collect_Group_Total;
      else
        for c in Answer_Range loop
          r (c) := Index (s, c) > 0;
        end loop;
        if new_group then
          rg := r;
          new_group := False;
        elsif part = 1 then
          rg := rg or r;
        else
          rg := rg and r;
        end if;
      end if;
    end loop;
    Collect_Group_Total;
    Put_Line (+"Part " & part & ".  Total customs answers: " & total);
    --  Part 1: officially validated by AoC: 6532
    --  Part 2: officially validated by AoC: 3427
    Close (f);
  end loop;
end AoC_2020_06_Full_Ada_using_HAT;


================================================
FILE: exm/aoc/2020/aoc_2020_07.adb
================================================
--  Solution to Advent of Code 2020, Day 7
------------------------------------------
--  Handy Haversacks
--
--  https://adventofcode.com/2020/day/7
--
--  HAC 0.081 "nice to have"'s detected in this exercise:
--    *     "=" for composite types ( ` rules (ri).contains (cti).col = c  `)
--
--  Solved in HAC 0.099:
--    *     I/O with enums, at least 'Image and 'Value.
--
with HAT; use HAT;  --  in ../../../src

procedure AoC_2020_07 is

  type Base_Colour is
    (aqua, beige, black, blue, bronze, brown, chartreuse, coral, crimson, cyan, fuchsia, gold,
     gray, green, indigo, lavender, lime, magenta, maroon, olive, orange, plum, purple, red,
     salmon, silver, tan, teal, tomato, turquoise, violet, white, yellow);

  type Colour_Qualifier is
    (bright, clear, dark, dim, dotted, drab, dull, faded, light,
     mirrored, muted, other, pale, plaid, posh, shiny, striped, vibrant, wavy);

  --  Emulate full Ada's Enumeration_IO's Get (ouch!) ...

  procedure Get_CQ (f : in out File_Type; cq : out Colour_Qualifier) is
    c : Character;
    s : VString;
  begin
    loop
      Get (f, c);
      exit when c < 'a' or c > 'z';
      s := s & c;
    end loop;
    cq := Colour_Qualifier'Value (To_String (s));
    --  We don't treat the invalid cases...
  end Get_CQ;

  procedure Get_BC (f : in out File_Type; bc : out Base_Colour) is
    c : Character;
    s : VString;
  begin
    loop
      Get (f, c);
      exit when c < 'a' or c > 'z';
      s := s & c;
    end loop;
    bc := Base_Colour'Value (To_String (s));
    --  We don't treat the invalid cases...
  end Get_BC;

  procedure Get_Nat (f : in out File_Type; n : out Natural) is
    c : Character;
  begin
    n := 0;
    Get (f, c);
    while c = ' ' loop  --  Skip heading blanks.
      Get (f, c);
    end loop;
    loop
      exit when c < '0' or c > '9';
      n := n * 10 + Ord (c) - Ord ('0');
      Get (f, c);
    end loop;
    --  Result 0 when invalid...
  end Get_Nat;

  type Colour is record
    cq : Colour_Qualifier;
    bc : Base_Colour;
  end record;

  type Contained_Spec is record
    col : Colour;
    num : Natural;
  end record;

  subtype Contains_Range is Integer range 1 .. 4;

  type Contains_List is array (Contains_Range) of Contained_Spec;

  type Rule is record
    container   : Colour;
    num_contain : Natural;
    contains    : Contains_List;
    can_contain : Boolean;  --  Used for marking container bag rule without double-counting.
  end record;

  subtype Rules_Range is Integer range 1 .. 1000;

  rules : array (Rules_Range) of Rule;  --  Cheap version of Vectors...
  rules_count : Natural := 0;

  details : constant Boolean := False;

  procedure Put_Colour (c : Colour) is
  begin
    Put (Colour_Qualifier'Image (c.cq)); Put ("~"); Put (Base_Colour'Image (c.bc));
  end Put_Colour;

  function Equal (c1, c2 : Colour) return Boolean is
  begin
    return c1.cq = c2.cq and c1.bc = c2.bc;
  end Equal;

  function Containing_Bags (c : Colour) return Natural is
    --
    procedure Scan_Containing_Bags (c : Colour) is
      is_top : Boolean := True;
    begin
      for ri in 1 .. rules_count loop
        for cti in 1 .. rules (ri).num_contain loop
          if Equal (rules (ri).contains (cti).col, c) then
            --  Colour c is contained in bag described by rule #ri.
            is_top := False;
            rules (ri).can_contain := True;
            if details then
              Put ("   container of "); Put_Colour (c);
              Put (" is "); Put_Colour (rules (ri).container); New_Line;
            end if;
            Scan_Containing_Bags (rules (ri).container);
          end if;
        end loop;
      end loop;
      if is_top and details then
        Put ("Top: "); Put_Colour (c); New_Line;
      end if;
    end Scan_Containing_Bags;
    --
    can_contain_count : Natural := 0;
  begin
    for ri in 1 .. rules_count loop
      rules (ri).can_contain := False;
    end loop;
    Scan_Containing_Bags (c);
    for ri in 1 .. rules_count loop
      if rules (ri).can_contain then
        can_contain_count := can_contain_count + 1;
      end if;
    end loop;
    return can_contain_count;
  end Containing_Bags;

  function Contained_Bags (c : Colour) return Natural is
    contained : Natural := 0;
  begin
    for ri in 1 .. rules_count loop
      if Equal (rules (ri).container, c) then
        if details then
          Put ("Container "); Put_Colour (c); New_Line;
        end if;
        for cti in 1 .. rules (ri).num_contain loop
          contained := contained +
            rules (ri).contains (cti).num * (1 + Contained_Bags (rules (ri).contains (cti).col));
        end loop;
        exit;
      end if;
    end loop;
    return contained;
  end Contained_Bags;

  procedure Get_Rules is
    f : File_Type;
    sep : Character;
    new_rule : Rule;
    new_spec : Contained_Spec;
  begin
    Open (f, "aoc_2020_07.txt");
    while not End_Of_File (f) loop
      Get_CQ (f, new_rule.container.cq);
      Get_BC (f, new_rule.container.bc);
      if details then
        Put_Colour (new_rule.container);
      end if;
      for i in 1 .. 13 loop Get (f, sep); end loop;  --  " bags contain"
      if details then
        Put (" bags contain: ");
      end if;
      new_rule.num_contain := 0;
      loop
        Get_Nat (f, new_spec.num);
        if new_spec.num = 0 then
          Skip_Line (f);
          exit;
        end if;
        Get_CQ (f, new_spec.col.cq);
        Get_BC (f, new_spec.col.bc);
        if details then
          Put (new_spec.num, 2);
          Put (" ");
          Put_Colour (new_spec.col);
          Put ("   ");
        end if;
        new_rule.num_contain := new_rule.num_contain + 1;
        new_rule.contains (new_rule.num_contain) := new_spec;
        loop
          Get (f, sep);
          exit when sep = ',' or sep = '.';
        end loop;
        exit when End_Of_Line (f);
      end loop;
      if details then
        New_Line;
      end if;
      rules_count := rules_count + 1;
      rules (rules_count) := new_rule;
    end loop;
    Close (f);
  end Get_Rules;
  --
  shiny_gold : Colour;
  test_mode : constant Boolean := Argument_Count >= 2;
begin
  shiny_gold.cq := shiny;
  shiny_gold.bc := gold;
  Get_Rules;
  if test_mode then
    if (Containing_Bags (shiny_gold) /= Integer_Value (Argument (1))) or
       (Contained_Bags (shiny_gold) /= Integer_Value (Argument (2)))
    then
      Set_Exit_Status (1);  --  Compiler test failed.
    end if;
  else
    Put_Line (+"Rules about bag contents: " & rules_count);
    Put_Line (+"Part 1: all possible direct or indirect containers of shiny gold: " &
                Containing_Bags (shiny_gold));
    Put_Line (+"Part 2: all bags contained by shiny gold: " &
                Contained_Bags (shiny_gold));
  end if;
  --  Rules: 594
  --  Part 1: all possible direct or indirect containers of shiny gold: 169
  --  Part 2: all bags contained by shiny gold: 82372
end AoC_2020_07;


================================================
FILE: exm/aoc/2020/aoc_2020_07.txt
================================================
wavy green bags contain 1 posh black bag, 1 faded green bag, 4 wavy red bags.
dotted chartreuse bags contain 1 light beige bag.
dark white bags contain 2 dotted white bags.
clear aqua bags contain 4 posh orange bags, 4 pale blue bags.
faded green bags contain 2 plaid orange bags, 4 drab green bags, 4 pale aqua bags, 4 drab coral bags.
drab lavender bags contain 2 shiny white bags, 2 muted orange bags, 1 mirrored crimson bag, 1 dotted aqua bag.
dull maroon bags contain 1 plaid plum bag, 5 plaid orange bags, 4 posh maroon bags.
pale lavender bags contain no other bags.
plaid cyan bags contain 2 posh violet bags, 5 dim turquoise bags, 2 dark tomato bags.
dull plum bags contain 5 muted red bags, 4 dotted salmon bags, 1 dull maroon bag.
bright turquoise bags contain 2 dotted chartreuse bags, 3 dull tan bags, 4 light gray bags, 3 mirrored red bags.
posh violet bags contain no other bags.
faded coral bags contain 1 wavy teal bag, 4 wavy cyan bags.
striped turquoise bags contain 3 bright gray bags, 4 bright bronze bags.
muted magenta bags contain 5 light teal bags.
dull lavender bags contain 3 clear orange bags, 3 pale cyan bags, 4 vibrant orange bags, 1 dim chartreuse bag.
pale silver bags contain 3 faded olive bags.
dull turquoise bags contain 4 light gray bags, 4 clear green bags, 2 dull aqua bags, 5 dim white bags.
dim cyan bags contain 4 pale cyan bags, 2 dotted beige bags, 4 drab lime bags, 2 muted silver bags.
wavy plum bags contain 2 drab bronze bags, 3 mirrored yellow bags, 3 vibrant beige bags.
drab lime bags contain 5 muted plum bags.
striped yellow bags contain 3 dark fuchsia bags, 1 clear lime bag, 5 faded turquoise bags.
shiny cyan bags contain 4 clear maroon bags, 1 dim yellow bag, 5 drab red bags.
bright maroon bags contain 2 shiny gray bags, 2 faded indigo bags, 5 muted tan bags.
striped crimson bags contain 5 posh brown bags.
pale green bags contain 1 pale red bag.
shiny blue bags contain 2 clear red bags, 2 dark black bags, 3 dotted silver bags.
mirrored lime bags contain 2 drab violet bags.
mirrored maroon bags contain 4 faded salmon bags, 2 shiny blue bags, 1 pale coral bag.
light bronze bags contain 2 clear red bags, 3 posh lavender bags, 1 clear purple bag, 5 plaid lavender bags.
bright salmon bags contain 2 faded cyan bags, 1 striped blue bag, 1 faded crimson bag.
faded red bags contain 4 dotted purple bags, 1 bright brown bag, 1 pale tan bag, 1 drab teal bag.
pale indigo bags contain 3 pale orange bags, 5 muted bronze bags, 2 pale tan bags, 3 posh fuchsia bags.
pale orange bags contain 2 dotted magenta bags, 5 clear plum bags, 3 dim olive bags, 1 mirrored yellow bag.
drab gold bags contain 4 dotted cyan bags, 4 muted plum bags, 1 vibrant white bag, 4 dull green bags.
mirrored teal bags contain 5 posh turquoise bags, 4 striped purple bags, 5 mirrored blue bags.
dark chartreuse bags contain 1 striped crimson bag, 3 dull purple bags.
posh olive bags contain 2 clear brown bags, 1 faded lavender bag.
muted tan bags contain 1 striped red bag.
drab olive bags contain 2 dim plum bags, 4 mirrored violet bags.
faded lime bags contain 3 dark tomato bags.
dim black bags contain 2 wavy purple bags, 5 mirrored fuchsia bags, 5 drab beige bags.
dotted plum bags contain 2 shiny gold bags, 4 shiny beige bags, 1 clear red bag.
striped red bags contain 5 pale tan bags, 5 pale lavender bags.
drab green bags contain 1 faded silver bag, 3 vibrant plum bags, 2 wavy purple bags, 1 plaid blue bag.
dull orange bags contain no other bags.
posh tomato bags contain 5 dim gold bags, 2 drab coral bags, 4 drab maroon bags, 2 pale indigo bags.
light turquoise bags contain 2 shiny violet bags, 1 dull violet bag.
muted salmon bags contain 2 mirrored teal bags, 1 mirrored bronze bag.
bright red bags contain 1 dotted orange bag, 2 faded gray bags, 2 dim white bags, 4 plaid tomato bags.
dotted tan bags contain 3 clear red bags, 5 pale coral bags, 3 clear turquoise bags, 2 muted beige bags.
muted gold bags contain 2 drab turquoise bags.
pale magenta bags contain 3 dotted cyan bags, 4 mirrored lime bags, 2 shiny cyan bags.
pale brown bags contain 2 dull silver bags, 3 wavy tomato bags.
shiny lime bags contain 1 mirrored gold bag, 5 dull magenta bags, 5 shiny fuchsia bags.
dark bronze bags contain 2 light green bags.
light magenta bags contain 4 pale crimson bags, 3 drab plum bags.
dark gray bags contain 5 light maroon bags.
plaid orange bags contain 5 plaid gray bags, 1 dark tomato bag, 2 drab chartreuse bags, 4 clear red bags.
posh purple bags contain 2 posh blue bags.
drab turquoise bags contain 3 clear brown bags, 2 mirrored red bags, 2 muted green bags.
dark fuchsia bags contain 4 light orange bags.
dim lime bags contain 1 dotted olive bag, 5 posh blue bags, 3 dim gold bags, 2 drab lime bags.
drab tan bags contain 4 clear violet bags.
posh fuchsia bags contain 5 drab black bags, 4 plaid purple bags, 3 dim white bags.
clear orange bags contain 5 muted tomato bags, 1 dotted white bag, 5 bright fuchsia bags.
posh crimson bags contain 1 mirrored chartreuse bag, 4 pale gray bags.
plaid tan bags contain 1 light orange bag.
posh brown bags contain 1 clear lavender bag, 4 clear yellow bags.
mirrored salmon bags contain 2 dotted plum bags, 5 plaid lavender bags, 4 drab olive bags, 5 shiny violet bags.
striped bronze bags contain 5 light blue bags.
dotted black bags contain 4 plaid coral bags, 2 drab maroon bags, 4 dotted red bags.
light gray bags contain 3 posh magenta bags, 5 wavy coral bags, 2 vibrant red bags, 2 wavy olive bags.
pale turquoise bags contain 2 light olive bags, 1 dark silver bag, 5 plaid yellow bags.
striped fuchsia bags contain 3 wavy aqua bags.
light teal bags contain 5 dotted turquoise bags, 5 muted tomato bags, 1 dotted gray bag, 1 pale lavender bag.
wavy beige bags contain 5 dim gray bags, 4 bright aqua bags.
light salmon bags contain 2 clear plum bags.
shiny magenta bags contain 4 dim fuchsia bags.
clear white bags contain 4 dim white bags.
wavy gray bags contain 1 vibrant beige bag.
plaid bronze bags contain 5 plaid plum bags, 3 drab olive bags, 2 drab green bags.
drab plum bags contain 5 drab chartreuse bags, 5 plaid purple bags, 2 drab teal bags, 1 drab coral bag.
dotted salmon bags contain 4 dim fuchsia bags, 4 striped cyan bags, 3 dotted white bags, 4 mirrored violet bags.
striped magenta bags contain 1 faded teal bag, 1 drab red bag.
posh magenta bags contain 4 faded green bags, 2 dull magenta bags.
striped lavender bags contain 1 striped black bag, 4 wavy turquoise bags, 5 dull purple bags, 4 posh violet bags.
mirrored lavender bags contain 1 wavy turquoise bag.
dim violet bags contain 3 muted green bags, 1 striped plum bag, 4 dull coral bags, 4 wavy chartreuse bags.
shiny tomato bags contain 3 bright red bags, 5 wavy beige bags, 5 faded blue bags, 3 muted black bags.
wavy indigo bags contain 2 dull brown bags.
dark tomato bags contain 2 drab olive bags.
vibrant red bags contain 1 plaid tomato bag, 1 muted tomato bag.
vibrant brown bags contain 4 shiny violet bags, 2 mirrored violet bags, 2 dark salmon bags, 5 faded turquoise bags.
dim lavender bags contain 4 dim plum bags, 5 drab maroon bags, 3 dark black bags.
dull lime bags contain 5 bright turquoise bags, 3 vibrant chartreuse bags, 1 pale gray bag.
muted plum bags contain 4 plaid plum bags, 3 dim beige bags, 5 wavy magenta bags.
wavy tan bags contain 3 wavy chartreuse bags, 5 clear orange bags, 2 light blue bags, 2 pale yellow bags.
dim maroon bags contain 2 dull yellow bags, 4 shiny orange bags.
clear violet bags contain 2 clear red bags, 1 plaid blue bag.
dim orange bags contain 4 posh red bags, 3 posh plum bags.
plaid crimson bags contain 5 posh brown bags, 4 vibrant indigo bags, 5 drab teal bags, 1 dotted gray bag.
clear yellow bags contain 1 plaid gray bag.
dotted fuchsia bags contain 2 plaid plum bags, 1 drab chartreuse bag.
dim brown bags contain 1 faded silver bag, 1 faded brown bag, 2 striped cyan bags.
striped aqua bags contain 2 faded purple bags.
striped gold bags contain 3 dotted lime bags.
bright yellow bags contain 2 drab bronze bags, 2 dotted gray bags.
wavy blue bags contain 5 drab olive bags.
wavy turquoise bags contain 3 dotted indigo bags, 2 vibrant plum bags.
dotted purple bags contain 4 light blue bags, 4 wavy gray bags, 5 pale lavender bags.
mirrored gold bags contain 5 wavy silver bags, 3 clear white bags.
dull purple bags contain 3 dim fuchsia bags, 3 clear indigo bags, 4 dotted purple bags.
bright gold bags contain 5 shiny silver bags, 5 dark olive bags, 2 muted yellow bags, 3 vibrant magenta bags.
faded gray bags contain 3 dotted magenta bags, 5 clear lavender bags, 2 faded tomato bags.
dark olive bags contain 1 drab tan bag, 2 striped crimson bags.
light silver bags contain 3 dark teal bags, 4 posh crimson bags, 2 wavy olive bags, 2 dotted fuchsia bags.
light yellow bags contain 3 wavy silver bags.
dotted teal bags contain 3 vibrant orange bags, 2 clear maroon bags.
drab coral bags contain 5 mirrored violet bags.
dim salmon bags contain 4 faded silver bags, 2 plaid cyan bags.
dotted coral bags contain 3 faded gray bags.
vibrant bronze bags contain 4 faded tomato bags, 3 light brown bags, 5 posh lavender bags.
light blue bags contain 3 clear brown bags, 3 posh violet bags, 3 bright brown bags.
plaid fuchsia bags contain 4 striped white bags, 1 mirrored cyan bag.
plaid indigo bags contain 5 bright cyan bags.
dull magenta bags contain 5 muted tomato bags, 4 plaid tomato bags, 1 faded silver bag.
shiny orange bags contain 3 dark coral bags.
wavy white bags contain 2 striped indigo bags, 1 faded orange bag, 2 dull fuchsia bags, 2 vibrant silver bags.
dotted bronze bags contain 5 shiny fuchsia bags, 5 dotted aqua bags, 1 faded aqua bag.
light chartreuse bags contain 3 dull chartreuse bags.
dull salmon bags contain 2 vibrant plum bags.
clear bronze bags contain 1 shiny tomato bag.
faded lavender bags contain 5 pale lavender bags, 2 dull maroon bags, 3 drab beige bags.
dark black bags contain 2 dim fuchsia bags, 3 plaid tomato bags, 3 dull orange bags.
dull violet bags contain 1 striped red bag.
mirrored indigo bags contain 3 mirrored violet bags, 4 faded plum bags, 1 pale tan bag, 2 dotted white bags.
shiny crimson bags contain 2 dim purple bags, 2 dotted purple bags, 2 bright bronze bags.
plaid aqua bags contain 1 plaid tan bag, 1 mirrored orange bag.
drab beige bags contain 1 dull yellow bag.
clear purple bags contain 1 vibrant cyan bag, 2 dim brown bags, 1 dark lavender bag.
dim olive bags contain 5 light blue bags, 1 dull gold bag, 5 faded red bags, 1 dotted purple bag.
mirrored green bags contain 4 wavy beige bags.
dotted silver bags contain 5 wavy fuchsia bags.
dotted blue bags contain 5 pale blue bags.
pale crimson bags contain 1 dim tan bag.
plaid gold bags contain 5 wavy magenta bags, 2 dotted gray bags.
dim crimson bags contain 4 dark lavender bags.
pale tomato bags contain 3 muted red bags, 1 clear lavender bag, 1 clear orange bag, 3 pale red bags.
drab fuchsia bags contain 3 faded red bags, 1 muted silver bag, 2 drab aqua bags.
pale maroon bags contain 5 vibrant lime bags, 1 light crimson bag, 1 posh white bag.
wavy lavender bags contain 3 muted red bags, 2 posh violet bags.
vibrant salmon bags contain 1 dark beige bag.
dark blue bags contain 5 dim brown bags, 3 dark red bags, 1 light fuchsia bag, 5 shiny gold bags.
dark plum bags contain 1 muted aqua bag.
drab crimson bags contain 2 drab turquoise bags, 3 shiny violet bags.
vibrant tomato bags contain 1 light tomato bag, 5 vibrant gold bags.
drab maroon bags contain 2 faded tomato bags, 5 clear olive bags, 3 plaid gray bags.
clear green bags contain 5 striped lavender bags, 4 dim gray bags.
plaid green bags contain 2 shiny blue bags, 1 drab fuchsia bag, 5 dotted black bags, 1 dim plum bag.
mirrored yellow bags contain 2 mirrored violet bags, 5 clear brown bags.
dull aqua bags contain 2 faded tomato bags.
shiny olive bags contain 4 light teal bags, 2 bright white bags.
plaid lime bags contain 3 drab red bags, 2 light crimson bags.
dull green bags contain 5 drab green bags, 4 dotted red bags, 4 shiny olive bags, 4 plaid plum bags.
dull beige bags contain 2 faded tan bags.
light indigo bags contain 3 dotted white bags.
shiny silver bags contain 3 vibrant cyan bags, 1 dim teal bag, 1 striped beige bag, 5 wavy chartreuse bags.
plaid yellow bags contain 3 light beige bags.
striped orange bags contain 1 dotted maroon bag, 5 bright red bags, 3 shiny red bags.
posh indigo bags contain 2 dotted bronze bags.
drab orange bags contain 1 striped crimson bag, 3 dark yellow bags, 3 light turquoise bags, 3 light silver bags.
mirrored chartreuse bags contain 2 dotted magenta bags.
plaid silver bags contain 5 wavy aqua bags, 3 vibrant plum bags, 1 dark black bag.
striped indigo bags contain 2 dotted salmon bags, 1 vibrant beige bag, 1 wavy cyan bag, 5 striped salmon bags.
muted coral bags contain 5 vibrant brown bags, 4 light fuchsia bags.
shiny brown bags contain 2 vibrant violet bags, 3 drab gray bags.
shiny indigo bags contain 5 muted bronze bags.
striped cyan bags contain 3 dim fuchsia bags, 3 dark coral bags, 1 faded red bag, 5 plaid brown bags.
shiny tan bags contain 5 plaid white bags.
clear gold bags contain 3 plaid purple bags, 4 striped black bags, 5 dim turquoise bags, 1 plaid plum bag.
vibrant violet bags contain 2 posh violet bags, 2 pale tomato bags.
muted olive bags contain 2 dark tomato bags.
mirrored tomato bags contain 5 pale black bags.
clear crimson bags contain 1 dim crimson bag, 5 striped blue bags.
drab blue bags contain 1 bright indigo bag.
drab teal bags contain 1 plaid brown bag.
striped brown bags contain 4 dotted orange bags, 4 wavy blue bags.
posh lavender bags contain 4 bright indigo bags, 4 faded bronze bags.
light fuchsia bags contain 1 shiny crimson bag, 2 clear brown bags, 2 striped crimson bags.
dotted violet bags contain 4 dull crimson bags.
vibrant lavender bags contain 2 faded olive bags, 5 shiny tomato bags.
wavy gold bags contain 5 dotted black bags, 2 drab beige bags, 3 dull gold bags.
faded brown bags contain 1 wavy gray bag, 3 plaid teal bags.
bright purple bags contain 1 faded tomato bag.
shiny plum bags contain 2 dim silver bags.
posh beige bags contain 3 bright crimson bags.
posh coral bags contain 4 light chartreuse bags, 5 drab bronze bags, 2 striped aqua bags.
shiny black bags contain 2 posh black bags, 5 clear white bags.
posh white bags contain 1 plaid violet bag.
vibrant chartreuse bags contain 5 clear aqua bags, 4 dotted magenta bags.
faded olive bags contain 2 mirrored fuchsia bags, 5 plaid brown bags.
drab purple bags contain 1 dim olive bag, 5 drab lime bags.
dull yellow bags contain 2 dark coral bags, 3 clear brown bags.
vibrant turquoise bags contain 5 plaid orange bags.
wavy tomato bags contain 3 faded olive bags, 3 bright white bags, 5 dull gray bags.
pale plum bags contain 4 pale coral bags, 4 bright cyan bags, 3 dim brown bags.
faded indigo bags contain 1 clear beige bag, 2 vibrant beige bags.
shiny violet bags contain 4 shiny tomato bags, 2 striped lavender bags.
mirrored purple bags contain 5 dotted red bags, 1 mirrored fuchsia bag, 2 mirrored yellow bags.
faded cyan bags contain 4 drab red bags, 5 wavy purple bags, 2 dim beige bags, 5 faded red bags.
shiny salmon bags contain 5 muted tomato bags, 5 striped olive bags.
clear maroon bags contain 1 dotted magenta bag.
faded black bags contain 5 wavy fuchsia bags, 2 dim olive bags, 1 dark lavender bag.
posh green bags contain 3 mirrored coral bags, 2 drab aqua bags, 4 wavy orange bags.
faded crimson bags contain 1 mirrored cyan bag, 2 dim gray bags, 5 light blue bags, 5 posh maroon bags.
striped tomato bags contain 4 drab lime bags, 2 wavy teal bags, 4 plaid cyan bags, 2 muted fuchsia bags.
light olive bags contain 2 dotted red bags, 2 pale coral bags.
faded gold bags contain 4 shiny green bags, 1 clear beige bag, 2 wavy brown bags, 2 dull tomato bags.
pale bronze bags contain 1 dim lime bag.
dotted gray bags contain 5 mirrored yellow bags.
dark beige bags contain 4 clear turquoise bags, 3 vibrant plum bags, 5 drab maroon bags, 5 clear red bags.
drab magenta bags contain 1 drab maroon bag, 1 clear magenta bag.
vibrant beige bags contain 3 bright fuchsia bags, 1 dull gold bag.
dark teal bags contain 5 clear turquoise bags, 5 dark maroon bags, 4 dotted magenta bags, 3 shiny crimson bags.
mirrored blue bags contain 5 dark black bags, 5 vibrant brown bags, 5 dark aqua bags.
wavy cyan bags contain 4 clear aqua bags, 4 dark aqua bags.
dark turquoise bags contain 1 striped gold bag.
drab silver bags contain 3 plaid bronze bags.
faded beige bags contain 5 wavy cyan bags, 3 dull white bags, 5 dim purple bags, 4 faded brown bags.
faded purple bags contain 3 light white bags, 4 faded brown bags, 4 posh maroon bags.
dotted magenta bags contain 3 posh violet bags.
muted green bags contain 2 dim gray bags, 1 vibrant indigo bag, 4 dotted indigo bags.
bright beige bags contain 1 wavy teal bag, 4 bright cyan bags, 1 clear green bag, 1 posh brown bag.
bright violet bags contain 2 plaid indigo bags.
dim purple bags contain 1 posh maroon bag, 2 drab beige bags, 5 clear brown bags.
clear magenta bags contain 4 pale white bags, 5 dotted chartreuse bags, 2 bright turquoise bags, 4 mirrored red bags.
faded magenta bags contain 1 dull gray bag.
mirrored white bags contain 4 dotted purple bags, 2 plaid purple bags, 2 pale tan bags.
clear salmon bags contain 2 mirrored lavender bags.
light maroon bags contain 1 plaid tomato bag, 5 pale aqua bags.
vibrant tan bags contain 3 bright coral bags, 4 striped turquoise bags, 3 wavy aqua bags, 2 shiny gold bags.
shiny lavender bags contain 2 drab tomato bags, 1 drab plum bag.
dark crimson bags contain 2 pale purple bags, 2 dotted white bags, 3 shiny orange bags, 1 dotted bronze bag.
faded aqua bags contain 3 wavy purple bags.
striped blue bags contain 3 plaid bronze bags, 1 clear yellow bag, 2 clear white bags, 3 wavy teal bags.
mirrored silver bags contain 5 striped salmon bags, 4 drab blue bags, 1 vibrant green bag, 1 muted cyan bag.
drab white bags contain 2 wavy salmon bags.
dull brown bags contain 5 pale plum bags, 3 plaid tomato bags.
bright cyan bags contain 2 clear lavender bags.
faded chartreuse bags contain 4 wavy aqua bags, 5 plaid orange bags, 5 dotted indigo bags, 4 clear yellow bags.
dotted tomato bags contain 4 muted purple bags, 4 dotted black bags.
dim white bags contain 5 mirrored cyan bags, 2 dim fuchsia bags, 2 dark tomato bags, 1 dotted purple bag.
posh orange bags contain 5 drab olive bags, 5 vibrant beige bags.
light coral bags contain 5 light purple bags, 2 wavy tomato bags.
wavy lime bags contain 4 clear brown bags.
mirrored magenta bags contain 2 faded silver bags, 2 dark coral bags.
wavy coral bags contain 4 dull purple bags, 1 dark white bag, 4 posh orange bags.
vibrant gray bags contain 5 dotted aqua bags, 2 dark salmon bags, 2 bright blue bags, 1 dotted white bag.
mirrored olive bags contain 3 dark coral bags, 3 wavy gray bags.
light gold bags contain 2 striped lime bags, 2 dark orange bags.
light cyan bags contain 2 dim turquoise bags, 3 dotted tan bags, 4 shiny crimson bags.
shiny gray bags contain 5 plaid cyan bags, 1 wavy purple bag.
bright plum bags contain 3 muted tomato bags, 1 dim chartreuse bag, 3 dotted indigo bags, 4 shiny olive bags.
vibrant blue bags contain 2 shiny orange bags.
clear lavender bags contain 5 faded red bags, 2 wavy gray bags.
dim yellow bags contain 2 drab aqua bags, 3 dim lavender bags, 1 bright plum bag.
posh gray bags contain 3 light lavender bags.
dull tan bags contain 1 dim gold bag, 2 bright bronze bags, 5 dim plum bags.
plaid brown bags contain 3 dull orange bags, 3 dim plum bags.
muted purple bags contain 5 dark black bags, 1 vibrant lime bag.
shiny coral bags contain 4 dim green bags, 4 dim maroon bags, 2 dim chartreuse bags.
pale gold bags contain 2 dim beige bags.
dim beige bags contain 2 mirrored yellow bags, 5 clear brown bags.
dull chartreuse bags contain 2 faded red bags, 5 posh maroon bags, 5 clear lavender bags.
muted bronze bags contain 5 dim plum bags.
vibrant coral bags contain 1 faded black bag, 3 light green bags, 1 wavy chartreuse bag.
clear turquoise bags contain 2 shiny beige bags, 5 mirrored fuchsia bags.
wavy silver bags contain 5 dim tan bags.
muted red bags contain 4 dull gold bags, 1 plaid brown bag, 1 wavy gray bag.
light tan bags contain 4 dotted yellow bags, 1 dull maroon bag, 1 light beige bag.
bright tomato bags contain 1 muted beige bag.
striped coral bags contain 3 bright coral bags.
dotted lime bags contain 2 dull salmon bags.
mirrored plum bags contain 1 bright fuchsia bag, 1 drab yellow bag, 2 dark plum bags, 2 posh purple bags.
plaid blue bags contain 5 dull gold bags, 4 wavy gray bags, 5 mirrored violet bags.
plaid salmon bags contain 4 dim salmon bags, 1 dotted lavender bag.
clear chartreuse bags contain 5 muted teal bags, 4 clear gold bags, 2 plaid tomato bags.
muted blue bags contain 3 faded tomato bags, 5 striped chartreuse bags.
dim tan bags contain 4 clear lavender bags, 2 clear violet bags, 1 wavy plum bag, 4 pale gold bags.
bright chartreuse bags contain 2 posh silver bags, 1 vibrant plum bag.
plaid white bags contain 1 striped red bag, 3 dim beige bags, 3 plaid bronze bags, 2 dim turquoise bags.
bright coral bags contain 3 shiny gold bags, 2 striped chartreuse bags, 4 light salmon bags, 2 vibrant aqua bags.
clear indigo bags contain 4 posh orange bags, 4 dull gold bags.
bright aqua bags contain 1 shiny orange bag.
faded bronze bags contain 2 pale gray bags, 3 dull gold bags.
shiny green bags contain 1 drab chartreuse bag, 4 light salmon bags, 4 striped gold bags.
drab black bags contain 4 dark black bags, 1 dotted turquoise bag, 3 wavy gray bags, 3 shiny fuchsia bags.
pale yellow bags contain 2 dim green bags, 3 vibrant aqua bags.
dull indigo bags contain 2 striped aqua bags, 4 clear chartreuse bags, 4 dark orange bags, 3 posh magenta bags.
mirrored cyan bags contain 2 dotted purple bags, 5 mirrored violet bags, 2 dotted white bags, 3 bright brown bags.
dark yellow bags contain 4 faded tan bags, 3 dim turquoise bags, 5 muted fuchsia bags, 5 clear salmon bags.
wavy yellow bags contain 2 dim bronze bags, 4 drab bronze bags.
muted white bags contain 1 dotted black bag, 5 bright plum bags, 1 striped cyan bag, 2 clear turquoise bags.
dotted gold bags contain 3 shiny fuchsia bags, 5 muted tan bags, 2 clear fuchsia bags.
light aqua bags contain 5 faded brown bags, 3 pale blue bags, 2 mirrored green bags.
plaid violet bags contain 3 bright yellow bags.
bright silver bags contain 1 drab violet bag, 4 light teal bags.
wavy red bags contain 3 dotted gray bags, 5 drab fuchsia bags, 1 posh blue bag.
mirrored tan bags contain 5 light green bags, 2 plaid gray bags, 4 pale orange bags, 1 shiny violet bag.
muted tomato bags contain 1 wavy purple bag.
faded blue bags contain 3 shiny crimson bags, 1 clear indigo bag.
shiny purple bags contain 5 clear blue bags, 1 vibrant red bag.
posh aqua bags contain 4 striped olive bags, 3 pale maroon bags, 1 dim yellow bag, 1 clear red bag.
striped white bags contain 1 bright cyan bag, 3 dotted orange bags.
striped lime bags contain 1 striped brown bag, 3 dotted chartreuse bags, 3 wavy fuchsia bags, 4 faded magenta bags.
striped tan bags contain 1 pale gray bag, 1 light indigo bag, 2 dark coral bags.
shiny red bags contain 4 dotted gray bags, 1 drab bronze bag, 4 shiny fuchsia bags.
shiny beige bags contain 3 vibrant beige bags, 2 vibrant indigo bags, 3 plaid blue bags.
dim fuchsia bags contain 5 pale tan bags.
plaid tomato bags contain 4 clear red bags.
dull blue bags contain 4 pale turquoise bags.
dull red bags contain 5 posh brown bags, 2 dotted tomato bags, 2 striped gold bags.
pale red bags contain 3 plaid brown bags.
striped maroon bags contain 3 pale cyan bags, 1 dotted cyan bag, 1 dim tomato bag.
light lime bags contain 3 light cyan bags, 4 light olive bags, 4 bright salmon bags, 3 shiny orange bags.
drab brown bags contain 3 dim tomato bags, 2 dark gray bags.
faded yellow bags contain 3 dotted beige bags, 2 muted blue bags, 2 wavy fuchsia bags, 1 dark magenta bag.
bright green bags contain 2 pale cyan bags, 5 plaid bronze bags, 5 wavy orange bags.
wavy bronze bags contain 3 wavy red bags.
dull gold bags contain no other bags.
plaid olive bags contain 4 muted white bags, 4 plaid red bags, 5 wavy red bags, 3 posh indigo bags.
dotted aqua bags contain 3 dim indigo bags, 3 drab coral bags.
pale purple bags contain 1 dotted magenta bag, 3 clear indigo bags, 1 dim turquoise bag, 3 pale blue bags.
faded teal bags contain 3 drab maroon bags, 3 clear tan bags, 1 pale gray bag, 4 bright tomato bags.
drab chartreuse bags contain 2 drab aqua bags, 4 clear indigo bags.
light lavender bags contain 4 faded bronze bags, 1 plaid chartreuse bag.
dim tomato bags contain 2 dull orange bags, 5 shiny cyan bags, 2 muted purple bags, 2 dotted black bags.
faded maroon bags contain 2 faded white bags, 3 dim maroon bags.
pale cyan bags contain 2 plaid brown bags.
muted indigo bags contain 4 mirrored red bags, 1 dotted indigo bag, 4 mirrored maroon bags.
wavy orange bags contain 3 plaid bronze bags.
dull teal bags contain 5 drab red bags, 4 dim green bags, 3 dotted olive bags, 5 pale maroon bags.
dull gray bags contain 5 dark tomato bags, 4 dull magenta bags, 4 dotted red bags, 5 faded brown bags.
vibrant gold bags contain 3 striped beige bags, 5 clear bronze bags.
posh bronze bags contain 3 pale turquoise bags, 4 posh blue bags.
striped plum bags contain 3 pale orange bags, 5 clear tomato bags, 1 light salmon bag.
shiny chartreuse bags contain 4 dim yellow bags, 4 mirrored yellow bags, 2 clear orange bags, 2 bright red bags.
vibrant yellow bags contain 4 clear yellow bags, 2 vibrant olive bags, 5 drab salmon bags, 5 light tomato bags.
dark coral bags contain 1 pale tan bag, 3 dull orange bags, 4 clear brown bags.
dotted cyan bags contain 5 faded aqua bags, 2 dotted lime bags, 1 dim gray bag.
light purple bags contain 5 dotted indigo bags, 2 pale violet bags.
bright bronze bags contain 1 dim turquoise bag.
wavy brown bags contain 5 dotted silver bags.
plaid black bags contain 1 clear magenta bag, 2 faded plum bags.
posh cyan bags contain 5 muted beige bags, 1 clear brown bag, 3 wavy beige bags.
dotted green bags contain 4 faded lavender bags, 2 muted blue bags.
vibrant orange bags contain 1 dark aqua bag.
dark violet bags contain 1 striped fuchsia bag.
dark green bags contain 2 dark white bags, 3 vibrant chartreuse bags, 3 mirrored maroon bags.
shiny aqua bags contain 2 light salmon bags, 5 pale turquoise bags, 1 pale silver bag.
mirrored gray bags contain 2 dim salmon bags, 4 striped chartreuse bags, 5 dull gray bags, 2 bright white bags.
bright black bags contain 1 dark aqua bag, 5 dark red bags, 4 faded tomato bags.
dark purple bags contain 3 striped brown bags.
vibrant plum bags contain 5 dim fuchsia bags, 1 posh orange bag, 1 dotted purple bag, 1 light blue bag.
pale gray bags contain 1 plaid cyan bag, 2 dim white bags, 1 dotted magenta bag, 4 shiny gold bags.
striped green bags contain 2 pale crimson bags, 3 dotted lime bags, 5 posh turquoise bags.
shiny bronze bags contain 5 dark olive bags, 2 vibrant magenta bags, 4 striped silver bags.
muted fuchsia bags contain 5 drab fuchsia bags.
bright olive bags contain 4 pale blue bags, 5 shiny crimson bags.
posh lime bags contain 1 dim plum bag, 3 dim magenta bags, 1 mirrored tomato bag, 2 light lavender bags.
light crimson bags contain 3 clear turquoise bags, 5 dim brown bags, 3 bright cyan bags, 4 plaid tomato bags.
dull silver bags contain 5 wavy silver bags.
clear coral bags contain 5 muted aqua bags.
pale salmon bags contain 3 dark gold bags, 5 wavy orange bags.
pale lime bags contain 3 dim cyan bags, 4 striped turquoise bags, 2 muted aqua bags.
wavy fuchsia bags contain 2 drab beige bags, 1 faded olive bag, 1 dim beige bag, 3 pale orange bags.
clear blue bags contain 1 pale black bag, 2 plaid fuchsia bags, 2 mirrored chartreuse bags, 2 bright brown bags.
muted teal bags contain 5 pale black bags.
muted orange bags contain 4 dim olive bags.
dotted indigo bags contain 3 drab lime bags.
drab yellow bags contain 1 dim beige bag.
muted brown bags contain 2 striped red bags, 4 muted green bags, 3 drab chartreuse bags, 4 dark aqua bags.
posh red bags contain 1 wavy beige bag, 1 wavy tomato bag, 1 faded bronze bag, 1 clear coral bag.
posh gold bags contain 1 dim chartreuse bag, 1 clear lavender bag, 1 bright fuchsia bag, 3 bright magenta bags.
posh salmon bags contain 5 plaid red bags, 1 dim purple bag, 1 bright yellow bag.
wavy black bags contain 5 faded white bags, 3 faded chartreuse bags.
mirrored crimson bags contain 2 plaid gray bags, 2 vibrant tomato bags, 1 dim bronze bag.
light white bags contain 4 dim turquoise bags.
pale violet bags contain 5 dim beige bags.
dim magenta bags contain 4 striped teal bags.
striped teal bags contain 5 drab lime bags, 5 mirrored yellow bags.
dotted brown bags contain 4 shiny gold bags, 3 wavy brown bags, 4 clear brown bags, 1 clear teal bag.
bright orange bags contain 2 plaid violet bags, 3 posh aqua bags, 1 clear tan bag.
shiny gold bags contain 3 dotted magenta bags, 2 shiny beige bags, 3 plaid brown bags, 5 clear indigo bags.
clear olive bags contain 4 drab red bags.
plaid purple bags contain 3 plaid gray bags, 3 dim olive bags, 4 dotted purple bags.
pale teal bags contain 4 wavy cyan bags, 4 posh bronze bags.
muted cyan bags contain 2 light blue bags, 3 shiny purple bags, 3 dotted white bags.
plaid chartreuse bags contain 4 clear lime bags, 4 pale red bags.
wavy crimson bags contain 1 pale gray bag, 3 striped tan bags, 5 muted purple bags.
bright tan bags contain 1 posh purple bag, 1 light chartreuse bag, 3 dark white bags.
dark lavender bags contain 1 dotted beige bag, 2 dark tomato bags.
plaid coral bags contain 5 dotted red bags, 1 dim white bag.
faded plum bags contain no other bags.
dark indigo bags contain 4 drab beige bags, 5 clear red bags, 5 pale red bags, 4 pale blue bags.
striped gray bags contain 5 drab teal bags, 4 muted red bags.
light red bags contain 2 light gray bags, 3 vibrant aqua bags, 1 dotted aqua bag.
clear tan bags contain 5 dull gold bags, 3 dim gray bags, 3 dim white bags, 2 light green bags.
pale aqua bags contain 5 dotted purple bags, 1 drab lime bag, 2 clear orange bags.
vibrant fuchsia bags contain 5 clear turquoise bags, 3 clear red bags, 5 faded green bags.
clear lime bags contain 3 striped red bags, 1 dull maroon bag.
muted gray bags contain 4 muted yellow bags, 4 dotted silver bags, 4 clear orange bags, 5 faded turquoise bags.
dull fuchsia bags contain 1 dark aqua bag.
wavy purple bags contain 4 drab teal bags, 3 light blue bags, 3 mirrored violet bags.
vibrant teal bags contain 2 striped white bags, 4 dull red bags, 3 plaid chartreuse bags, 5 dotted salmon bags.
dotted lavender bags contain 4 dim purple bags, 4 clear orange bags, 4 vibrant beige bags.
clear gray bags contain 4 dotted tan bags, 1 dull gold bag, 4 dull gray bags.
wavy violet bags contain 3 bright blue bags, 3 shiny purple bags, 2 bright fuchsia bags.
dull cyan bags contain 4 clear green bags.
dim blue bags contain 1 light brown bag, 3 faded indigo bags.
bright magenta bags contain 1 dim brown bag, 4 wavy purple bags, 3 dotted red bags.
dark cyan bags contain 4 vibrant maroon bags, 2 wavy salmon bags.
vibrant magenta bags contain 4 plaid orange bags, 1 faded red bag.
bright gray bags contain 5 dotted magenta bags, 3 clear olive bags, 1 bright fuchsia bag, 2 muted silver bags.
wavy maroon bags contain 5 mirrored violet bags, 4 clear orange bags, 5 drab olive bags.
dotted maroon bags contain 5 pale purple bags, 5 faded silver bags, 5 dotted lime bags.
drab indigo bags contain 5 light chartreuse bags.
dark brown bags contain 4 bright red bags.
bright blue bags contain 2 shiny cyan bags.
bright brown bags contain 5 dark coral bags, 5 dim fuchsia bags.
dotted orange bags contain 5 bright fuchsia bags, 2 dull gold bags.
mirrored red bags contain 4 dotted salmon bags, 3 dark red bags, 3 drab teal bags, 4 pale blue bags.
plaid red bags contain 2 light maroon bags, 3 drab tomato bags.
drab violet bags contain 2 vibrant cyan bags.
vibrant olive bags contain 1 clear maroon bag, 3 clear green bags, 5 drab aqua bags.
plaid plum bags contain 3 vibrant plum bags.
dim coral bags contain 2 dull aqua bags, 3 vibrant tan bags, 5 muted fuchsia bags, 1 plaid silver bag.
vibrant green bags contain 4 pale gray bags, 4 posh fuchsia bags, 3 bright lime bags, 5 faded blue bags.
muted beige bags contain 5 drab fuchsia bags.
vibrant maroon bags contain 1 faded aqua bag.
muted yellow bags contain 3 clear maroon bags, 2 striped crimson bags, 4 mirrored maroon bags, 3 vibrant olive bags.
faded salmon bags contain 4 faded olive bags, 1 muted purple bag, 3 dotted yellow bags, 3 dim silver bags.
pale beige bags contain 3 mirrored tan bags.
plaid lavender bags contain 2 bright magenta bags, 4 bright indigo bags, 1 posh tomato bag.
drab aqua bags contain 4 wavy magenta bags, 3 mirrored olive bags, 1 muted tomato bag, 3 posh orange bags.
bright indigo bags contain 3 pale violet bags, 3 dark lavender bags, 4 muted plum bags, 3 striped crimson bags.
clear black bags contain 4 wavy aqua bags, 3 light yellow bags.
drab gray bags contain 1 muted aqua bag, 3 plaid fuchsia bags.
striped beige bags contain 1 vibrant blue bag, 5 dotted tomato bags.
faded orange bags contain 2 mirrored maroon bags.
dark orange bags contain 1 muted maroon bag, 5 drab indigo bags.
mirrored coral bags contain 3 faded aqua bags, 2 drab lime bags.
dim red bags contain 5 muted fuchsia bags.
dark aqua bags contain 3 shiny gold bags, 4 pale blue bags, 3 dull magenta bags.
dim gold bags contain 1 plaid blue bag, 1 posh fuchsia bag.
striped black bags contain 2 shiny gold bags.
shiny turquoise bags contain 4 pale purple bags, 5 faded blue bags.
dim chartreuse bags contain 2 pale coral bags.
drab red bags contain 5 mirrored olive bags, 5 vibrant beige bags.
posh chartreuse bags contain 3 pale violet bags, 3 muted beige bags.
light black bags contain 3 mirrored maroon bags, 5 dull tan bags, 5 posh crimson bags, 3 dark gray bags.
vibrant aqua bags contain 2 plaid coral bags.
pale olive bags contain 5 wavy lavender bags, 2 posh olive bags, 4 dim black bags, 3 drab cyan bags.
mirrored aqua bags contain 3 mirrored violet bags.
muted lime bags contain 4 mirrored cyan bags, 1 drab turquoise bag, 5 wavy fuchsia bags.
dull coral bags contain 4 muted lime bags, 4 dim white bags.
faded tomato bags contain 3 pale violet bags, 4 faded brown bags.
mirrored fuchsia bags contain 3 dotted purple bags, 4 pale lavender bags.
plaid magenta bags contain 3 light plum bags, 3 striped orange bags.
clear teal bags contain 4 plaid blue bags.
faded fuchsia bags contain 1 dull purple bag, 2 bright brown bags.
mirrored brown bags contain 4 faded bronze bags, 5 faded beige bags.
muted silver bags contain 2 dull gold bags, 4 clear orange bags, 2 dotted purple bags, 5 dim olive bags.
dull bronze bags contain 4 shiny cyan bags, 1 posh cyan bag.
dark silver bags contain 1 shiny olive bag, 2 drab aqua bags, 2 striped fuchsia bags, 4 mirrored tan bags.
bright white bags contain 4 dark aqua bags, 5 plaid tomato bags, 5 drab green bags, 4 muted red bags.
dark gold bags contain 2 dim teal bags, 4 shiny fuchsia bags.
dull olive bags contain 5 mirrored orange bags, 3 drab gray bags, 1 shiny turquoise bag, 5 dull cyan bags.
wavy olive bags contain 1 wavy cyan bag.
dotted white bags contain no other bags.
plaid gray bags contain 3 dim beige bags, 2 dotted magenta bags, 5 vibrant indigo bags.
dim bronze bags contain 5 dark aqua bags.
dotted yellow bags contain 2 wavy blue bags.
muted lavender bags contain 2 faded aqua bags.
dim teal bags contain 5 pale gold bags.
posh teal bags contain 1 muted plum bag, 5 clear tomato bags, 1 clear white bag.
faded turquoise bags contain 1 wavy teal bag, 1 plaid red bag.
vibrant lime bags contain 4 vibrant beige bags, 5 drab lime bags.
clear plum bags contain 1 vibrant beige bag.
mirrored black bags contain 5 wavy white bags.
mirrored orange bags contain 1 wavy turquoise bag.
vibrant purple bags contain 2 faded crimson bags, 2 dull red bags, 3 plaid blue bags.
posh maroon bags contain 5 clear orange bags, 5 vibrant indigo bags, 2 drab lime bags, 5 posh orange bags.
plaid maroon bags contain 2 pale silver bags, 5 dotted salmon bags, 1 dotted plum bag, 3 bright olive bags.
posh blue bags contain 1 dark coral bag, 2 vibrant lime bags, 4 pale orange bags, 1 plaid blue bag.
muted black bags contain 2 dim gold bags.
clear red bags contain 5 pale lavender bags, 1 bright brown bag, 5 muted red bags, 4 dull orange bags.
plaid teal bags contain 1 dark coral bag, 3 dull orange bags.
light tomato bags contain 4 dotted white bags, 1 pale blue bag, 1 dull coral bag.
mirrored turquoise bags contain 1 shiny green bag, 1 wavy plum bag, 1 dull orange bag.
pale coral bags contain 2 shiny fuchsia bags, 1 dull gold bag, 5 dim plum bags, 5 dark black bags.
muted aqua bags contain 5 posh maroon bags, 4 dim gray bags, 3 pale aqua bags, 1 light crimson bag.
shiny yellow bags contain 2 faded plum bags.
faded tan bags contain 2 dark maroon bags.
clear fuchsia bags contain 4 light white bags, 5 posh maroon bags.
light brown bags contain 4 dim olive bags, 5 drab chartreuse bags, 5 posh maroon bags, 3 pale violet bags.
muted maroon bags contain 2 wavy silver bags.
wavy aqua bags contain 4 pale purple bags.
mirrored beige bags contain 4 posh brown bags.
drab salmon bags contain 3 striped red bags, 1 dull gray bag, 3 posh white bags.
dotted crimson bags contain 2 light teal bags, 4 bright black bags, 3 drab teal bags.
muted violet bags contain 3 bright coral bags.
dim green bags contain 1 drab violet bag, 5 dotted beige bags.
striped salmon bags contain 4 dull chartreuse bags, 2 dark indigo bags.
dull black bags contain 3 dotted silver bags.
shiny maroon bags contain 3 vibrant lavender bags, 3 clear lavender bags, 4 dull teal bags, 5 wavy maroon bags.
faded white bags contain 1 plaid silver bag, 3 pale gold bags.
light orange bags contain 3 pale red bags, 3 dull purple bags, 3 bright cyan bags, 4 dim lavender bags.
posh plum bags contain 1 clear silver bag, 2 clear maroon bags.
vibrant indigo bags contain 3 pale lavender bags, 5 dotted purple bags, 5 dotted white bags, 2 wavy magenta bags.
dotted beige bags contain 3 muted tomato bags, 3 clear brown bags, 1 plaid gray bag, 2 faded olive bags.
dim plum bags contain no other bags.
pale white bags contain 3 vibrant beige bags.
wavy salmon bags contain 1 dim black bag, 4 faded gray bags, 5 dim maroon bags.
pale chartreuse bags contain 5 mirrored white bags, 4 posh teal bags, 2 muted plum bags.
pale tan bags contain no other bags.
vibrant black bags contain 4 vibrant tan bags.
mirrored bronze bags contain 5 pale aqua bags, 2 wavy olive bags, 1 posh olive bag.
bright teal bags contain 2 dark lavender bags, 5 muted fuchsia bags.
striped silver bags contain 5 dull cyan bags, 5 striped teal bags, 2 posh blue bags.
shiny white bags contain 3 shiny violet bags, 3 dotted cyan bags, 3 dotted purple bags.
dark salmon bags contain 5 dotted lime bags, 1 pale orange bag, 1 vibrant red bag, 5 wavy purple bags.
vibrant crimson bags contain 4 clear red bags, 4 faded gray bags.
pale blue bags contain 5 striped cyan bags.
drab bronze bags contain 1 drab teal bag.
wavy magenta bags contain 4 vibrant beige bags, 4 bright fuchsia bags, 1 mirrored yellow bag, 4 dim fuchsia bags.
faded violet bags contain 4 wavy gray bags.
drab cyan bags contain 1 light gray bag, 5 plaid bronze bags, 5 dull aqua bags, 2 vibrant gray bags.
dotted turquoise bags contain 2 mirrored indigo bags, 4 plaid plum bags, 4 faded red bags, 3 dim gray bags.
dotted olive bags contain 4 vibrant beige bags.
posh turquoise bags contain 1 light fuchsia bag, 5 plaid red bags, 5 bright coral bags.
dull tomato bags contain 5 light blue bags, 2 plaid plum bags, 3 dotted lime bags.
pale fuchsia bags contain 3 drab orange bags, 4 bright lime bags, 3 pale tan bags.
drab tomato bags contain 2 posh magenta bags, 3 vibrant fuchsia bags, 3 dim fuchsia bags.
vibrant silver bags contain 1 posh turquoise bag.
pale black bags contain 3 dark coral bags, 3 dim plum bags, 4 shiny beige bags.
wavy chartreuse bags contain 3 drab violet bags, 1 vibrant orange bag, 2 dim gray bags.
dull crimson bags contain 3 mirrored plum bags, 2 dotted orange bags, 3 faded brown bags.
clear beige bags contain 4 wavy tomato bags, 1 muted lavender bag, 5 bright magenta bags, 3 dotted indigo bags.
shiny teal bags contain 3 drab red bags.
bright lavender bags contain 4 drab fuchsia bags, 4 vibrant olive bags, 2 clear olive bags.
posh tan bags contain 5 drab crimson bags, 5 bright la
Download .txt
gitextract_y017oy4y/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── LICENSE
├── build.cmd
├── debug.pra
├── demo/
│   ├── data_exchange/
│   │   ├── exchange_common.ads
│   │   ├── exchange_hac_side.adb
│   │   ├── exchange_native_side.adb
│   │   ├── exchange_native_side_pkg.adb
│   │   └── exchange_native_side_pkg.ads
│   ├── data_exchange_simple/
│   │   ├── exchange_hac_side_simple.adb
│   │   ├── exchange_native_side_pkg_simple.adb
│   │   ├── exchange_native_side_pkg_simple.ads
│   │   └── exchange_native_side_simple.adb
│   ├── hac_demo.gpr
│   └── hac_demo.prj
├── doc/
│   ├── archeology/
│   │   └── smallada_doc.txt
│   ├── hac.txt
│   └── hac_work.xls
├── exm/
│   ├── ackermann.adb
│   ├── anti_primes.adb
│   ├── aoc/
│   │   ├── 2020/
│   │   │   ├── aoc_2020.gpr
│   │   │   ├── aoc_2020.prj
│   │   │   ├── aoc_2020_02.adb
│   │   │   ├── aoc_2020_02.txt
│   │   │   ├── aoc_2020_03.adb
│   │   │   ├── aoc_2020_03.txt
│   │   │   ├── aoc_2020_04.adb
│   │   │   ├── aoc_2020_04.txt
│   │   │   ├── aoc_2020_04_b_full_ada.adb
│   │   │   ├── aoc_2020_05.adb
│   │   │   ├── aoc_2020_05.txt
│   │   │   ├── aoc_2020_06.adb
│   │   │   ├── aoc_2020_06.txt
│   │   │   ├── aoc_2020_06_full_ada.adb
│   │   │   ├── aoc_2020_06_full_ada_using_hat.adb
│   │   │   ├── aoc_2020_07.adb
│   │   │   ├── aoc_2020_07.txt
│   │   │   ├── aoc_2020_07_full_ada.adb
│   │   │   ├── aoc_2020_07_full_ada_vectors_2x.adb
│   │   │   ├── aoc_2020_08.adb
│   │   │   ├── aoc_2020_08.txt
│   │   │   ├── aoc_2020_09.adb
│   │   │   ├── aoc_2020_09.txt
│   │   │   ├── aoc_2020_10.adb
│   │   │   ├── aoc_2020_10.txt
│   │   │   ├── aoc_2020_11.adb
│   │   │   ├── aoc_2020_11.txt
│   │   │   ├── aoc_2020_11_full_ada.adb
│   │   │   ├── aoc_2020_11_mini.txt
│   │   │   ├── aoc_2020_12.adb
│   │   │   ├── aoc_2020_12.txt
│   │   │   ├── aoc_2020_13.adb
│   │   │   ├── aoc_2020_13.txt
│   │   │   ├── aoc_2020_14.txt
│   │   │   ├── aoc_2020_14_exm_1.txt
│   │   │   ├── aoc_2020_14_exm_2.txt
│   │   │   ├── aoc_2020_14_full_ada.adb
│   │   │   ├── aoc_2020_14_jc.txt
│   │   │   ├── aoc_2020_15.adb
│   │   │   ├── aoc_2020_15_full_ada.adb
│   │   │   ├── aoc_2020_15_full_ada_hashed_maps.adb
│   │   │   ├── aoc_2020_16.adb
│   │   │   ├── aoc_2020_16.txt
│   │   │   ├── aoc_2020_17.adb
│   │   │   ├── aoc_2020_17.txt
│   │   │   ├── aoc_2020_18.txt
│   │   │   ├── aoc_2020_18_full_ada.adb
│   │   │   ├── aoc_2020_18_weird_formulas.adb
│   │   │   ├── aoc_2020_18_weird_formulas.ads
│   │   │   ├── aoc_2020_19.txt
│   │   │   ├── aoc_2020_19_full_ada.adb
│   │   │   ├── aoc_2020_20.adb
│   │   │   ├── aoc_2020_20.txt
│   │   │   ├── aoc_2020_21.txt
│   │   │   ├── aoc_2020_21_full_ada.adb
│   │   │   ├── aoc_2020_21_full_ada_preproc.adb
│   │   │   ├── aoc_2020_22.adb
│   │   │   ├── aoc_2020_22.txt
│   │   │   ├── aoc_2020_22_full_ada.adb
│   │   │   ├── aoc_2020_23.adb
│   │   │   ├── aoc_2020_23_simple_array.adb
│   │   │   ├── aoc_2020_24.adb
│   │   │   ├── aoc_2020_24.txt
│   │   │   └── aoc_2020_25.adb
│   │   ├── 2021/
│   │   │   ├── aoc_2021.gpr
│   │   │   ├── aoc_2021_01.adb
│   │   │   ├── aoc_2021_01.txt
│   │   │   ├── aoc_2021_01_questions.txt
│   │   │   ├── aoc_2021_02.adb
│   │   │   ├── aoc_2021_02.txt
│   │   │   ├── aoc_2021_02_questions.txt
│   │   │   ├── aoc_2021_03.adb
│   │   │   ├── aoc_2021_03.txt
│   │   │   ├── aoc_2021_03_questions.txt
│   │   │   ├── aoc_2021_04.adb
│   │   │   ├── aoc_2021_04.txt
│   │   │   ├── aoc_2021_04_questions.txt
│   │   │   ├── aoc_2021_05.adb
│   │   │   ├── aoc_2021_05.txt
│   │   │   ├── aoc_2021_05_questions.txt
│   │   │   ├── aoc_2021_06.adb
│   │   │   ├── aoc_2021_06.txt
│   │   │   ├── aoc_2021_06_questions.txt
│   │   │   ├── aoc_2021_07.adb
│   │   │   ├── aoc_2021_07.txt
│   │   │   ├── aoc_2021_07_questions.txt
│   │   │   ├── aoc_2021_08.adb
│   │   │   ├── aoc_2021_08.txt
│   │   │   ├── aoc_2021_08_questions.txt
│   │   │   ├── aoc_2021_09.adb
│   │   │   ├── aoc_2021_09.txt
│   │   │   ├── aoc_2021_09_questions.txt
│   │   │   ├── aoc_2021_10.adb
│   │   │   ├── aoc_2021_10.txt
│   │   │   ├── aoc_2021_10_questions.txt
│   │   │   ├── aoc_2021_11.adb
│   │   │   ├── aoc_2021_11.txt
│   │   │   ├── aoc_2021_11_questions.txt
│   │   │   ├── aoc_2021_12.adb
│   │   │   ├── aoc_2021_12.txt
│   │   │   ├── aoc_2021_12_questions.txt
│   │   │   ├── aoc_2021_13.adb
│   │   │   ├── aoc_2021_13.txt
│   │   │   ├── aoc_2021_13_questions.txt
│   │   │   ├── aoc_2021_14.adb
│   │   │   ├── aoc_2021_14.txt
│   │   │   ├── aoc_2021_14_questions.txt
│   │   │   ├── aoc_2021_15.adb
│   │   │   ├── aoc_2021_15.txt
│   │   │   ├── aoc_2021_15_questions.txt
│   │   │   ├── aoc_2021_16.adb
│   │   │   ├── aoc_2021_16.txt
│   │   │   ├── aoc_2021_16_questions.txt
│   │   │   ├── aoc_2021_17.adb
│   │   │   ├── aoc_2021_17_questions.txt
│   │   │   ├── aoc_2021_18.txt
│   │   │   ├── aoc_2021_18_full_ada.adb
│   │   │   ├── aoc_2021_18_questions.txt
│   │   │   ├── aoc_2021_19.adb
│   │   │   ├── aoc_2021_19.txt
│   │   │   ├── aoc_2021_19_questions.txt
│   │   │   ├── aoc_2021_20.adb
│   │   │   ├── aoc_2021_20.txt
│   │   │   ├── aoc_2021_20_questions.txt
│   │   │   ├── aoc_2021_21.adb
│   │   │   ├── aoc_2021_21_questions.txt
│   │   │   ├── aoc_2021_22.adb
│   │   │   ├── aoc_2021_22.txt
│   │   │   └── aoc_2021_22_questions.txt
│   │   ├── 2022/
│   │   │   ├── aoc_2022.gpr
│   │   │   ├── aoc_2022_01.adb
│   │   │   ├── aoc_2022_01.txt
│   │   │   ├── aoc_2022_01_questions.txt
│   │   │   ├── aoc_2022_02.adb
│   │   │   ├── aoc_2022_02.txt
│   │   │   ├── aoc_2022_02_questions.txt
│   │   │   ├── aoc_2022_03.adb
│   │   │   ├── aoc_2022_03.txt
│   │   │   ├── aoc_2022_03_questions.txt
│   │   │   ├── aoc_2022_04.adb
│   │   │   ├── aoc_2022_04.txt
│   │   │   ├── aoc_2022_04_questions.txt
│   │   │   ├── aoc_2022_05.adb
│   │   │   ├── aoc_2022_05.txt
│   │   │   ├── aoc_2022_05_questions.txt
│   │   │   ├── aoc_2022_06.adb
│   │   │   ├── aoc_2022_06.txt
│   │   │   ├── aoc_2022_06_questions.txt
│   │   │   ├── aoc_2022_07.adb
│   │   │   ├── aoc_2022_07.txt
│   │   │   ├── aoc_2022_07_questions.txt
│   │   │   ├── aoc_2022_08.adb
│   │   │   ├── aoc_2022_08.txt
│   │   │   ├── aoc_2022_08_questions.txt
│   │   │   ├── aoc_2022_09.adb
│   │   │   ├── aoc_2022_09.txt
│   │   │   ├── aoc_2022_09_questions.txt
│   │   │   ├── aoc_2022_10.adb
│   │   │   ├── aoc_2022_10.txt
│   │   │   ├── aoc_2022_10_questions.txt
│   │   │   ├── aoc_2022_11.adb
│   │   │   ├── aoc_2022_11.txt
│   │   │   ├── aoc_2022_11_questions.txt
│   │   │   ├── aoc_2022_12.adb
│   │   │   ├── aoc_2022_12.txt
│   │   │   ├── aoc_2022_12_questions.txt
│   │   │   ├── aoc_2022_13.adb
│   │   │   ├── aoc_2022_13.txt
│   │   │   ├── aoc_2022_13_questions.txt
│   │   │   ├── aoc_2022_14.adb
│   │   │   ├── aoc_2022_14.txt
│   │   │   ├── aoc_2022_14_questions.txt
│   │   │   ├── aoc_2022_15.adb
│   │   │   ├── aoc_2022_15.txt
│   │   │   ├── aoc_2022_15_questions.txt
│   │   │   ├── aoc_2022_16.adb
│   │   │   ├── aoc_2022_16.txt
│   │   │   ├── aoc_2022_16_questions.txt
│   │   │   ├── aoc_2022_17.adb
│   │   │   ├── aoc_2022_17.txt
│   │   │   ├── aoc_2022_17_questions.txt
│   │   │   ├── aoc_2022_18.adb
│   │   │   ├── aoc_2022_18.txt
│   │   │   ├── aoc_2022_18_questions.txt
│   │   │   ├── aoc_2022_19.adb
│   │   │   ├── aoc_2022_19_full_ada.adb
│   │   │   ├── aoc_2022_19_questions.txt
│   │   │   ├── aoc_2022_20.adb
│   │   │   ├── aoc_2022_20.txt
│   │   │   ├── aoc_2022_20_questions.txt
│   │   │   ├── aoc_2022_21.adb
│   │   │   ├── aoc_2022_21_pkg.adb
│   │   │   ├── aoc_2022_21_pkg.ads
│   │   │   ├── aoc_2022_21_questions.txt
│   │   │   ├── aoc_2022_22.adb
│   │   │   ├── aoc_2022_22.txt
│   │   │   ├── aoc_2022_22_questions.txt
│   │   │   ├── aoc_2022_23.adb
│   │   │   ├── aoc_2022_23.txt
│   │   │   ├── aoc_2022_23_questions.txt
│   │   │   ├── aoc_2022_24.adb
│   │   │   ├── aoc_2022_24.txt
│   │   │   ├── aoc_2022_24_questions.txt
│   │   │   ├── aoc_2022_25.adb
│   │   │   ├── aoc_2022_25.txt
│   │   │   ├── aoc_2022_25_question.txt
│   │   │   ├── aoc_2022_xx.adb
│   │   │   └── gen_jumbo_day_1.adb
│   │   ├── 2023/
│   │   │   ├── aoc_2023.gpr
│   │   │   ├── aoc_2023_01.adb
│   │   │   ├── aoc_2023_01.txt
│   │   │   ├── aoc_2023_01_questions.txt
│   │   │   ├── aoc_2023_02.adb
│   │   │   ├── aoc_2023_02.txt
│   │   │   ├── aoc_2023_02_questions.txt
│   │   │   ├── aoc_2023_03.adb
│   │   │   ├── aoc_2023_03.txt
│   │   │   ├── aoc_2023_03_questions.txt
│   │   │   ├── aoc_2023_04.adb
│   │   │   ├── aoc_2023_04.txt
│   │   │   ├── aoc_2023_04_questions.txt
│   │   │   ├── aoc_2023_05.adb
│   │   │   ├── aoc_2023_05.txt
│   │   │   ├── aoc_2023_05_questions.txt
│   │   │   ├── aoc_2023_06.adb
│   │   │   ├── aoc_2023_06_questions.txt
│   │   │   ├── aoc_2023_07.adb
│   │   │   ├── aoc_2023_07.txt
│   │   │   ├── aoc_2023_07_questions.txt
│   │   │   ├── aoc_2023_08.adb
│   │   │   ├── aoc_2023_08.txt
│   │   │   ├── aoc_2023_08_questions.txt
│   │   │   ├── aoc_2023_09.adb
│   │   │   ├── aoc_2023_09.txt
│   │   │   ├── aoc_2023_09_questions.txt
│   │   │   ├── aoc_2023_10.adb
│   │   │   ├── aoc_2023_10.txt
│   │   │   ├── aoc_2023_10_questions.txt
│   │   │   ├── aoc_2023_11.adb
│   │   │   ├── aoc_2023_11.txt
│   │   │   ├── aoc_2023_11_questions.txt
│   │   │   ├── aoc_2023_12.adb
│   │   │   ├── aoc_2023_12.txt
│   │   │   ├── aoc_2023_12_questions.txt
│   │   │   ├── aoc_2023_13.adb
│   │   │   ├── aoc_2023_13.txt
│   │   │   ├── aoc_2023_13_questions.txt
│   │   │   ├── aoc_2023_14.adb
│   │   │   ├── aoc_2023_14.txt
│   │   │   ├── aoc_2023_14_questions.txt
│   │   │   ├── aoc_2023_15.adb
│   │   │   ├── aoc_2023_15.txt
│   │   │   ├── aoc_2023_15_questions.txt
│   │   │   ├── aoc_2023_16.adb
│   │   │   ├── aoc_2023_16.txt
│   │   │   ├── aoc_2023_16_questions.txt
│   │   │   ├── aoc_2023_17.adb
│   │   │   ├── aoc_2023_17.txt
│   │   │   ├── aoc_2023_17_questions.txt
│   │   │   ├── aoc_2023_18.adb
│   │   │   ├── aoc_2023_18.txt
│   │   │   ├── aoc_2023_18_questions.txt
│   │   │   ├── aoc_2023_19.adb
│   │   │   ├── aoc_2023_19.txt
│   │   │   ├── aoc_2023_19_questions.txt
│   │   │   ├── aoc_2023_20.adb
│   │   │   ├── aoc_2023_20.txt
│   │   │   ├── aoc_2023_20_questions.txt
│   │   │   ├── aoc_2023_21.adb
│   │   │   ├── aoc_2023_21.txt
│   │   │   ├── aoc_2023_21_questions.txt
│   │   │   ├── aoc_2023_22.adb
│   │   │   ├── aoc_2023_22.txt
│   │   │   ├── aoc_2023_22_questions.txt
│   │   │   ├── aoc_2023_23.adb
│   │   │   ├── aoc_2023_23.txt
│   │   │   ├── aoc_2023_23_questions.txt
│   │   │   ├── aoc_2023_24.adb
│   │   │   ├── aoc_2023_24.txt
│   │   │   ├── aoc_2023_24_questions.txt
│   │   │   ├── aoc_2023_25.adb
│   │   │   ├── aoc_2023_25.txt
│   │   │   └── aoc_2023_25_questions.txt
│   │   ├── 2024/
│   │   │   ├── aoc_2024.gpr
│   │   │   ├── aoc_2024_01.adb
│   │   │   ├── aoc_2024_01.txt
│   │   │   ├── aoc_2024_01_questions.txt
│   │   │   ├── aoc_2024_02.adb
│   │   │   ├── aoc_2024_02.txt
│   │   │   ├── aoc_2024_02_questions.txt
│   │   │   ├── aoc_2024_03.adb
│   │   │   ├── aoc_2024_03.txt
│   │   │   ├── aoc_2024_03_questions.txt
│   │   │   ├── aoc_2024_04.adb
│   │   │   ├── aoc_2024_04.txt
│   │   │   ├── aoc_2024_04_questions.txt
│   │   │   ├── aoc_2024_05.adb
│   │   │   ├── aoc_2024_05.txt
│   │   │   ├── aoc_2024_05_questions.txt
│   │   │   ├── aoc_2024_06.adb
│   │   │   ├── aoc_2024_06.txt
│   │   │   ├── aoc_2024_06_questions.txt
│   │   │   ├── aoc_2024_07.adb
│   │   │   ├── aoc_2024_07.txt
│   │   │   ├── aoc_2024_07_questions.txt
│   │   │   ├── aoc_2024_08.adb
│   │   │   ├── aoc_2024_08.txt
│   │   │   ├── aoc_2024_08_questions.txt
│   │   │   ├── aoc_2024_09.adb
│   │   │   ├── aoc_2024_09.txt
│   │   │   ├── aoc_2024_09_questions.txt
│   │   │   ├── aoc_2024_10.adb
│   │   │   ├── aoc_2024_10.txt
│   │   │   ├── aoc_2024_10_questions.txt
│   │   │   ├── aoc_2024_11.adb
│   │   │   ├── aoc_2024_11_questions.txt
│   │   │   ├── aoc_2024_12.adb
│   │   │   ├── aoc_2024_12.txt
│   │   │   ├── aoc_2024_12_questions.txt
│   │   │   ├── aoc_2024_13.adb
│   │   │   ├── aoc_2024_13.txt
│   │   │   ├── aoc_2024_13_questions.txt
│   │   │   ├── aoc_2024_14.adb
│   │   │   ├── aoc_2024_14.txt
│   │   │   ├── aoc_2024_14_questions.txt
│   │   │   ├── aoc_2024_15.adb
│   │   │   ├── aoc_2024_15.txt
│   │   │   ├── aoc_2024_15_questions.txt
│   │   │   ├── aoc_2024_16.adb
│   │   │   ├── aoc_2024_16.txt
│   │   │   ├── aoc_2024_16_questions.txt
│   │   │   ├── aoc_2024_17.adb
│   │   │   ├── aoc_2024_17_questions.txt
│   │   │   ├── aoc_2024_18.adb
│   │   │   ├── aoc_2024_18.txt
│   │   │   ├── aoc_2024_18_questions.txt
│   │   │   ├── aoc_2024_19.adb
│   │   │   ├── aoc_2024_19.txt
│   │   │   ├── aoc_2024_19_questions.txt
│   │   │   ├── aoc_2024_20.adb
│   │   │   ├── aoc_2024_20.txt
│   │   │   ├── aoc_2024_20_mini.txt
│   │   │   ├── aoc_2024_20_questions.txt
│   │   │   ├── aoc_2024_21.adb
│   │   │   ├── aoc_2024_21_questions.txt
│   │   │   ├── aoc_2024_22.adb
│   │   │   ├── aoc_2024_22.txt
│   │   │   ├── aoc_2024_22_full_ada.adb
│   │   │   ├── aoc_2024_22_mini.txt
│   │   │   ├── aoc_2024_22_questions.txt
│   │   │   ├── aoc_2024_23.adb
│   │   │   ├── aoc_2024_23.txt
│   │   │   ├── aoc_2024_23_questions.txt
│   │   │   ├── aoc_2024_24.adb
│   │   │   ├── aoc_2024_24_questions.txt
│   │   │   ├── aoc_2024_25.adb
│   │   │   ├── aoc_2024_25.txt
│   │   │   └── aoc_2024_25_questions.txt
│   │   ├── 2025/
│   │   │   ├── aoc_2025.gpr
│   │   │   ├── aoc_2025_01.adb
│   │   │   ├── aoc_2025_01.txt
│   │   │   ├── aoc_2025_01_questions.txt
│   │   │   ├── aoc_2025_02.adb
│   │   │   ├── aoc_2025_02.txt
│   │   │   ├── aoc_2025_02_mini.txt
│   │   │   ├── aoc_2025_02_questions.txt
│   │   │   ├── aoc_2025_03.adb
│   │   │   ├── aoc_2025_03.txt
│   │   │   ├── aoc_2025_03_questions.txt
│   │   │   ├── aoc_2025_04.adb
│   │   │   ├── aoc_2025_04.txt
│   │   │   ├── aoc_2025_04_questions.txt
│   │   │   ├── aoc_2025_05.adb
│   │   │   ├── aoc_2025_05.txt
│   │   │   ├── aoc_2025_05_questions.txt
│   │   │   ├── aoc_2025_06.adb
│   │   │   ├── aoc_2025_06.txt
│   │   │   ├── aoc_2025_06_questions.txt
│   │   │   ├── aoc_2025_07.adb
│   │   │   ├── aoc_2025_07.txt
│   │   │   ├── aoc_2025_07_questions.txt
│   │   │   ├── aoc_2025_08.adb
│   │   │   ├── aoc_2025_08.txt
│   │   │   ├── aoc_2025_08_mini.txt
│   │   │   ├── aoc_2025_08_questions.txt
│   │   │   ├── aoc_2025_09.adb
│   │   │   ├── aoc_2025_09.m
│   │   │   ├── aoc_2025_09.txt
│   │   │   ├── aoc_2025_09_questions.txt
│   │   │   ├── aoc_2025_10.adb
│   │   │   ├── aoc_2025_10.txt
│   │   │   ├── aoc_2025_10_mini.txt
│   │   │   ├── aoc_2025_10_questions.txt
│   │   │   ├── aoc_2025_11.adb
│   │   │   ├── aoc_2025_11.txt
│   │   │   └── aoc_2025_11_questions.txt
│   │   ├── aoc_check_list.txt
│   │   ├── aoc_toolbox.adb
│   │   └── aoc_toolbox.ads
│   ├── arguments.adb
│   ├── attributes.adb
│   ├── auto_complete.adb
│   ├── barnes.adb
│   ├── binomials.adb
│   ├── bwt.adb
│   ├── ce_b_2.adb
│   ├── ce_b_4.adb
│   ├── ce_c_2.adb
│   ├── ce_c_4.adb
│   ├── ce_e_1.adb
│   ├── ce_e_2.adb
│   ├── ce_e_4.adb
│   ├── ce_i_1.adb
│   ├── ce_i_2.adb
│   ├── ce_i_3.adb
│   ├── ce_i_4.adb
│   ├── console_io.adb
│   ├── covid_19_s.adb
│   ├── cross_a.adb
│   ├── cross_a.ads
│   ├── cross_b.adb
│   ├── cross_b.ads
│   ├── days_1901.adb
│   ├── directories.adb
│   ├── doors.adb
│   ├── draw_sphere.adb
│   ├── e.cmd
│   ├── echo.adb
│   ├── einmaleins.adb
│   ├── embed_text.adb
│   ├── env.adb
│   ├── existence.adb
│   ├── file_append.adb
│   ├── file_copy.adb
│   ├── file_read.adb
│   ├── fill_drive.adb
│   ├── gallery.adb
│   ├── hac_exm.gpr
│   ├── hac_exm.prj
│   ├── hello.adb
│   ├── hello_big.adb
│   ├── hofstadter.adb
│   ├── mandelbrot.adb
│   ├── mathe_kal/
│   │   └── 2022/
│   │       ├── mathe_plus_2022_02.adb
│   │       ├── mathe_plus_2022_04.adb
│   │       ├── mathe_plus_2022_09.adb
│   │       └── mkp_2022.gpr
│   ├── maze_gen.adb
│   ├── md2html.adb
│   ├── merge_sort.adb
│   ├── names_in_boxes.adb
│   ├── native.adb
│   ├── not_working/
│   │   ├── din_sm.adb
│   │   ├── din_ws.adb
│   │   ├── dinersmo.adb
│   │   ├── newrace.adb
│   │   ├── overloading.adb
│   │   ├── pgm0.adb
│   │   ├── pgm1.adb
│   │   ├── pgm2.adb
│   │   ├── race.adb
│   │   ├── racedead.adb
│   │   └── roland_01.adb
│   ├── pack_list.adb
│   ├── pdf/
│   │   ├── hac_pdf_out.adb
│   │   ├── hac_pdf_out.ads
│   │   ├── hilbert_curve.adb
│   │   ├── koch_curve.adb
│   │   ├── pdf_hello.adb
│   │   └── peano_curve.adb
│   ├── permutations.adb
│   ├── pkg_1.adb
│   ├── pkg_1.ads
│   ├── pkg_2.ads
│   ├── pkg_demo.adb
│   ├── pkg_demo_gen.adb
│   ├── prc.adb
│   ├── random.adb
│   ├── record_code_gen.adb
│   ├── remarks.adb
│   ├── series.adb
│   ├── shell.adb
│   ├── shell_sort.adb
│   ├── strings_demo.adb
│   ├── sudoku_sample.adb
│   ├── sudokus.adb
│   ├── sudokus.ads
│   ├── tasking/
│   │   ├── tasks_01.adb
│   │   └── tasks_02.adb
│   ├── three_lakes_s.adb
│   ├── timing.adb
│   ├── triangles_overlap.adb
│   ├── unit_a.adb
│   ├── unit_b.adb
│   ├── unit_b.ads
│   ├── unit_c.adb
│   ├── unit_e.adb
│   ├── unit_f.adb
│   ├── unit_f.ads
│   ├── unit_g.adb
│   └── unit_g.ads
├── fast.cmd
├── hac.gpr
├── hac_objectada.prj
├── profiling.cmd
├── readme.md
├── save.hac
├── save_modif.hac
├── save_modif_and_untracked.hac
├── small.cmd
├── src/
│   ├── apps/
│   │   ├── hac.adb
│   │   ├── hac_mini.adb
│   │   ├── hac_multi.adb
│   │   ├── hac_pkg.adb
│   │   ├── hac_pkg.ads
│   │   └── show_mit_license.adb
│   ├── compile/
│   │   ├── emit/
│   │   │   ├── hac_sys-targets-amd64_windows_console_fasm.adb
│   │   │   ├── hac_sys-targets-amd64_windows_console_fasm.ads
│   │   │   ├── hac_sys-targets-hac_virtual_machine.adb
│   │   │   ├── hac_sys-targets-hac_virtual_machine.ads
│   │   │   ├── hac_sys-targets-semantics.adb
│   │   │   ├── hac_sys-targets-semantics.ads
│   │   │   └── hac_sys-targets.ads
│   │   ├── hac_sys-builder.adb
│   │   ├── hac_sys-builder.ads
│   │   ├── hac_sys-co_defs.adb
│   │   ├── hac_sys-co_defs.ads
│   │   ├── hac_sys-compiler-pcode_emit.adb
│   │   ├── hac_sys-compiler-pcode_emit.ads
│   │   ├── hac_sys-compiler.adb
│   │   ├── hac_sys-compiler.ads
│   │   ├── hac_sys-defs.adb
│   │   ├── hac_sys-defs.ads
│   │   ├── hac_sys-errors.adb
│   │   ├── hac_sys-errors.ads
│   │   ├── hac_sys-multi_precision_integers.adb
│   │   ├── hac_sys-multi_precision_integers.ads
│   │   ├── hac_sys-parser-attributes.adb
│   │   ├── hac_sys-parser-attributes.ads
│   │   ├── hac_sys-parser-calls.adb
│   │   ├── hac_sys-parser-calls.ads
│   │   ├── hac_sys-parser-const_var.adb
│   │   ├── hac_sys-parser-const_var.ads
│   │   ├── hac_sys-parser-enter_def.adb
│   │   ├── hac_sys-parser-enter_def.ads
│   │   ├── hac_sys-parser-expressions.adb
│   │   ├── hac_sys-parser-expressions.ads
│   │   ├── hac_sys-parser-helpers.adb
│   │   ├── hac_sys-parser-helpers.ads
│   │   ├── hac_sys-parser-modularity.adb
│   │   ├── hac_sys-parser-modularity.ads
│   │   ├── hac_sys-parser-packages.adb
│   │   ├── hac_sys-parser-packages.ads
│   │   ├── hac_sys-parser-ranges.adb
│   │   ├── hac_sys-parser-ranges.ads
│   │   ├── hac_sys-parser-standard_functions.adb
│   │   ├── hac_sys-parser-standard_functions.ads
│   │   ├── hac_sys-parser-standard_procedures.adb
│   │   ├── hac_sys-parser-standard_procedures.ads
│   │   ├── hac_sys-parser-statements-case_statement.adb
│   │   ├── hac_sys-parser-statements.adb
│   │   ├── hac_sys-parser-statements.ads
│   │   ├── hac_sys-parser-tasking.adb
│   │   ├── hac_sys-parser-tasking.ads
│   │   ├── hac_sys-parser-type_conversion.adb
│   │   ├── hac_sys-parser-type_conversion.ads
│   │   ├── hac_sys-parser-type_def.adb
│   │   ├── hac_sys-parser-type_def.ads
│   │   ├── hac_sys-parser.adb
│   │   ├── hac_sys-parser.ads
│   │   ├── hac_sys-scanner.adb
│   │   └── hac_sys-scanner.ads
│   ├── execute/
│   │   ├── hac_sys-interfacing.adb
│   │   ├── hac_sys-pcode-interpreter-calls.adb
│   │   ├── hac_sys-pcode-interpreter-calls.ads
│   │   ├── hac_sys-pcode-interpreter-composite_data.adb
│   │   ├── hac_sys-pcode-interpreter-composite_data.ads
│   │   ├── hac_sys-pcode-interpreter-exceptions.adb
│   │   ├── hac_sys-pcode-interpreter-exceptions.ads
│   │   ├── hac_sys-pcode-interpreter-in_defs.adb
│   │   ├── hac_sys-pcode-interpreter-in_defs.ads
│   │   ├── hac_sys-pcode-interpreter-multi_statement.adb
│   │   ├── hac_sys-pcode-interpreter-multi_statement.ads
│   │   ├── hac_sys-pcode-interpreter-operators.adb
│   │   ├── hac_sys-pcode-interpreter-operators.ads
│   │   ├── hac_sys-pcode-interpreter-tasking-scheduler.adb
│   │   ├── hac_sys-pcode-interpreter-tasking.adb
│   │   ├── hac_sys-pcode-interpreter-tasking.ads
│   │   ├── hac_sys-pcode-interpreter.adb
│   │   ├── hac_sys-pcode-interpreter.ads
│   │   ├── hac_sys-pcode.adb
│   │   └── hac_sys-pcode.ads
│   ├── hac_sys-interfacing.ads
│   ├── hac_sys.ads
│   ├── hat-non_standard.adb
│   ├── hat-non_standard_oawin64.adb
│   ├── hat.adb
│   ├── hat.ads
│   └── manage/
│       ├── hac_sys-files-default.adb
│       ├── hac_sys-files-default.ads
│       ├── hac_sys-files.ads
│       ├── hac_sys-librarian-built_in_packages.adb
│       ├── hac_sys-librarian-built_in_packages.ads
│       ├── hac_sys-librarian.adb
│       └── hac_sys-librarian.ads
└── test/
    ├── all_noisy_tests.adb
    ├── all_silent_tests.adb
    ├── attributes_test.adb
    ├── case_statement.adb
    ├── constants.adb
    ├── declarations.adb
    ├── digitz.adb
    ├── enumerations.adb
    ├── exception_01.adb
    ├── exception_02.adb
    ├── exception_03.adb
    ├── exception_04.adb
    ├── floats.adb
    ├── forward.adb
    ├── future/
    │   └── block_statements.adb
    ├── hac_test.gpr
    ├── hac_test.prj
    ├── if_then_elsif_else.adb
    ├── integers.adb
    ├── loops.adb
    ├── object_init.adb
    ├── open_files.adb
    ├── optim.adb
    ├── recursion.adb
    ├── remarks_check.adb
    ├── remarks_k_ok.txt
    ├── remarks_r_ok.txt
    ├── remarks_u_ok.txt
    ├── remarks_v_ok.txt
    ├── shell_test.adb
    ├── silent_tests_single_build.adb
    ├── sorting_tests.adb
    ├── strings.adb
    ├── t.cmd
    ├── test.adb
    ├── test1.adb
    ├── test_tail_after_match.adb
    ├── testing_utilities.adb
    ├── testing_utilities.ads
    ├── tf.cmd
    ├── toa.cmd
    ├── ts.cmd
    ├── type_conversion.adb
    └── verif_hac.aru
Condensed preview — 670 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,790K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 752,
    "preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
  },
  {
    "path": ".gitignore",
    "chars": 37,
    "preview": "/obj/\n/bin/\n/hac\n/hac_mini\n/hac_multi"
  },
  {
    "path": "LICENSE",
    "chars": 1086,
    "preview": "MIT License\n\nCopyright (c) 2013 .. 2025 Gautier de Montmollin\n\nPermission is hereby granted, free of charge, to any pers"
  },
  {
    "path": "build.cmd",
    "chars": 423,
    "preview": "@echo off\n\ngprbuild %1 -P hac           -XHAC_OS=Win64\ngprbuild %1 -P demo/hac_demo -XHAC_OS=Win64\n\nif %errorlevel% == 9"
  },
  {
    "path": "debug.pra",
    "chars": 78,
    "preview": "pragma Initialize_Scalars;\r\n-- pragma Normalize_Scalars; -- For all units!\r\n\r\n"
  },
  {
    "path": "demo/data_exchange/exchange_common.ads",
    "chars": 472,
    "preview": "-------------------------------------------\n--  HAC  <->  Native data exchange demo  --\n--------------------------------"
  },
  {
    "path": "demo/data_exchange/exchange_hac_side.adb",
    "chars": 3800,
    "preview": "-----------------------------------------\r\n--  HAC <-> Native data exchange demo  --\r\n----------------------------------"
  },
  {
    "path": "demo/data_exchange/exchange_native_side.adb",
    "chars": 1847,
    "preview": "-------------------------------------------\r\n--  HAC  <->  Native data exchange demo  --\r\n------------------------------"
  },
  {
    "path": "demo/data_exchange/exchange_native_side_pkg.adb",
    "chars": 5461,
    "preview": "-------------------------------------------\r\n--  HAC  <->  Native data exchange demo  --\r\n------------------------------"
  },
  {
    "path": "demo/data_exchange/exchange_native_side_pkg.ads",
    "chars": 520,
    "preview": "-------------------------------------------\r\n--  HAC  <->  Native data exchange demo  --\r\n------------------------------"
  },
  {
    "path": "demo/data_exchange_simple/exchange_hac_side_simple.adb",
    "chars": 763,
    "preview": "-----------------------------------------\r\n--  HAC <-> Native data exchange demo  --\r\n----------------------------------"
  },
  {
    "path": "demo/data_exchange_simple/exchange_native_side_pkg_simple.adb",
    "chars": 948,
    "preview": "-------------------------------------------\r\n--  HAC  <->  Native data exchange demo  --\r\n------------------------------"
  },
  {
    "path": "demo/data_exchange_simple/exchange_native_side_pkg_simple.ads",
    "chars": 419,
    "preview": "------------------------------------------------------------\r\n--  HAC  <->  Native data exchange demo (simple version)  "
  },
  {
    "path": "demo/data_exchange_simple/exchange_native_side_simple.adb",
    "chars": 1581,
    "preview": "-------------------------------------------\r\n--  HAC  <->  Native data exchange demo  --\r\n------------------------------"
  },
  {
    "path": "demo/hac_demo.gpr",
    "chars": 4567,
    "preview": "--  This is a GNAT, GCC or GNAT Studio project file\n--  for the demos of the HAC project ( https://sf.net/projects/hacad"
  },
  {
    "path": "doc/archeology/smallada_doc.txt",
    "chars": 11725,
    "preview": "S M A L L A d a   1 9 9 1\nIBM PC-family version\n\nDepartment of Electrical Engineering and Computer Science\nThe George Wa"
  },
  {
    "path": "doc/hac.txt",
    "chars": 11625,
    "preview": "HAC - HAC Ada Compiler\n======================\n\n  HAC is perhaps the first open-source (albeit very partial) Ada\n  compil"
  },
  {
    "path": "exm/ackermann.adb",
    "chars": 642,
    "preview": "--  https://en.wikipedia.org/wiki/Ackermann_function\n--  https://rosettacode.org/wiki/Ackermann_function#Ada\n\nwith HAT;\n"
  },
  {
    "path": "exm/anti_primes.adb",
    "chars": 1297,
    "preview": "--  https://rosettacode.org/wiki/Anti-primes#Ada\n--\n--  The anti-primes (or highly composite numbers, sequence A002182 i"
  },
  {
    "path": "exm/aoc/2020/aoc_2020.gpr",
    "chars": 4615,
    "preview": "--  This is a GNAT, GCC or GNAT Studio project file\n--  for the Advent of Code 2020 examples.\n--  Some work with both HA"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_02.adb",
    "chars": 2602,
    "preview": "--  Solution to Advent of Code 2020, Day 2\n------------------------------------------\n--  Password Philosophy\n--\n--  htt"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_02.txt",
    "chars": 20510,
    "preview": "1-4 m: mrfmmbjxr\n5-16 b: bbbbhbbbbpbxbbbcb\n7-8 x: qxrxmxccxxx\n9-11 k: kkkkkkktmkhk\n8-12 g: sgwvdxzhkvndv\n6-9 v: zvmvvmvv"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_03.adb",
    "chars": 2151,
    "preview": "--  Solution to Advent of Code 2020, Day 3\n------------------------------------------\n--  Toboggan Trajectory\n--\n--  Cou"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_03.txt",
    "chars": 10336,
    "preview": "....#...##......##..#..#.#...#.\n..######...#......#....#..#.##.\n..#.#...##......#.#..#..#....#.\n..#.....#..#.#........#."
  },
  {
    "path": "exm/aoc/2020/aoc_2020_04.adb",
    "chars": 4465,
    "preview": "--  Solution to Advent of Code 2020, Day 4\n------------------------------------------\n--  Passport Processing\n--\n--  htt"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_04.txt",
    "chars": 19016,
    "preview": "pid:827837505 byr:1976\nhgt:187cm\niyr:2016\nhcl:#fffffd\neyr:2024\n\nhgt:189cm byr:1987 pid:572028668 iyr:2014 hcl:#623a2f\ney"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_04_b_full_ada.adb",
    "chars": 2653,
    "preview": "--  Solution to Advent of Code 2020, Day 04, Part Two\n-----------------------------------------------------\n--  Passport"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_05.adb",
    "chars": 1313,
    "preview": "--  Solution to Advent of Code 2020, Day 5\n-------------------------------------------\n--  Binary Boarding\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_05.txt",
    "chars": 9064,
    "preview": "FFFFBFBLLR\nBFBFFBBLLR\nBBFFFFBLRR\nFBFBFFFRLL\nBFFBFFFRRR\nBFBFBFFRLR\nFFFBBBBLRL\nBFFFFBFLLL\nFFFFBBFLLR\nBBFFBFFRRR\nFBBFBBFLRL"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_06.adb",
    "chars": 2409,
    "preview": "--  Solution to Advent of Code 2020, Day 6\n------------------------------------------\n--  Custom Customs\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_06.txt",
    "chars": 17331,
    "preview": "qtmdwspah\nsqwdamhpt\nphwdaqsmt\nstmdqwhap\npqawdhtms\n\nbgsickuztovfwa\nyiozauvgfsbtkwc\nzygijavmtfkcuwobs\nfvsuwtiadzrncboklg\n\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_06_full_ada.adb",
    "chars": 1483,
    "preview": "--  Solution to Advent of Code 2020, Day 6\n------------------------------------------\n--  Custom Customs\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_06_full_ada_using_hat.adb",
    "chars": 1496,
    "preview": "--  Solution to Advent of Code 2020, Day 6\n------------------------------------------\n--  Custom Customs\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_07.adb",
    "chars": 6938,
    "preview": "--  Solution to Advent of Code 2020, Day 7\n------------------------------------------\n--  Handy Haversacks\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_07.txt",
    "chars": 43530,
    "preview": "wavy green bags contain 1 posh black bag, 1 faded green bag, 4 wavy red bags.\ndotted chartreuse bags contain 1 light bei"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_07_full_ada.adb",
    "chars": 5074,
    "preview": "--  Solution to Advent of Code 2020, Day 7\n------------------------------------------\n--  Handy Haversacks\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_07_full_ada_vectors_2x.adb",
    "chars": 5027,
    "preview": "--  Solution to Advent of Code 2020, Day 7\n------------------------------------------\n--  Handy Haversacks\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_08.adb",
    "chars": 2834,
    "preview": "--  Solution to Advent of Code 2020, Day 8\n------------------------------------------\n--  Handheld Halting\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_08.txt",
    "chars": 5069,
    "preview": "acc -17\nnop +318\njmp +1\nacc -10\njmp +394\nacc +43\nacc +47\nnop +570\njmp +176\nacc -9\njmp +322\njmp +73\nacc +4\nacc -4\njmp +46"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_09.adb",
    "chars": 2722,
    "preview": "--  Solution to Advent of Code 2020, Day 9\n------------------------------------------\n--  Encoding Error\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_09.txt",
    "chars": 8856,
    "preview": "42\n27\n23\n19\n4\n26\n31\n29\n11\n49\n38\n9\n45\n1\n40\n46\n39\n28\n44\n16\n13\n5\n32\n17\n50\n12\n20\n6\n7\n10\n22\n14\n18\n60\n59\n8\n19\n9\n11\n15\n21\n23\n39"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_10.adb",
    "chars": 4043,
    "preview": "--  Solution to Advent of Code 2020, Day 10\n-------------------------------------------\n--  Adapter Array\n--\n--  https:/"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_10.txt",
    "chars": 338,
    "preview": "99\n104\n120\n108\n67\n136\n80\n44\n129\n113\n158\n157\n89\n60\n138\n63\n35\n57\n61\n153\n116\n54\n7\n22\n133\n130\n5\n72\n2\n28\n131\n123\n55\n145\n151\n4"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_11.adb",
    "chars": 4583,
    "preview": "--  Solution to Advent of Code 2020, Day 11\n-------------------------------------------\n--  Seating System\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_11.txt",
    "chars": 9212,
    "preview": "LLLLL.LLLL.LLLLLLL.LLLLLLLLLLLLLLLL.LLLLLLLLL.LLLLLLLLL.LLLLLLL.LLLLLLLLLLLL.LL.LLLLLLLLL.LLL\nLLLLLLLL.L.LLLLLLL.LLLLLLL"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_11_full_ada.adb",
    "chars": 3900,
    "preview": "--  Solution to Advent of Code 2020, Day 11\n-------------------------------------------\n--  Seating System\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_11_mini.txt",
    "chars": 110,
    "preview": "L.LL.LL.LL\nLLLLLLL.LL\nL.L.L..L..\nLLLL.LL.LL\nL.LL.LL.LL\nL.LLLLL.LL\n..L.L.....\nLLLLLLLLLL\nL.LLLLLL.L\nL.LLLLL.LL\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_12.adb",
    "chars": 2518,
    "preview": "--  Solution to Advent of Code 2020, Day 12\n-------------------------------------------\n--  Rain Risk\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_12.txt",
    "chars": 2813,
    "preview": "N1\nR90\nS5\nR180\nN3\nW1\nL180\nF92\nR270\nE4\nF4\nW4\nW4\nL180\nS2\nW2\nF90\nE1\nS5\nW3\nF78\nS5\nR180\nF100\nN1\nW3\nL90\nL90\nN1\nF94\nW2\nR90\nF49\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_13.adb",
    "chars": 3553,
    "preview": "--  Solution to Advent of Code 2020, Day 13\n-------------------------------------------\n--  Shuttle Search\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_13.txt",
    "chars": 223,
    "preview": "1000511\n29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,13,19,0,0,0,2"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_14.txt",
    "chars": 13979,
    "preview": "mask = 00101X10011X0X111110010X010011X10101\nmem[41248] = 4595332\nmem[26450] = 60\nmem[32210] = 982366\nmem[1060] = 2346329"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_14_exm_1.txt",
    "chars": 80,
    "preview": "mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X\nmem[8] = 11\nmem[7] = 101\nmem[8] = 0\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_14_exm_2.txt",
    "chars": 114,
    "preview": "mask = 000000000000000000000000000000X1001X\nmem[42] = 100\nmask = 00000000000000000000000000000000X0XX\nmem[26] = 1\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_14_full_ada.adb",
    "chars": 6033,
    "preview": "--  Solution to Advent of Code 2020, Day 14\n-------------------------------------------\n--\n--  https://adventofcode.com/"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_14_jc.txt",
    "chars": 13460,
    "preview": "mask = 00X1011010111X01X1X010X01X1111X11100\nmem[13879] = 56974\nmem[26072] = 842\nmem[47322] = 62104110\nmem[31450] = 37278"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_15.adb",
    "chars": 2685,
    "preview": "--  Solution to Advent of Code 2020, Day 15\n-------------------------------------------\n--  Rambunctious Recitation\n--\n-"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_15_full_ada.adb",
    "chars": 2199,
    "preview": "--  Solution to Advent of Code 2020, Day 15\n-------------------------------------------\n--  Rambunctious Recitation\n--\n-"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_15_full_ada_hashed_maps.adb",
    "chars": 2709,
    "preview": "--  Solution to Advent of Code 2020, Day 15\n-------------------------------------------\n--  Rambunctious Recitation\n--\n-"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_16.adb",
    "chars": 6390,
    "preview": "--  Solution to Advent of Code 2020, Day 16\n-------------------------------------------\n--  Ticket Translation\n--\n--  ht"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_16.txt",
    "chars": 19811,
    "preview": "departure location: 28-787 or 804-964\ndeparture station: 41-578 or 594-962\ndeparture platform: 50-718 or 733-949\ndepartu"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_17.adb",
    "chars": 5393,
    "preview": "--  Solution to Advent of Code 2020, Day 17\n-------------------------------------------\n--  Conway Cubes\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_17.txt",
    "chars": 72,
    "preview": "###..#..\n.#######\n#####...\n#..##.#.\n###..##.\n##...#..\n..#...#.\n.#....##\n"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_18.txt",
    "chars": 19536,
    "preview": "2 * 9 + 5 + ((8 + 6 + 5) * (2 + 3 * 9 + 3) + 5) * (7 + 9 + 7 + 3 * 7) * 5\n7 + (2 + 8 * 8 * 2 + (4 * 3 * 9 + 4 * 4)) + 4 "
  },
  {
    "path": "exm/aoc/2020/aoc_2020_18_full_ada.adb",
    "chars": 1373,
    "preview": "--  Solution to Advent of Code 2020, Day 18\n-------------------------------------------\n--  Operation Order\n--\n--  https"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_18_weird_formulas.adb",
    "chars": 35459,
    "preview": "with Ada.Characters.Handling;           use Ada.Characters.Handling;\nwith Ada.Exceptions;                    use Ada.Exc"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_18_weird_formulas.ads",
    "chars": 4660,
    "preview": "--  Variant of the Formulas package (see the open-source MathPaqs project),\n--  with \"alternative\" arithmetics...\n\nwith "
  },
  {
    "path": "exm/aoc/2020/aoc_2020_19.txt",
    "chars": 19308,
    "preview": "108: 117 50 | 63 64\n124: 50 64 | 64 64\n123: 64 119 | 50 85\n45: 60 64\n32: 20 50 | 79 64\n36: 97 64 | 70 50\n97: 50 64 | 64 "
  },
  {
    "path": "exm/aoc/2020/aoc_2020_19_full_ada.adb",
    "chars": 5352,
    "preview": "--  Solution to Advent of Code 2020, Day 19\n-------------------------------------------\n--  Monster Messages\n--\n--  http"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_20.adb",
    "chars": 4296,
    "preview": "--  Solution to Advent of Code 2020, Day 20\n-------------------------------------------\n--  Jurassic Jigsaw\n--\n--  https"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_20.txt",
    "chars": 17568,
    "preview": "Tile 2647:\n#....#####\n.##......#\n##......##\n.....#..#.\n.........#\n.....#..##\n#.#....#..\n#......#.#\n#....##..#\n...##....."
  },
  {
    "path": "exm/aoc/2020/aoc_2020_21.txt",
    "chars": 14866,
    "preview": "mxc ssdszsn phc llj nhnd fqqcnm njrcfg mrczqmj zfnttf tqkfx zvq rftbr jgbk kmlkx tzdks czvphx qpbl fzlrf zmsdzh qfslcb p"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_21_full_ada.adb",
    "chars": 7079,
    "preview": "--  Solution to Advent of Code 2020, Day 21\n-------------------------------------------\n--  Allergen Assessment\n--\n--  h"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_21_full_ada_preproc.adb",
    "chars": 1539,
    "preview": "--  Preparation of Advent of Code 2020, Day 21\n----------------------------------------------\n--\n--  https://adventofcod"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_22.adb",
    "chars": 6044,
    "preview": "--  Solution to Advent of Code 2020, Day 22\n-------------------------------------------\n--  Crab Combat\n--\n--  https://a"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_22.txt",
    "chars": 162,
    "preview": "Player 1:\n26\n16\n33\n8\n5\n46\n12\n47\n39\n27\n50\n10\n34\n20\n23\n11\n43\n14\n18\n1\n48\n28\n31\n38\n41\n\nPlayer 2:\n45\n7\n9\n4\n15\n19\n49\n3\n36\n25\n2"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_22_full_ada.adb",
    "chars": 6953,
    "preview": "--  Solution to Advent of Code 2020, Day 22\n-------------------------------------------\n--  Crab Combat\n--\n--  https://a"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_23.adb",
    "chars": 6636,
    "preview": "--  Solution to Advent of Code 2020, Day 23\n-------------------------------------------\n--  Crab Cups\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_23_simple_array.adb",
    "chars": 4569,
    "preview": "--  Solution to Advent of Code 2020, Day 23\n-------------------------------------------\n--  Crab Cups\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_24.adb",
    "chars": 6429,
    "preview": "--  Solution to Advent of Code 2020, Day 24\n-------------------------------------------\n--  Lobby Layout\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_24.txt",
    "chars": 13329,
    "preview": "nenwswenweswweenesweeenenwee\nnwnwnwnwswenenenwneswneenwnenenwnenwsw\nweweeeeneneseswesesweeesenwnw\nwnwwwwwnwwnewsewnwenww"
  },
  {
    "path": "exm/aoc/2020/aoc_2020_25.adb",
    "chars": 2446,
    "preview": "--  Solution to Advent of Code 2020, Day 25\n-------------------------------------------\n--  Combo Breaker\n--\n--  https:/"
  },
  {
    "path": "exm/aoc/2021/aoc_2021.gpr",
    "chars": 3925,
    "preview": "--  This is a GNAT, GCC or GNAT Studio project file\n--  for the Advent of Code 2021 examples.\n--  Some work with both HA"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_01.adb",
    "chars": 1433,
    "preview": "--  Solution to Advent of Code 2021, Day 1\n------------------------------------------\n--  Sonar Sweep\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_01.txt",
    "chars": 9311,
    "preview": "199\n203\n200\n201\n196\n195\n196\n214\n227\n225\n229\n260\n246\n253\n271\n281\n280\n295\n310\n293\n295\n297\n298\n297\n306\n299\n290\n292\n289\n287\n"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_01_questions.txt",
    "chars": 3653,
    "preview": "--- Day 1: Sonar Sweep ---\n\nYou're minding your own business on a ship at sea when the overboard alarm goes off! You rus"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_02.adb",
    "chars": 1724,
    "preview": "--  Solution to Advent of Code 2021, Day 2\n------------------------------------------\n--  Dive!\n--\n--  https://adventofc"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_02.txt",
    "chars": 7705,
    "preview": "forward 1\ndown 6\ndown 6\nforward 2\nforward 2\ndown 2\ndown 1\ndown 5\ndown 7\ndown 3\nforward 1\nforward 6\nup 2\nforward 2\nforwar"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_02_questions.txt",
    "chars": 3175,
    "preview": "--- Day 2: Dive! ---\n\nNow, you need to figure out how to pilot this thing.\n\nIt seems like the submarine can take a serie"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_03.adb",
    "chars": 4517,
    "preview": "--  Solution to Advent of Code 2021, Day 3\n------------------------------------------\n--  Binary Diagnostic\n--\n--  https"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_03.txt",
    "chars": 13000,
    "preview": "000000011010\n011001111011\n100101011101\n000110000110\n101010001010\n010010000011\n011001111001\n100111000000\n011101011010\n000"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_03_questions.txt",
    "chars": 5549,
    "preview": "--- Day 3: Binary Diagnostic ---\n\nThe submarine has been making some odd creaking noises, so you ask it to produce a dia"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_04.adb",
    "chars": 4333,
    "preview": "--  Solution to Advent of Code 2021, Day 04\n-------------------------------------------\n--  Giant Squid\n--\n--  https://a"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_04.txt",
    "chars": 7890,
    "preview": "10,80,6,69,22,99,63,92,30,67,28,93,0,50,65,87,38,7,91,60,57,40,84,51,27,12,44,88,64,35,39,74,61,55,31,48,81,89,62,37,94,"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_04_questions.txt",
    "chars": 3662,
    "preview": "--- Day 4: Giant Squid ---\n\nYou're already almost 1.5km (almost a mile) below the surface of the ocean, already so deep "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_05.adb",
    "chars": 2920,
    "preview": "--  Solution to Advent of Code 2021, Day 05\n-------------------------------------------\n--  Hydrothermal Venture\n--\n--  "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_05.txt",
    "chars": 9289,
    "preview": "955,125 -> 151,929\n830,251 -> 526,555\n182,185 -> 13,16\n73,871 -> 73,951\n169,968 -> 626,968\n471,180 -> 471,746\n725,478 ->"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_05_questions.txt",
    "chars": 1772,
    "preview": "--- Day 5: Hydrothermal Venture ---\n\nYou come across a field of hydrothermal vents on the ocean floor! These vents const"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_06.adb",
    "chars": 2101,
    "preview": "--  Solution to Advent of Code 2021, Day 6\n------------------------------------------\n--  Lanternfish\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_06.txt",
    "chars": 600,
    "preview": "1,1,1,1,3,1,4,1,4,1,1,2,5,2,5,1,1,1,4,3,1,4,1,1,1,1,1,1,1,2,1,2,4,1,1,1,1,1,1,1,3,1,1,5,1,1,2,1,5,1,1,1,1,1,1,1,1,4,3,1,"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_06_questions.txt",
    "chars": 3556,
    "preview": "--- Day 6: Lanternfish ---\n\nThe sea floor is getting steeper. Maybe the sleigh keys got carried this way?\n\nA massive sch"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_07.adb",
    "chars": 4595,
    "preview": "--  Solution to Advent of Code 2021, Day 7\n------------------------------------------\n--  The Treachery of Whales\n--\n-- "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_07.txt",
    "chars": 3875,
    "preview": "1101,1,29,67,1102,0,1,65,1008,65,35,66,1005,66,28,1,67,65,20,4,0,1001,65,1,65,1106,0,8,99,35,67,101,99,105,32,110,39,101"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_07_questions.txt",
    "chars": 3169,
    "preview": "--- Day 7: The Treachery of Whales ---\n\nA giant whale has decided your submarine is its next meal, and it's much faster "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_08.adb",
    "chars": 6641,
    "preview": "--  Solution to Advent of Code 2021, Day 8\n------------------------------------------\n--  Seven Segment Search\n--\n--  ht"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_08.txt",
    "chars": 16763,
    "preview": "dfgabce cadfgb cefa ca aecbg dfcegb geabd ecbfg cab agcfbe | egbfadc dbgae gcfeb abgdfc\nfbcag eg dbge gcbfe acdgfe gec f"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_08_questions.txt",
    "chars": 6458,
    "preview": "--- Day 8: Seven Segment Search ---\n\nYou barely reach the safety of the cave when the whale smashes into the cave mouth,"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_09.adb",
    "chars": 2717,
    "preview": "--  Solution to Advent of Code 2021, Day 9\n------------------------------------------\n--  Smoke Basin\n--\n--  First 2021 "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_09.txt",
    "chars": 10100,
    "preview": "9656799999432123456997667932987634348988901234569972123973212398999898743234578999878965345989412345\n8746789898543235689"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_09_questions.txt",
    "chars": 2672,
    "preview": "--- Day 9: Smoke Basin ---\n\nThese caves seem to be lava tubes. Parts are even still volcanically active; small hydrother"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_10.adb",
    "chars": 3744,
    "preview": "--  Solution to Advent of Code 2021, Day 10\n-------------------------------------------\n--  Syntax Scoring\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_10.txt",
    "chars": 9683,
    "preview": "(({(({{<{{(<{<{}()>(<>{})}{[(){}]{{}[]}}>)<[{{{}[]}{{}{}}}{{[]()}<[][]>}]>}}(<[{([()<>][[]<>])}(((\n([<[([<{(<[[[<()[]>[("
  },
  {
    "path": "exm/aoc/2021/aoc_2021_10_questions.txt",
    "chars": 5603,
    "preview": "--- Day 10: Syntax Scoring ---\n\nYou ask the submarine to determine the best route out of the deep-sea cave, but it only "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_11.adb",
    "chars": 2529,
    "preview": "--  Solution to Advent of Code 2021, Day 11\n-------------------------------------------\n--  Dumbo Octopus\n--\n--  https:/"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_11.txt",
    "chars": 110,
    "preview": "1553421288\n5255384882\n1224315732\n4258242274\n1658564216\n6872651182\n5775552238\n5622545172\n8766672318\n2178374835\n"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_11_questions.txt",
    "chars": 5750,
    "preview": "--- Day 11: Dumbo Octopus ---\n\nYou enter a large cavern full of rare bioluminescent dumbo octopuses! They seem to not li"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_12.adb",
    "chars": 4273,
    "preview": "--  Solution to Advent of Code 2021, Day 12\n-------------------------------------------\n--  Passage Pathing\n--\n--  https"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_12.txt",
    "chars": 144,
    "preview": "um-end\npk-um\nFE-il\nay-FE\npk-start\nend-jt\num-FE\nRO-il\nxc-ay\nil-end\nstart-EZ\npk-FE\nxc-start\njt-FE\nEZ-um\npk-xc\nxc-EZ\npk-ay\n"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_12_questions.txt",
    "chars": 4338,
    "preview": "--- Day 12: Passage Pathing ---\r\n\r\nWith your submarine's subterranean subsystems subsisting suboptimally, the only way y"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_13.adb",
    "chars": 3600,
    "preview": "--  Solution to Advent of Code 2021, Day 13\n-------------------------------------------\n--  Transparent Origami\n--\n--  h"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_13.txt",
    "chars": 6080,
    "preview": "1284,359\n47,25\n699,764\n55,204\n552,247\n731,877\n765,12\n619,806\n437,864\n1202,152\n105,456\n159,165\n648,563\n701,143\n609,861\n97"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_13_questions.txt",
    "chars": 3565,
    "preview": "--- Day 13: Transparent Origami ---\r\n\r\nYou reach another volcanically active part of the cave. It would be nice if you c"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_14.adb",
    "chars": 5748,
    "preview": "--  Solution to Advent of Code 2021, Day 14\n-------------------------------------------\n--  Extended Polymerization\n--\n-"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_14.txt",
    "chars": 822,
    "preview": "BNSOSBBKPCSCPKPOPNNK\n\nHH -> N\nCO -> F\nBC -> O\nHN -> V\nSV -> S\nFS -> F\nCV -> F\nKN -> F\nOP -> H\nVN -> P\nPF -> P\nHP -> H\nFK"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_14_questions.txt",
    "chars": 3323,
    "preview": "--- Day 14: Extended Polymerization ---\r\n\r\nThe incredible pressures at this depth are starting to put a strain on your s"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_15.adb",
    "chars": 5953,
    "preview": "--  Solution to Advent of Code 2021, Day 15\n-------------------------------------------\n--  Chiton\n--\n--  https://advent"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_15.txt",
    "chars": 10100,
    "preview": "3885193879879881648295721863446819761149766587914443899626972913439119995971841919742454431896714994\n7771129199159639477"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_15_questions.txt",
    "chars": 5597,
    "preview": "--- Day 15: Chiton ---\r\n\r\nYou've almost reached the exit of the cave, but the walls are getting closer together. Your su"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_16.adb",
    "chars": 4574,
    "preview": "--  Solution to Advent of Code 2021, Day 16\n-------------------------------------------\n--  Packet Decoder\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_16.txt",
    "chars": 1399,
    "preview": "A20D6CE8F00033925A95338B6549C0149E3398DE75817200992531E25F005A18C8C8C0001849FDD43629C293004B001059363936796973BF3699CFF4"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_16_questions.txt",
    "chars": 9242,
    "preview": "--- Day 16: Packet Decoder ---\r\n\r\nAs you leave the cave and reach open waters, you receive a transmission from the Elves"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_17.adb",
    "chars": 2224,
    "preview": "--  Solution to Advent of Code 2021, Day 17\n-------------------------------------------\n--  Trick Shot\n--\n--  https://ad"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_17_questions.txt",
    "chars": 7379,
    "preview": "--- Day 17: Trick Shot ---\n\nYou finally decode the Elves' message. HI, the message says. You continue searching for the "
  },
  {
    "path": "exm/aoc/2021/aoc_2021_18.txt",
    "chars": 3360,
    "preview": "[[[1,4],[1,6]],[0,[5,[6,3]]]]\n[[[8,2],5],[[[9,8],[3,5]],[2,1]]]\n[[[[6,2],[0,6]],[[9,8],[7,8]]],[[6,3],[[8,8],3]]]\n[[[1,["
  },
  {
    "path": "exm/aoc/2021/aoc_2021_18_full_ada.adb",
    "chars": 7559,
    "preview": "--  Solution to Advent of Code 2021, Day 18\n-------------------------------------------\n--  Snailfish\n--\n--  NB: this do"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_18_questions.txt",
    "chars": 8804,
    "preview": "--- Day 18: Snailfish ---\r\n\r\nYou descend into the ocean trench and encounter some snailfish. They say they saw the sleig"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_19.adb",
    "chars": 10019,
    "preview": "--  Solution to Advent of Code 2021, Day 19\n-------------------------------------------\n--  Beacon Scanner\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_19.txt",
    "chars": 13075,
    "preview": "--- scanner 0 ---\n-812,-728,-591\n-259,678,-532\n735,-470,492\n-808,-734,-657\n518,-635,-807\n-487,402,391\n722,545,-708\n-529,"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_19_questions.txt",
    "chars": 8754,
    "preview": "--- Day 19: Beacon Scanner ---\r\n\r\nAs your probe drifted down through this area, it released an assortment of beacons and"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_20.adb",
    "chars": 4139,
    "preview": "--  Solution to Advent of Code 2021, Day 20\n-------------------------------------------\n--  Trench Map\n--\n--  A Game-of-"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_20.txt",
    "chars": 10614,
    "preview": "#.#.##...###......#.##..#..##....#.#.##...#..###....##...#####.#...#.#.#...#..###..#...#......####..#.#..########.#.###."
  },
  {
    "path": "exm/aoc/2021/aoc_2021_20_questions.txt",
    "chars": 5423,
    "preview": "--- Day 20: Trench Map ---\r\n\r\nWith the scanners fully deployed, you turn their attention to mapping the floor of the oce"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_21.adb",
    "chars": 5907,
    "preview": "--  Solution to Advent of Code 2021, Day 21\n-------------------------------------------\n--  Dirac Dice\n--\n--  https://ad"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_21_questions.txt",
    "chars": 4036,
    "preview": "--- Day 21: Dirac Dice ---\r\n\r\nThere's not much to do as you slowly descend to the bottom of the ocean. The submarine com"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_22.adb",
    "chars": 8298,
    "preview": "--  Solution to Advent of Code 2021, Day 22\n-------------------------------------------\n--  Reactor Reboot\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_22.txt",
    "chars": 20763,
    "preview": "on x=-5..46,y=-32..20,z=-18..26\non x=-47..-1,y=-28..19,z=-49..3\non x=-19..30,y=-22..31,z=-20..33\non x=-27..19,y=-38..7,z"
  },
  {
    "path": "exm/aoc/2021/aoc_2021_22_questions.txt",
    "chars": 6971,
    "preview": "--- Day 22: Reactor Reboot ---\r\n\r\nOperating at these extreme ocean depths has overloaded the submarine's reactor; it nee"
  },
  {
    "path": "exm/aoc/2022/aoc_2022.gpr",
    "chars": 4572,
    "preview": "--  This is a GNAT, GCC or GNAT Studio project file\n--  for the Advent of Code 2022 examples.\n--\n--  Some programs work "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_01.adb",
    "chars": 1724,
    "preview": "--  Solution to Advent of Code 2022, Day 1\n------------------------------------------\n--  Calorie Counting\n--\n--  https:"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_01.txt",
    "chars": 10439,
    "preview": "62797\n\n1137\n6086\n6104\n1895\n7909\n1651\n4973\n6964\n5989\n6003\n6859\n\n2817\n3841\n5360\n2614\n1746\n3507\n1159\n3226\n4541\n1007\n3881\n42"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_01_questions.txt",
    "chars": 3184,
    "preview": "--- Day 1: Calorie Counting ---\n\nSanta's reindeer typically eat regular reindeer food,\nbut they need a lot of magical en"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_02.adb",
    "chars": 3014,
    "preview": "--  Solution to Advent of Code 2022, Day 2\n------------------------------------------\n--  Rock Paper Scissors\n--\n--  htt"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_02.txt",
    "chars": 10000,
    "preview": "A Y\nC Y\nC X\nA Y\nC X\nC Y\nB Z\nA Y\nA Y\nC Z\nA Y\nA Y\nA Y\nC Y\nA Y\nA Y\nA Y\nA X\nB X\nA X\nA Y\nC Y\nC X\nA Y\nA Y\nC Y\nA X\nA Y\nB Z\nA Y\n"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_02_questions.txt",
    "chars": 3562,
    "preview": "--- Day 2: Rock Paper Scissors ---\n\nThe Elves begin to set up camp on the beach.\nTo decide whose tent gets to be closest"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_03.adb",
    "chars": 2808,
    "preview": "--  Solution to Advent of Code 2022, Day 3\n------------------------------------------\n--  Rucksack Reorganization\n--\n-- "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_03.txt",
    "chars": 9712,
    "preview": "shzsFcPssFhjFssBzdpRcNHNZrpdJdJVJZ\nfwvMCntfCCbSbSbtDgDNrDtDtJHZVH\nGbCwwbwwnGrLhBzjFFFsWPhL\nPpCqRsqqmmtCwMJC\nLHFrLLHDSNHl"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_03_questions.txt",
    "chars": 4482,
    "preview": "--- Day 3: Rucksack Reorganization ---\n\nOne Elf has the important job of loading all of the rucksacks with\nsupplies for "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_04.adb",
    "chars": 1770,
    "preview": "--  Solution to Advent of Code 2022, Day 4\n------------------------------------------\n--  Camp Cleanup\n--\n--  https://ad"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_04.txt",
    "chars": 11371,
    "preview": "54-59,17-62\n20-93,57-92\n6-54,7-54\n3-99,59-98\n5-8,5-8\n89-94,32-89\n1-91,1-90\n26-90,91-93\n33-76,21-75\n59-60,19-60\n15-94,15-"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_04_questions.txt",
    "chars": 2641,
    "preview": "--- Day 4: Camp Cleanup ---\n\nSpace needs to be cleared before the last supplies can be unloaded\nfrom the ships, and so s"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_05.adb",
    "chars": 3916,
    "preview": "--  Solution to Advent of Code 2022, Day 5\n------------------------------------------\n--  Supply Stacks\n--\n--  https://a"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_05.txt",
    "chars": 9904,
    "preview": "            [L] [M]         [M]    \n        [D] [R] [Z]         [C] [L]\n        [C] [S] [T] [G]     [V] [M]\n[R]     [L] "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_05_questions.txt",
    "chars": 4091,
    "preview": "--- Day 5: Supply Stacks ---\n\nThe expedition can depart as soon as the final supplies have been\nunloaded from the ships."
  },
  {
    "path": "exm/aoc/2022/aoc_2022_06.adb",
    "chars": 2312,
    "preview": "--  Solution to Advent of Code 2022, Day 6\n------------------------------------------\n--  Tuning Trouble\n--\n--  https://"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_06.txt",
    "chars": 4096,
    "preview": "qhbhzbzzfrzrbzzcjzjrrvcvrvqvvnggnngcgssswbblplrlflfnnnmmjppgddqndnrnlnccpfcfjcjvjdjqqqmhhmwhwmmsnsvsjvjnvjnvjvsjsmjsjccw"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_06_questions.txt",
    "chars": 3387,
    "preview": "--- Day 6: Tuning Trouble ---\n\nThe preparations are finally complete; you and the Elves leave camp\non foot and begin to "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_07.adb",
    "chars": 3905,
    "preview": "--  Solution to Advent of Code 2022, Day 7\n------------------------------------------\n--  No Space Left On Device\n--\n-- "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_07.txt",
    "chars": 10269,
    "preview": "$ cd /\n$ ls\ndir gqlg\ndir hchrwstr\ndir lswlpt\n189381 mzsnhlf\ndir plmdrbn\ndir rjwmjd\ndir stqq\n93174 zfn\ndir zjhqnlrr\ndir z"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_07_questions.txt",
    "chars": 5477,
    "preview": "--- Day 7: No Space Left On Device ---\n\nYou can hear birds chirping and raindrops hitting leaves as\nthe expedition proce"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_08.adb",
    "chars": 6051,
    "preview": "--  Solution to Advent of Code 2022, Day 8\n------------------------------------------\n--  Treetop Tree House\n--\n--  http"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_08.txt",
    "chars": 9900,
    "preview": "102212110110302230012132130441442043243242145112422525112333344240121120342411110001231112222021211\n22210100130201102212"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_08_questions.txt",
    "chars": 4102,
    "preview": "--- Day 8: Treetop Tree House ---\n\nThe expedition comes across a peculiar patch of tall trees\nall planted carefully in a"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_09.adb",
    "chars": 5154,
    "preview": "--  Solution to Advent of Code 2022, Day 9\n------------------------------------------\n--  Rope Bridge\n--\n--  https://adv"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_09.txt",
    "chars": 8392,
    "preview": "L 1\nD 2\nR 1\nL 1\nR 2\nL 1\nU 2\nL 2\nD 1\nL 2\nU 2\nR 2\nD 2\nL 1\nD 2\nU 2\nL 2\nR 2\nL 1\nU 2\nD 2\nU 2\nD 2\nL 1\nR 2\nL 2\nD 2\nR 1\nD 1\nR 2\n"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_09_questions.txt",
    "chars": 13013,
    "preview": "--- Day 9: Rope Bridge ---\n\nThis rope bridge creaks as you walk along it. You aren't sure how\nold it is, or whether it c"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_10.adb",
    "chars": 2164,
    "preview": "--  Solution to Advent of Code 2022, Day 10\n-------------------------------------------\n--  Cathode-Ray Tube\n--\n--  http"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_10.txt",
    "chars": 965,
    "preview": "addx 2\naddx 15\naddx -11\naddx 6\nnoop\nnoop\nnoop\naddx -1\naddx 5\naddx -1\naddx 5\nnoop\nnoop\nnoop\nnoop\nnoop\naddx 7\naddx -1\naddx"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_10_questions.txt",
    "chars": 10100,
    "preview": "--- Day 10: Cathode-Ray Tube ---\n\nYou avoid the ropes, plunge into the river, and swim to shore.\n\nThe Elves yell somethi"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_11.adb",
    "chars": 6433,
    "preview": "--  Solution to Advent of Code 2022, Day 11\n-------------------------------------------\n--  Monkey in the Middle\n--\n--  "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_11.txt",
    "chars": 1278,
    "preview": "Monkey 0:\n  Starting items: 50, 70, 54, 83, 52, 78\n  Operation: new = old * 3\n  Test: divisible by 11\n    If true: throw"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_11_questions.txt",
    "chars": 12528,
    "preview": "--- Day 11: Monkey in the Middle ---\n\nAs you finally start making your way upriver, you realize your pack\nis much lighte"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_12.adb",
    "chars": 9545,
    "preview": "--  Solution to Advent of Code 2022, Day 12\n-------------------------------------------\n--  Hill Climbing Algorithm\n--\n-"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_12.txt",
    "chars": 6642,
    "preview": "abccccccaaccaaccccaaaaacccccaaaaccccccccccccccccccccccccccccccccaaaaaaaaaaaaaaaaaaaccccccccccccccccaaaccccccccccccaacccc"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_12_questions.txt",
    "chars": 3055,
    "preview": "--- Day 12: Hill Climbing Algorithm ---\n\nYou try contacting the Elves using your handheld device, but the\nriver you're f"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_13.adb",
    "chars": 4837,
    "preview": "--  Solution to Advent of Code 2022, Day 13\n-------------------------------------------\n--  Distress Signal\n--\n--  https"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_13.txt",
    "chars": 22503,
    "preview": "[[[],2,9,4],[],[[[],[0]],[[7,0,10,8],[10,5,5,4,1],0,6]],[]]\n[[[8],[3,6,9,[10,4,2],[4,5]],[10,[3],[7,10,7,2],[0,5]],2]]\n\n"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_13_questions.txt",
    "chars": 5645,
    "preview": "--- Day 13: Distress Signal ---\n\nYou climb the hill and again try contacting the Elves.\nHowever, you instead receive a s"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_14.adb",
    "chars": 5235,
    "preview": "--  Solution to Advent of Code 2022, Day 14\n-------------------------------------------\n--  Regolith Reservoir\n--\n--  ht"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_14.txt",
    "chars": 26795,
    "preview": "490,23 -> 490,17 -> 490,23 -> 492,23 -> 492,14 -> 492,23 -> 494,23 -> 494,20 -> 494,23 -> 496,23 -> 496,18 -> 496,23 -> "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_14_questions.txt",
    "chars": 5868,
    "preview": "--- Day 14: Regolith Reservoir ---\n\nThe distress signal leads you to a giant waterfall! Actually, hang on -\nthe signal s"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_15.adb",
    "chars": 6350,
    "preview": "--  Solution to Advent of Code 2022, Day 15\n-------------------------------------------\n--  Beacon Exclusion Zone\n--\n-- "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_15.txt",
    "chars": 2424,
    "preview": "Sensor at x=2899860, y=3122031; closest beacon is at x=2701269, y=3542780\nSensor at x=1836719, y=1116779; closest beacon"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_15_questions.txt",
    "chars": 6080,
    "preview": "--- Day 15: Beacon Exclusion Zone ---\n\nYou feel the ground rumble again as the distress signal leads you to\na large netw"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_16.adb",
    "chars": 12171,
    "preview": "--  Solution to Advent of Code 2022, Day 16\n-------------------------------------------\n--  Proboscidea Volcanium\n--\n-- "
  },
  {
    "path": "exm/aoc/2022/aoc_2022_16.txt",
    "chars": 3353,
    "preview": "Valve GJ has flow rate=14; tunnels lead to valves UV, AO, MM, UD, GM\nValve HE has flow rate=0; tunnels lead to valves QE"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_16_questions.txt",
    "chars": 8142,
    "preview": "--- Day 16: Proboscidea Volcanium ---\n\nThe sensors have led you to the origin of the distress signal: yet\nanother handhe"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_17.adb",
    "chars": 9064,
    "preview": "--  Solution to Advent of Code 2022, Day 17\n-------------------------------------------\n--  Pyroclastic Flow\n--\n--  A gi"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_17.txt",
    "chars": 10092,
    "preview": "><<<>>><<<><<<>>><<>>>><<<>>>><>>>><<<>>><<<<>>><<>>>><<<>>><<<<>>><<<<>>><<<<>>>><<<<>>>><<<<>><<<<><<<<><<<>>>><<<>><<"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_17_questions.txt",
    "chars": 6139,
    "preview": "--- Day 17: Pyroclastic Flow ---\n\nYour handheld device has located an alternative exit from the cave for\nyou and the ele"
  },
  {
    "path": "exm/aoc/2022/aoc_2022_18.adb",
    "chars": 3438,
    "preview": "--  Solution to Advent of Code 2022, Day 18\n-------------------------------------------\n--  Boiling Boulders\n--\n--  http"
  }
]

// ... and 470 more files (download for full content)

About this extraction

This page contains the full source code of the zertovitch/hac GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 670 files (4.3 MB), approximately 1.2M tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!