Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidje13/kata-anagrams
My implementation of http://codekata.com/kata/kata06-anagrams/
https://github.com/davidje13/kata-anagrams
Last synced: about 1 month ago
JSON representation
My implementation of http://codekata.com/kata/kata06-anagrams/
- Host: GitHub
- URL: https://github.com/davidje13/kata-anagrams
- Owner: davidje13
- Created: 2018-09-23T16:01:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T10:48:00.000Z (about 6 years ago)
- Last Synced: 2024-10-20T02:39:03.916Z (3 months ago)
- Language: Java
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anagram Finder
Implementation of katas to:
* find anagrams in a list of words
* find n-word anagrams of an input word (up to 3 words)---
The kata specifications are here:
* http://codekata.com/kata/kata06-anagrams/
* http://codingdojo.org/kata/Anagram/## Testing
```sh
./gradlew test
```## Running
### Anagrams
```sh
# Report all anagrams in wordlist
./gradlew run --args='/usr/share/dict/words --length-asc'# Report all multi-word anagrams of the input word
./gradlew run --args='/usr/share/dict/words documenting --words-desc'# Report all words contained within the input word ("countdown"-style)
./gradlew run --args='/usr/share/dict/words documenting --length-asc'
```Identified anagrams will be printed to stdout.
### Equations
```sh
# Combine the given inputs to reach a target
./gradlew run --args='2 7 9 10 25 75 268'
```Any identified equation is printed to stdout.
### Flags
The order of the output can be controlled with the following flags:
* `--words-desc`: sets with the most words first
* `--words-asc`: sets with the most words last
* `--length-desc`: sets with the longest words first
* `--length-asc`: sets with the longest words first## Profiling
The executable can be profiled using:
```sh
./gradlew installDist && time ./build/install/anagrams/bin/anagrams /usr/share/dict/words documenting
```