Alter 9 files
Update `go.mod` Delete `README.md` Add `cookiecutter.json` Add `local_extensions.py` Add `README.md` Rename `challenge.go` to `challenge.go` Rename `info.json` to `info.json` Rename `challenge.nim` to `challenge.nim` Rename `__init__.py` to `__init__.py`
This commit is contained in:
parent
f7b2337886
commit
23696d3877
9 changed files with 30 additions and 5 deletions
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
|||
module github.com/codemicro/adventOfCode
|
||||
|
||||
go 1.17
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/AlecAivazis/survey/v2 v2.3.2
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# [Day <n>: <Day Title>](https://adventofcode.com/<year>/day/<n>)
|
||||
|
12
template/cookiecutter.json
Normal file
12
template/cookiecutter.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"_extensions": ["local_extensions.camel_case"],
|
||||
|
||||
"year": 2022,
|
||||
"dayNumber": 1,
|
||||
"challengeTitle": null,
|
||||
|
||||
"__formattedTitle": "{{ cookiecutter.challengeTitle | title }}",
|
||||
"__camelTitle": "{{ cookiecutter.challengeTitle | camel_case }}",
|
||||
"__formattedDayNumber": "{{ '%02d' | format(cookiecutter.dayNumber|int) }}"
|
||||
}
|
||||
|
14
template/local_extensions.py
Normal file
14
template/local_extensions.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from cookiecutter.utils import simple_filter
|
||||
|
||||
|
||||
@simple_filter
|
||||
def camel_case(v):
|
||||
res = v.split(" ")
|
||||
for i in range(len(res)):
|
||||
f = lambda x: x.upper()
|
||||
if i == 0:
|
||||
f = lambda x: x.lower()
|
||||
|
||||
res[i] = f(res[i][0]) + res[i][1:]
|
||||
|
||||
return "".join(res)
|
|
@ -0,0 +1 @@
|
|||
# [Day {{ cookiecutter.dayNumber }}: {{ cookiecutter.__formattedTitle }}](https://adventofcode.com/{{ cookiecutter.year }}/day/{{ cookiecutter.dayNumber }})
|
|
@ -6,10 +6,10 @@ type Challenge struct {
|
|||
aocgo.BaseChallenge
|
||||
}
|
||||
|
||||
func (c Challenge) One(instr string) (interface{}, error) {
|
||||
func (c Challenge) One(instr string) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c Challenge) Two(instr string) (interface{}, error) {
|
||||
func (c Challenge) Two(instr string) (any, error) {
|
||||
return nil, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue