<commit_before># RSContactGrid

![alt Triangular grid](triangular-grid.png)
![alt Square grid](square-grid.png)
![alt Rotated square grid](rotated-square-grid.png)
![alt Hexagonal grid](hexagonal-grid.png)

## Documentation

## Example project

## Writing your own grid element types

You can easily write your own grid element type by conforming to the `GridElementType` protocol. That means you have to implement:

* `var x: Int { get }`
* `var y: Int { get }`
* `init(x: Int, y: Int)`
* `var vertices: [CGPoint] { get }`
* a more efficient version of `var frame: CGRect { get }` (optional)
* `func intersectsRelativeLineSegment(point1 point1: RelativeRectPoint, point2: RelativeRectPoint) -> Bool`<commit_msg>extended readme<commit_after># RSContactGrid

![alt Triangular grid](triangular-grid.png)
![alt Square grid](square-grid.png)
![alt Rotated square grid](rotated-square-grid.png)
![alt Hexagonal grid](hexagonal-grid.png)

## Example project

You can play with the example project and different grid element types by just switching the typealias for `ElementType` in `GameScene.swift`.

E.g. if you want to play with a triangular grid, just change line 24 in `GameScene.swift` to:

```
typealias ElementType = TriangularElementType
````

## Documentation

## Writing your own grid element types

You can easily write your own grid element type by conforming to the `GridElementType` protocol. That means you have to implement:

* `var x: Int { get }`
* `var y: Int { get }`
* `init(x: Int, y: Int)`
* `var vertices: [CGPoint] { get }`
* a more efficient version of `var frame: CGRect { get }` (optional)
* `func intersectsRelativeLineSegment(point1 point1: RelativeRectPoint, point2: RelativeRectPoint) -> Bool`
{'fraction_non_alphanumeric': 0.11563044741429401, 'fraction_numerical': 0.004648460197559558, 'mean_word_length': 5.194244604316546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1581068', 'n_tokens_mistral': 539, 'n_tokens_neox': 516, 'n_words': 197}