https://github.com/rodmoioliveira/collatz
collatz is a CLI for printing the hailstone sequence of a number.
https://github.com/rodmoioliveira/collatz
collatz-algorithm collatz-conjecture collatz-problem collatz-sequences hailstone-numbers hailstone-sequence hailstone-series
Last synced: 4 months ago
JSON representation
collatz is a CLI for printing the hailstone sequence of a number.
- Host: GitHub
- URL: https://github.com/rodmoioliveira/collatz
- Owner: rodmoioliveira
- License: mit
- Created: 2023-10-19T17:39:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-25T13:12:09.000Z (5 months ago)
- Last Synced: 2025-10-11T15:25:23.006Z (4 months ago)
- Topics: collatz-algorithm, collatz-conjecture, collatz-problem, collatz-sequences, hailstone-numbers, hailstone-sequence, hailstone-series
- Language: Rust
- Homepage: https://rodmoioliveira.github.io/collatz/
- Size: 210 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# collatz
collatz is a CLI for printing the [hailstone sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) of a number.
[](https://github.com/rodmoioliveira/collatz/actions)
[](https://github.com/rodmoioliveira/collatz/releases)
# index
- [Installation](#installation)
- [Building](#building)
- [Usage](#usage)
- [Dependencies](#dependencies)
- [Make Recipes](#make-recipes)
- [How to Release](#how-to-release)
# Installation
[back^](#index)
Archives of [precompiled binaries](https://github.com/rodmoioliveira/collatz/releases)
for `collatz` are available for Windows, macOS and Linux.
# Building
[back^](#index)
`collatz` is written in Rust, so you'll need to grab a [Rust installation](https://www.rust-lang.org/tools/install)
in order to compile it. To build `collatz`, run:
```
git clone git@github.com:rodmoioliveira/collatz.git
cd collatz
make rs-build
```
# Usage
[back^](#index)
```
collatz --help
Prints the hailstone sequence of a number
Usage: collatz
Arguments:
A positive integer between 0 and 340282366920938463463374607431768211455
Options:
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```
# Dependencies
[back^](#index)
- [clap](https://crates.io/crates/clap) - A simple to use, efficient, and full-featured Command Line Argument Parser
- [clap_complete](https://crates.io/crates/clap_complete) - Generate shell completion scripts for your clap::Command
- [libc](https://crates.io/crates/libc) - Raw FFI bindings to platform libraries like libc.
- [num](https://crates.io/crates/num) - A collection of numeric types and traits for Rust, including bigint,
# Make Recipes
[back^](#index)
```
bash-all Run all bash tests
bash-check Check format bash code
bash-deps Install bash dependencies
bash-fmt Format bash code
bash-lint Check lint bash code
comments-tidy Tidy comments within code
doc-changelog Write CHANGELOG.md
doc-readme Write README.md
dprint-check Dprint check
dprint-fmt Dprint format
help Display this help screen
makefile-descriptions Check if all Makefile rules have descriptions
rs-audit Audit Cargo.lock
rs-audit-fix Update Cargo.toml to fix vulnerable dependency requirement
rs-build Build binary
rs-cargo-deps Install cargo dependencies
rs-check Run check
rs-dev Run check in watch mode
rs-doc Open app documentation
rs-fix Fix rust code
rs-fmt Format rust code
rs-fmt-fix Format fix rust code
rs-install Install binary
rs-lint Lint rust code
rs-lint-fix Fix lint rust code
rs-outdated Display when dependencies are out of date
rs-tests Run tests
rs-uninstall Uninstall binary
rs-update-cargo Update dependencies
rs-update-rustup Update rust
typos Check typos
typos-fix Fix typos
```
# How to Release
[back^](#index)
To generate a new version, you need to follow these steps:
1. In the `main` branch, you must bump the version inside the `Cargo.toml` file.
2. Run `make rs-check` so that the version is changed in the `Cargo.lock` file.
3. Run the command `git add -A && git commit -m "release: bump version"`.
4. Run the command `git tag -a -m "version "`.
5. Run the command `make doc-changelog && make doc-readme`.
6. Run the command `git add -A && git commit -m "release: "`.
7. Run `git push` to `main`.