Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deepenpatel19/golang-test
https://github.com/deepenpatel19/golang-test
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/deepenpatel19/golang-test
- Owner: deepenpatel19
- Created: 2020-07-10T05:14:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T05:27:48.000Z (over 4 years ago)
- Last Synced: 2024-07-28T13:52:28.518Z (5 months ago)
- Language: Go
- Size: 1.28 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Golang Test - Find 2D Rectangel Intersection
Example (in terminal):
1) When Intersection possible.
```
./golang_test test.json
```
Output:
```
Input:
1: Rectangle at (100,100), w=250, h=80.
2: Rectangle at (120,200), w=250, h=150.
3: Rectangle at (140,160), w=250, h=100.
4: Rectangle at (160,140), w=350, h=190.
Intersections:
1 Between rectangle 1 and 3, at (140, 160), w=210, h=20.
2 Between rectangle 1 and 4, at (160, 140), w=190, h=40.
3 Between rectangle 2 and 3, at (140, 200), w=230, h=60.
4 Between rectangle 2 and 4, at (160, 200), w=210, h=130.
5 Between rectangle 3 and 4, at (160, 160), w=230, h=100.
6 Between rectangle 1, 3 and 4, at (160, 160), w=190, h=20.
7 Between rectangle 2, 3 and 4, at (160, 200), w=210, h=60.
```2) When file not found in command line argument
```
./golang_test
```
Output:
```
File name not found in arguments.
```3) When wrond formatted JSON file.
```
./golang_test error_file.json
```Output:
```
JSON file not in proper format.
```