Skip to content

nrsherr2/advent-of-code-2023-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of code

Problems list:

  1. 01
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07
  8. 08
  9. 09
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20

Creating a new solution

make new creates a new file for today, it checks for the files in src/ and creates the "next int" one. On the first run it will create 01.py, later 02.py, and so on.

A new solution is initialized as follows:

from utils.api import get_input, get_test_input, print_hlight, print_tlight import time current_day = 1 input_str = get_input(current_day) test_str = get_test_input(current_day) def part1(fullInput): print(fullInput) def part2(fullInput): print(fullInput) # solutions corner startTime = time.time() part1Test = part1(test_str) print_hlight(part1(input_str)) part2Test = part2(test_str) print_hlight(part2(test_str)) print_tlight("--- %s seconds ---" % (time.time() - startTime))

The get_input function takes a day and returns the content of the input for that day, this internally makes a request to obtain the input if it is not found on disk.

Running a new solution

From the main directory, run python src/<DAY>.py.

Created via: advent-of-code-setup

About

Forked Advent Of Code Setup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Makefile 0.4%