Add disarium-number module: loop, String and stream approaches, dry run, counts to 10^8
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# disarium-number
|
||||
|
||||
Disarium number checks in plain Java 25: the original `Math.pow` loop, an integer-power loop, a
|
||||
String version, a Streams version and a `log10` digit-count variant. A test proves they agree, and
|
||||
`output/` holds the transcripts quoted in the post. Companion to
|
||||
[Disarium Number in Java: Program, Algorithm and All Disarium Numbers from 1 to 1000](https://ankurm.com/disarium-number-in-java/).
|
||||
|
||||
## Versions
|
||||
|
||||
| Component | Version |
|
||||
|---|---|
|
||||
| JDK | 25.0.5+8 (Temurin LTS), `--release 25` |
|
||||
| JUnit Jupiter | 6.1.3 |
|
||||
| Maven | 3.9.11 |
|
||||
|
||||
## Run it
|
||||
|
||||
```bash
|
||||
cd disarium-number
|
||||
./scripts/run.sh check # also: list | dryrun | approaches | digits | count
|
||||
mvn test # 6 tests
|
||||
./scripts/run-all.sh # regenerates output/*.txt (count takes ~2 minutes)
|
||||
```
|
||||
|
||||
`count` brute-forces every int up to 10^8; the timing depends on your machine.
|
||||
Reference in New Issue
Block a user