Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
d4a36ea7dd | |||
d28d99300a | |||
3a403f2cd3 |
10 changed files with 890 additions and 1642 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -5,6 +5,4 @@
|
|||
!early-init.el
|
||||
!init.org
|
||||
!README.org
|
||||
!.gitignore
|
||||
!snippets
|
||||
!snippets/**
|
||||
!.gitignore
|
|
@ -7,8 +7,7 @@
|
|||
;;
|
||||
;; it is possible there are more so probably the most recent one is the one to use.
|
||||
|
||||
(when emacs-build-time
|
||||
(setq elpaca-core-date (format-time-string "%Y%m%d" emacs-build-time)))
|
||||
(setq elpaca-core-date "20241111")
|
||||
(defvar elpaca-installer-version 0.8)
|
||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||
|
@ -52,9 +51,9 @@
|
|||
(elpaca elpaca-use-package
|
||||
(elpaca-use-package-mode))
|
||||
|
||||
;; tangling to generate scripts for the local bin directory. This
|
||||
;; tangling to generate scripts for the local bin directory. This
|
||||
;; causes the name of the scripts to be returned in the car of the
|
||||
;; tangle command which is used to load the file. The net result is
|
||||
;; tangle command which is used to load the file. The net result is
|
||||
;; that not the initialization is loaded, but the first exported
|
||||
;; script.
|
||||
(use-package ob-tangle)
|
||||
|
|
115
org-generate.org
115
org-generate.org
|
@ -1,115 +0,0 @@
|
|||
#+TITLE: Org Generate Boilerplate Templates
|
||||
|
||||
* Introduction
|
||||
|
||||
This document contains boilerplate templates for generating stuff.
|
||||
|
||||
To use use ~M-x org-generate~ and select the template you want to
|
||||
generate.
|
||||
|
||||
Templates start at level 2. Specify the root folder for the generated
|
||||
files.
|
||||
|
||||
Headings with a "/" at the end signify folders to be created to add
|
||||
additional files into.
|
||||
|
||||
You can define variables and use them in the templates using the
|
||||
typical mustache syntax {{variable}}. Variables are defined in the
|
||||
~org-generate-variable~ property in the properties drawer of the the
|
||||
template subtree.
|
||||
|
||||
*IMPORTANT* The code relies on ~#+begin_src~ and ~#+end_src~ blocks to be
|
||||
written in lower case. The code looks for these case sensitively.
|
||||
|
||||
* aoc
|
||||
** common-lisp
|
||||
:PROPERTIES:
|
||||
:org-generate-root: ~/quicklisp/local-projects/aoc
|
||||
:org-generate-variable: year day
|
||||
:END:
|
||||
|
||||
*** src/
|
||||
**** {{year}}/
|
||||
***** day{{day}}.lisp
|
||||
#+begin_src common-lisp
|
||||
|
||||
(defpackage :aoc/2024/{{day}}
|
||||
(:use :cl :aoc :alexandria :trivia :lla)
|
||||
(:export
|
||||
#:sample-data
|
||||
#:sample-data2
|
||||
#:part1
|
||||
#:part2
|
||||
))
|
||||
|
||||
(in-package :aoc/2024/{{day}})
|
||||
|
||||
|
||||
(defun parse-line (line)
|
||||
line)
|
||||
|
||||
|
||||
(defun parse-input (lines)
|
||||
(mapcar #'parse-line lines))
|
||||
|
||||
(defparameter input-text (test-input 2024 {{day}}))
|
||||
(defparameter input-data (parse-input input-text))
|
||||
|
||||
(defparameter sample-text (aoc:split-lines ""))
|
||||
(defparameter sample-data
|
||||
(parse-input sample-text))
|
||||
|
||||
(defun part1 (data)
|
||||
(length data))
|
||||
|
||||
(defun part2 (data)
|
||||
(length data))
|
||||
|
||||
(defun solve-day ()
|
||||
(format t "part1: ~A~%" (part1 input-data))
|
||||
(format t "part2: ~A~%" (part2 input-data)))
|
||||
|
||||
(defun submit ()
|
||||
(let ((p1 (part1 input-data))
|
||||
(p2 (part2 input-data)))
|
||||
(if p1 (submit-part1 {{year}} {{day}} p1))
|
||||
(if p2 (submit-part2 {{year}} {{day}} p2))))
|
||||
#+end_src
|
||||
*** tests/
|
||||
**** {{year}}/
|
||||
***** day{{day}}-test.lisp
|
||||
#+begin_src common-lisp
|
||||
(defpackage :aoc/2024/{{day}}/tests
|
||||
(:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/{{day}}))
|
||||
|
||||
(in-package :aoc/2024/{{day}}/tests)
|
||||
|
||||
(define-test suite-2024-{{day}}
|
||||
;:parent suite-2024
|
||||
)
|
||||
|
||||
(define-test test-foo
|
||||
:parent suite-2024-{{day}}
|
||||
)
|
||||
|
||||
|
||||
(define-test test-bar
|
||||
:parent suite-2024-{{day}}
|
||||
)
|
||||
|
||||
|
||||
|
||||
(define-test+run test-part1
|
||||
:parent suite-2024-{{day}}
|
||||
(is equal nil (part1 sample-data)))
|
||||
|
||||
(define-test+run test-part2
|
||||
:parent suite-2024-{{day}}
|
||||
(is equal nil (part2 sample-data)))
|
||||
|
||||
|
||||
(defun run-tests ()
|
||||
(run-test-suite 'suite-2024-{{day}}))
|
||||
|
||||
#+end_src
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: if-err
|
||||
# key: ife
|
||||
# --
|
||||
if err != nil {
|
||||
$0
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: specc
|
||||
# key: specc
|
||||
# --
|
||||
# $1 Specification Template
|
||||
> Ingest the information from this file, implement the Low-Level Tasks, and generate the code that will satisfy the High and Mid-Level Objectives.
|
||||
|
||||
## High-Level Objective
|
||||
|
||||
- [High level goal goes here - what do you want to build?]
|
||||
|
||||
## Mid-Level Objectives
|
||||
|
||||
- [List of mid-level objectives - what are the steps to achieve the high-level objective?]
|
||||
- [Each objective should be concrete and measurable]
|
||||
- [But not too detailed - save details for implementation notes]
|
||||
|
||||
## Implementation Notes
|
||||
- [Important technical details - what are the important technical details?]
|
||||
- [Dependencies and requirements - what are the dependencies and requirements?]
|
||||
- [Coding standards to follow - what are the coding standards to follow?]
|
||||
- [Other technical guidance - what are other technical guidance?]
|
||||
|
||||
## Context
|
||||
|
||||
### Beginning context
|
||||
- [List of files that exist at start - what files exist at start?]
|
||||
|
||||
### Ending context
|
||||
- [List of files that will exist at end - what files will exist at end?]
|
||||
|
||||
## Low-Level Tasks
|
||||
> Ordered from start to finish
|
||||
|
||||
1. [First task - what is the first task?]
|
||||
```aider
|
||||
What prompt would you run to complete this task?
|
||||
What file do you want to CREATE or UPDATE?
|
||||
What function do you want to CREATE or UPDATE?
|
||||
What are details you want to add to drive the code changes?
|
||||
```
|
||||
2. [Second task - what is the second task?]
|
||||
```aider
|
||||
What prompt would you run to complete this task?
|
||||
What file do you want to CREATE or UPDATE?
|
||||
What function do you want to CREATE or UPDATE?
|
||||
What are details you want to add to drive the code changes?
|
||||
```
|
||||
3. [Third task - what is the third task?]
|
||||
```aider
|
||||
What prompt would you run to complete this task?
|
||||
What file do you want to CREATE or UPDATE?
|
||||
What function do you want to CREATE or UPDATE?
|
||||
What are details you want to add to drive the code changes?
|
||||
```
|
|
@ -1,7 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: source block emacs-lisp
|
||||
# key: <se
|
||||
# --
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
$0
|
||||
#+END_SRC
|
|
@ -1,7 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name Org Mode Title
|
||||
# key: ttl
|
||||
# --
|
||||
#+TITLE: $1
|
||||
|
||||
* $0
|
|
@ -1,7 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: short babel source block
|
||||
# key: <s
|
||||
# --
|
||||
#+BEGIN_SRC $1
|
||||
$0
|
||||
#+END_SRC
|
|
@ -1,11 +0,0 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: use package source block
|
||||
# key: <sup
|
||||
# --
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package $1
|
||||
:ensure t
|
||||
:config
|
||||
(progn
|
||||
$0))
|
||||
#+END_SRC
|
Loading…
Reference in a new issue