add --kind flag, it allows you to configure the lottery kind directly, skipping the selection prompt

update the README with more examples.
This commit is contained in:
2026-07-24 13:11:56 +01:00
parent 3f0af6e5ec
commit 1310447664
4 changed files with 65 additions and 26 deletions

View File

@@ -8,8 +8,8 @@ import (
// drawUnique returns count unique numbers in the range [1, max].
// It uses the rand.Perm function to generate a random permutation of numbers and selects the first count numbers from it.
// The result is sorted before being returned.
func drawUnique(count, max int) []int {
perm := rand.Perm(max)
func drawUnique(count, maxNum int) []int {
perm := rand.Perm(maxNum)
result := make([]int, count)
for i := range result {
result[i] = perm[i] + 1