initial setup

sander
Sander 2025-11-25 18:46:53 +00:00
parent 0c3541d98a
commit 01a11ad970
1 changed files with 31 additions and 1 deletions

View File

@ -1 +1,31 @@
-- Day 1 -- AOC 2025 - Sander
-- so for those wondering about how I run this Haskell code, here's the setup:
-- 1) install GHCup as instructed from https://www.haskell.org/ghcup/
-- 2) save this haskell file and your AOC input file in some directory on your computer
-- 3) rewrite the "main" function with the location of your AOC input file
-- 4) rewrite "print contents" in the "main" function to use the function(s) you've made to process the input file ("contents") from that day correctly
-- 5) run Command Prompt, go to the directory of your files (with "cd" command) and run the command "ghci AOC2025.hs"
-- 6) run command "main"
-- 7) if your functions are correct, you'll get the correct answer!
import System.IO
import Control.Monad
main :: IO()
main = do handle <- openFile "C:/Users/[your directory here]/d1.txt" ReadMode
contents <- hGetContents handle
print contents
hClose handle
-- Day 1: ...
-- Part One
doday1_1 :: String -> String
doday1_1 input = undefined
-- Part Two
doday1_2 :: String -> String
doday1_2 input = undefined