Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidje13/kata-7-segment

My implementation of http://codingdojo.org/kata/NumberToLCD/
https://github.com/davidje13/kata-7-segment

Last synced: about 1 month ago
JSON representation

My implementation of http://codingdojo.org/kata/NumberToLCD/

Awesome Lists containing this project

README

        

# 7Seg

Implementation of a kata to display input in a 7-segment display style via ASCII output.

Prints the input string as an ASCII representation of a 7-segment display, for example:

```
_ _ _
0123 -> | | | _| _|
|_| | |_ _|

___
| | | |
abcd -> |___| |___ ___ ___| (size 3x2)
| | | | | | |
| | |___| |___ |___|
```

---

The kata specification is here: http://codingdojo.org/kata/NumberToLCD/

## Testing

```sh
./gradlew test
```

## Running

```sh
./gradlew run --args=0123
./gradlew run --args='--size=3x2 0123'
./gradlew run --args='--size=3x2 -- --hi'
```

To operate in reverse:

```sh
./gradlew installDist && ./build/install/seg7/bin/seg7 --reverse
___
| | | |
|___| |___ ___ ___|
| | | | | | |
| | |___| |___ |___|
[Ctrl+D]
```

or pipe input directly:

```sh
./gradlew installDist
./build/install/seg7/bin/seg7 --reverse <<< '
___
| | | |
|___| |___ ___ ___|
| | | | | | |
| | |___| |___ |___|
'
```

or check reversibility:

./build/install/seg7/bin/seg7 hello | ./build/install/seg7/bin/seg7 --reverse