https://github.com/lotharschulz/armstrongnumbers
armstrongNumbers
https://github.com/lotharschulz/armstrongnumbers
armstrong clojure java kotlin number python scala typescript
Last synced: 9 months ago
JSON representation
armstrongNumbers
- Host: GitHub
- URL: https://github.com/lotharschulz/armstrongnumbers
- Owner: lotharschulz
- Created: 2016-05-16T21:26:53.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T22:15:21.000Z (about 1 year ago)
- Last Synced: 2024-10-30T23:19:08.363Z (about 1 year ago)
- Topics: armstrong, clojure, java, kotlin, number, python, scala, typescript
- Language: Java
- Homepage:
- Size: 589 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# [Armstrong Numbers](https://en.wikipedia.org/wiki/Narcissistic_number) implementations
with different programming languages.
## Why?
This repo are coding finger exercises with different languages using [narcissistic/armstrong numbers](https://en.wikipedia.org/wiki/Narcissistic_number). It is mainly about getting familiar with the different languages.
You can also discover language similarities and differences based on the use case.
## java
#### run
```sh
mvn exec:java -Dexec.mainClass="info.lotharschulz.App"
```
#### test
```sh
mvn [clean] test
```
## scala
#### run
```sh
sbt "run-main info.lotharschulz.App"
```
#### test
```sh
sbt [clean] test
```
##### triggered clean tests
```sh
~ ;clean ;test # triggered clean tests
```
## python
#### run
```sh
python armstrong/armstrong.py
```
#### test
```sh
cd test
python test_armstrong.py
```
## clojure
#### run
```sh
lein run
```
#### test
```sh
lein test
```
##### triggered test
prerequsite: [lein-midje](https://github.com/marick/lein-midje) plugin installed
```sh
lein midje :autotest
```
## typescript
#### run
```sh
tsc armstrong.ts && node armstrong.js
```
#### test
```sh
yarn test
```
#### lint
```sh
yarn lint
yarn lint:ci
```
## kotlin
#### run
```sh
./gradlew run
```
#### test
```sh
./gradlew test
```
#### lint
```sh
./gradlew ktlintCheck
```
#### static code analysis
##### detekt
```sh
./gradlew detekt
```
##### mobsfscan
```sh
# installation - pip3 install mobsfscan
mobsfscan src/
```
## go (golang)
#### run
```sh
go run armstrong.go
```
#### test
```sh
go test
go test -v --bench . --benchmem
```
#### format
```sh
gofmt -w armstrong.go
gofmt -w armstrong_test.go
```
## rust
#### run
```sh
cargo run
```
#### test
```sh
cargo test
```