Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/speelbarrow/kmap
A program for generating k-maps based on user input.
https://github.com/speelbarrow/kmap
bdd cli command-line command-line-tool cucumber gherkin go go117 godog golang golang117 k-map karnaugh-map kmap
Last synced: 28 days ago
JSON representation
A program for generating k-maps based on user input.
- Host: GitHub
- URL: https://github.com/speelbarrow/kmap
- Owner: speelbarrow
- License: epl-2.0
- Created: 2021-10-25T13:40:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-31T15:26:25.000Z (over 2 years ago)
- Last Synced: 2024-11-13T22:34:57.787Z (29 days ago)
- Topics: bdd, cli, command-line, command-line-tool, cucumber, gherkin, go, go117, godog, golang, golang117, k-map, karnaugh-map, kmap
- Language: Go
- Homepage:
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - kmap - maps based on user input. (Repositories)
README
# kmap [![CI/CD](https://github.com/noah-friedman/kmap/actions/workflows/CICD.yml/badge.svg)](https://github.com/noah-friedman/kmap/actions/workflows/CICD.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/noah-friedman/kmap.svg)](https://pkg.go.dev/github.com/noah-friedman/kmap)
A program for generating [k-maps](https://en.wikipedia.org/wiki/Karnaugh_map) based on user input.
### EXAMPLES
```shell
> kmap
What is the size of the k-map? (3):
3
What are the arguments to the k-map?:
0,1,6,7
What are the don`t care conditions of of the k-map?:
2, 4
y
-----------------
| 1 | 1 | 0 | X |
-----------------
x | X | 0 | 1 | 1 |
-----------------
z
```
```shell
> kmap -s 2 -a '1, 2' -dc ''
y
---------
| 0 | 1 |
---------
x | 1 | 0 |
---------
```### INSTALLATION
- With Go 1.17+ installed:
```shell
> go install github.com/noah-friedman/kmap/bin/kmap@latest
```- Without Go 1.17+ installed:
See [Releases](https://github.com/noah-friedman/kmap/releases) for pre-compiled binaries.### USAGE
After running the `kmap` program the user is prompted for three inputs:
- The size of the k-map (a.k.a. the number of variables in the k-map)
Valid: [2-4]
- The arguments of the k-mapValid: [0-2size)
- The don't care conditions of the k-map
Valid: [0-2size)**NOTE**: The arguments and don't care conditions must not overlap.
When inputting the arguments of the k-map the user may provide a series of valid numbers seperated by any characters as long as each separation contains the *same* characters. Otherwise, an error will occur.
Instead of inputting parameters directly, the user may provide arguments to the `kmap` program:
- `-s` or `-size` for the size parameter
- `-a` or `-args` for the arguments to the k-map
- `-dc` or `-dont-care` for the don't care conditions of the k-map### EXIT CODES
- `0`: Everything went fine, the program executed successfully
- `1`: Some kind of bug or error in the way I wrote the program.
- `2`: Some kind of bug in a library called by the program (possibly due to a misunderstanding of the library on my part).