Skip to content

Commit 817e3d7

Browse files
committed
docs: Add Quick Start guide and improve Geometry section documentation
1 parent 2726165 commit 817e3d7

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

README.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22

33
This repository contains templates of useful algorithms and data structures coded in C++ for use in competitive programming.
44

5+
## Quick Start
6+
7+
### Automatic Snippet Generation
8+
9+
This repository includes scripts to automatically generate code snippets for your editor:
10+
11+
#### For VS Code
12+
```bash
13+
python3 generate_vscode_snippets.py
14+
```
15+
16+
This script automatically:
17+
- Scans all `.cpp` files in the subdirectories
18+
- Generates VS Code snippets in `cpp.json`
19+
- Places them in your VS Code user snippets directory:
20+
- **Windows**: `%APPDATA%\Code\User\snippets\cpp.json`
21+
- **Linux**: `~/.config/Code/User/snippets/cpp.json`
22+
- **macOS**: `~/Library/Application Support/Code/User/snippets/cpp.json`
23+
- Replaces Vim date placeholders with VS Code variables for template files
24+
25+
#### For Vim/Neovim (UltiSnips)
26+
```bash
27+
bash generate_snippets.sh
28+
```
29+
30+
This script:
31+
- Searches for all `.cpp` files recursively
32+
- Generates UltiSnips format snippets
33+
- Outputs to `~/.vim/UltiSnips/cpp/cpp_generate.snippets`
34+
- Each snippet is prefixed with the filename (without extension)
35+
36+
After running the appropriate script, you can use any algorithm by typing its prefix (e.g., `graph_dijkstra_std`) and triggering your editor's autocomplete.
37+
538
## Contents
639

740
`Command` - Description
@@ -28,12 +61,17 @@ This repository contains templates of useful algorithms and data structures code
2861
* `misc_unique` - Remove duplicate values from a vector.
2962
* `misc_y_combinator` - Allows you to define a recursive Lambda function.
3063

31-
* **Geometry**
32-
* `2d_geometry_point` - Class Point.
33-
* `2d_geometry_polygon` - Class Polygon.
34-
* `2d_geometry_area` - Algorithm that calculates the area of a polygon.
35-
* `2d_geometry_perimeter` - Algorithm that calculates the perimeter of a polygon.
36-
* `2d_geometry_convex_hull_mc` - Convex Hull (Monotone Chain) algorithm.
64+
## Geometry
65+
66+
A collection of 2D computational geometry algorithms and data structures for geometric calculations and operations.
67+
68+
### Components
69+
70+
- **`2d_geometry_point`** - Point representation in 2D space with basic operations
71+
- **`2d_geometry_polygon`** - Polygon data structure for managing collections of points
72+
- **`2d_geometry_area`** - Computes the area of a polygon using the shoelace formula
73+
- **`2d_geometry_perimeter`** - Calculates the total perimeter length of a polygon
74+
- **`2d_geometry_convex_hull_mc`** - Finds the convex hull using the Monotone Chain algorithm (Andrew's algorithm)
3775

3876
* **Math**
3977
* `math_check_prime` - Primality test of a number.

0 commit comments

Comments
 (0)