Parsing text output for Advent of Code puzzles
Project description
Advent of Code Optical Character Recognition (adventocr)
Some Advent of Code puzzles provide visual outputs which must be converted into text. This package is a helper to automate this task.
Installation
pip install adventocr
Usage
An example puzzle output may look something like
word = [
'#', '#', '#', '#', ' ', '#', '#', '#', '#', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', '#', '#', ' ', ' ', '#', '#', '#', ' ', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', '#', '#', '#', ' ', '#', ' ', ' ', ' ', ' '
]
When tidied and printed, this appears to be
#### ####
# #
### ###
# #
# #
#### #
This process can be automated through:
import adventocr
parsed = adventocr.word(word)
parsed
'EF'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
adventocr-0.1.tar.gz
(2.9 kB
view hashes)