Skip to content

Commit dfb87cc

Browse files
committed
Start building out Aider-style benchmark infra
1 parent 047ddf7 commit dfb87cc

40 files changed

+951
-0
lines changed

benchmark/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
repos/*
2+
!repos/.gitkeep

benchmark/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Get the exercises from exercism:
2+
3+
````sh
4+
gh repo clone exercism/typescript repos/typescript
5+
# Same idea for python, ruby, go, rust, etc.
6+
# gh repo clone exercism/python repos/python
7+
find . -name ".vscode" | xargs rm -rf```
8+
````
9+
10+
Prepare an exercise:
11+
12+
```sh
13+
LANG=typescript
14+
EXERCISE=flatten-array
15+
16+
cp -rf repos/$LANG/exercises/practice/$EXERCISE $LANG
17+
sed -i 's/\bxit(/it(/g' $LANG/$EXERCISE/*.test.ts
18+
19+
echo "# Task
20+
21+
Complete the implementation in \`$EXERCISE.ts\`.
22+
23+
$(cat $LANG/$EXERCISE/.docs/instructions.md)
24+
25+
# Confirmation
26+
27+
To confirm that your solution is correct, run the tests with \`yarn test\`.
28+
You might need to install the dependencies first with \`yarn install\`." > $LANG/$EXERCISE/.docs/prompt.md
29+
```
30+
31+
TODO: The prompt is language dependent, so let's create a template for each language. The example above is for typescript.

benchmark/go/.gitkeep

Whitespace-only changes.

benchmark/python/.gitkeep

Whitespace-only changes.

benchmark/repos/.gitkeep

Whitespace-only changes.

benchmark/ruby/.gitkeep

Whitespace-only changes.

benchmark/rust/.gitkeep

Whitespace-only changes.

benchmark/typescript/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Instructions Append
2+
3+
The anagrams can be returned in any order.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Instructions
2+
3+
Your task is to, given a target word and a set of candidate words, to find the subset of the candidates that are anagrams of the target.
4+
5+
An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`.
6+
A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`.
7+
8+
The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
9+
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`.
10+
The anagram set is the subset of the candidate set that are anagrams of the target (in any order).
11+
Words in the anagram set should have the same letter case as in the candidate set.
12+
13+
Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, `"Seton"`, the anagram set is `"tones"`, `"notes"`, `"Seton"`.

0 commit comments

Comments
 (0)