https://github.com/webcpu/findsymmetricpoems
Find Symmetric Poems
https://github.com/webcpu/findsymmetricpoems
golang magic-square matrix parallel-programming poetry symmetric-matrix
Last synced: 9 months ago
JSON representation
Find Symmetric Poems
- Host: GitHub
- URL: https://github.com/webcpu/findsymmetricpoems
- Owner: webcpu
- Created: 2021-07-10T14:36:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-14T21:33:15.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T19:35:54.339Z (about 1 year ago)
- Topics: golang, magic-square, matrix, parallel-programming, poetry, symmetric-matrix
- Language: Go
- Homepage:
- Size: 2.51 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Find Symmetric Poems

I got inspirations from https://github.com/LingDong-/magic-square-poems .
"Observe the above 5x5 matrix of Chinese characters: when read horizontally, it consists of five lines from five different poems, and so does it when read vertically, of the exact same lines. "
I prefer symmetric matrix but not magic matrix, because I think it's a symmetric matrix.
Observe that when a matrix is symmetric, as in these cases, the matrix is equal to its transpose.
To solve this problem, I implemented a quicker parallel alogorithm. It only takes 36 seconds to find the symmetric poems.
*Run*
```
go run main.go
```
*Output*
```
❯ go run main.go
风月清江夜
月出夜山深
清夜方归来
江山归谢客
夜深来客稀
心如七十人
如何十年间
七十未成事
十年成底事
人间事事慵
[[风月清江夜 月出夜山深 清夜方归来 江山归谢客 夜深来客稀] [心如七十人 如何十年间 七十未成事 十年成底事 人间事事慵]]
~/go/src/FindSymmetricPoems 36s
```