Skip to content

Commit 04de276

Browse files
committed
Expand readme
1 parent b2d646e commit 04de276

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build/
2+
pi

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
# Pi Estimation
22

3-
Estimates the value of π using a Monte Carlo simulation.
3+
Estimates the value of π using the [Monte Carlo method](https://en.wikipedia.org/wiki/Monte_Carlo_method).
44

55
## Method
66

77
We generate random points within the unit square and count how many fall within a circle of radius 1 centered at the origin.
88
The ratio of the number of points within the circle to the total number of points approaches π/4.
99

1010
![Illustration of a Monte Carlo simulation](./readme_images/monte-carlo.svg)
11+
12+
## Run Estimation
13+
14+
Build and run an estimation with the default configuration.
15+
16+
```shell
17+
go build ./cmd/pi
18+
./pi
19+
```
20+
21+
Use the `--help` flag to see configuration options.
22+
23+
```shell
24+
./pi --help
25+
```
26+
27+
## Development
28+
29+
1. Run tests
30+
```shell
31+
go test ./...
32+
```
33+
34+
1. Check formatting
35+
```shell
36+
gofmt -d .
37+
```
38+
39+
1. Check linking
40+
```shell
41+
go vet ./...
42+
```

0 commit comments

Comments
 (0)