Skip to content

Commit

Permalink
Merge pull request #58 from teogor/release/1.0.0-beta01
Browse files Browse the repository at this point in the history
Prepare release 1.0.0-beta01
  • Loading branch information
teogor authored Feb 21, 2024
2 parents 22fddbe + 5d94fff commit 9e0debb
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- name: Check out code
uses: actions/checkout@v3.1.0

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3.5.1
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Grant Permission to Execute Gradle
run: chmod +x gradlew
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 🧩 Sudoklify 🧩

## Overview

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.sudoklify/sudoklify-core.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.sudoklify+a%3Asudoklify-core&smo=true)
[![Profile](https://source.teogor.dev/badges/teogor-github.svg)](https://github.com/teogor)
[![Open-Source Directory](https://source.teogor.dev/badges/teogor-dev.svg)](https://source.teogor.dev)

## A Powerful Sudoku Puzzle Generation Library

🧩 Sudoklify is a versatile and intuitive Sudoku puzzle generation library written in Kotlin. It
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ winds {
)

version = createVersion(1, 0, 0) {
alphaRelease(4)
betaRelease(1)
}

project.version = version!!.toString()
Expand Down
3 changes: 1 addition & 2 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.jetbrains.kotlin.jvm)
id("application")
Expand All @@ -28,6 +26,7 @@ application {
dependencies {
implementation(project(mapOf("path" to ":sudoklify-common")))
implementation(project(mapOf("path" to ":sudoklify-core")))
implementation(project(mapOf("path" to ":sudoklify-ktx")))
implementation(project(mapOf("path" to ":sudoklify-seeds")))

implementation(libs.kotlin.stdlib)
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## 🧩 Sudoklify 🧩

### Overview
## Overview

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.sudoklify/sudoklify.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.sudoklify+a%3Asudoklify&smo=true)
[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.sudoklify/sudoklify-core.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.sudoklify+a%3Asudoklify-core&smo=true)
[![Profile](https://source.teogor.dev/badges/teogor-github.svg)](https://github.com/teogor)
[![Open-Source Directory](https://source.teogor.dev/badges/teogor-dev.svg)](https://source.teogor.dev)

Expand Down Expand Up @@ -120,7 +120,7 @@ detailed explanations, examples, and best practices for using the library effect
## License

```xml
Designed and developed by 2023 teogor (Teodor Grigor)
Designed and developed by 2023 teogor (Teodor Grigor)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
56 changes: 51 additions & 5 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sizes and difficulty levels.

| Latest Update | Stable Release | Beta Release | Alpha Release |
|:-----------------:|:--------------:|:------------:|:-------------:|
| February 08, 2024 | - | - | 1.0.0-alpha04 |
| February 21, 2024 | - | 1.0.0-beta01 | - |

### Declaring dependencies

Expand All @@ -33,19 +33,25 @@ Add the dependencies for the artifacts you need in the `build.gradle` file for y

```kotlin
dependencies {
val sudoklify_version = "1.0.0-alpha04"
val sudoklifyVersion = "1.0.0-beta01"

implementation("dev.teogor.sudoklify:sudoklify:sudoklify_version")
implementation("dev.teogor.sudoklify:sudoklify-common:$sudoklifyVersion")
implementation("dev.teogor.sudoklify:sudoklify-core:$sudoklifyVersion")
implementation("dev.teogor.sudoklify:sudoklify-ktx:$sudoklifyVersion")
implementation("dev.teogor.sudoklify:sudoklify-seeds:$sudoklifyVersion")
}
```

=== "Groovy"

```groovy
dependencies {
def sudoklify_version = "1.0.0-alpha04"
def sudoklifyVersion = "1.0.0-beta01"

implementation("dev.teogor.sudoklify:sudoklify:${sudoklify_version}")
implementation "dev.teogor.sudoklify:sudoklify-common:$sudoklifyVersion"
implementation "dev.teogor.sudoklify:sudoklify-core:$sudoklifyVersion"
implementation "dev.teogor.sudoklify:sudoklify-ktx:$sudoklifyVersion"
implementation "dev.teogor.sudoklify:sudoklify-seeds:$sudoklifyVersion"
}
```

Expand All @@ -61,6 +67,46 @@ existing issue by clicking the star button.

### Version 1.0.0

#### Version 1.0.0-beta01

February 21, 2024

`dev.teogor.sudoklify:sudoklify-*:1.0.0-beta01` is
released. [Version 1.0.0-beta01 contains these commits.](https://github.com/teogor/sudoklify/compare/1.0.0-alpha04...1.0.0-beta01)

**Enhancement**

* Enhance Sudoku generation with improved combinedSeeds and seed-based
tests ([#55](https://github.com/teogor/sudoklify/pull/55)) by [@teogor](https://github.com/teogor)
* Enable easier string conversion with default mappers in Sudoku board
functions ([#53](https://github.com/teogor/sudoklify/pull/53))
by [@teogor](https://github.com/teogor)
* Enable encoding and decoding Sudoku boards to/from
strings ([#52](https://github.com/teogor/sudoklify/pull/52))
by [@teogor](https://github.com/teogor)
* Introduce `SudokuType` sealed class ([#51](https://github.com/teogor/sudoklify/pull/51))
by [@teogor](https://github.com/teogor)
* Refactor `Seed` type to sealed class for improved safety and
organization ([#49](https://github.com/teogor/sudoklify/pull/49))
by [@teogor](https://github.com/teogor)
* Enhance `Tokenizer` with sealed class structure and improved token
handling ([#48](https://github.com/teogor/sudoklify/pull/48))
by [@teogor](https://github.com/teogor)
* Enhance `SudokuParams.createPuzzle()` by introducing `SudokuPuzzle` data
class ([#46](https://github.com/teogor/sudoklify/pull/46)) by [@teogor](https://github.com/teogor)

**Bug Fixes**

* Improved accuracy and reliability of BoardCell conversions with comprehensive
testing ([#54](https://github.com/teogor/sudoklify/pull/54))
by [@teogor](https://github.com/teogor)

**Others**

* Upgrade JVM Target Compatibility to Java 17 (
Kotlin) ([#56](https://github.com/teogor/sudoklify/pull/56))
by [@teogor](https://github.com/teogor)

#### Version 1.0.0-alpha04

February 08, 2024
Expand Down
12 changes: 12 additions & 0 deletions docs/releases/changelog/1.0.0-beta01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[//]: # (This file was automatically generated - do not edit)

# Version 1.0.0-beta01

## Latest SDK versions

| Status | Service or Product | Gradle dependency | Latest version |
|:------:|:--------------------------------------------------:|:-------------------------------------:|:--------------:|
| 🛠️ | [Sudoklify Common](../../../html/sudoklify-common) | dev.teogor.sudoklify:sudoklify-common | 1.0.0-beta01 |
| 🛠️ | [Sudoklify Core](../../../html/sudoklify-core) | dev.teogor.sudoklify:sudoklify-core | 1.0.0-beta01 |
| 🛠️ | [Sudoklify KTX](../../../html/sudoklify-ktx) | dev.teogor.sudoklify:sudoklify-ktx | 1.0.0-beta01 |
| 🛠️ | [Sudoklify Seeds](../../../html/sudoklify-seeds) | dev.teogor.sudoklify:sudoklify-seeds | 1.0.0-beta01 |
20 changes: 15 additions & 5 deletions docs/releases/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

### Latest Version

The latest release is [`1.0.0-alpha04`](../releases.md)
The latest release is [`1.0.0-beta01`](../releases.md)

### Releases

Here's a summary of the latest versions:

| Version | Release Notes | Release Date |
|:-------------:|:------------------------------------------:|:------------:|
| 1.0.0-beta01 | [changelog 🔗](changelog/1.0.0-beta01.md) | 21 Feb 2024 |
| 1.0.0-alpha04 | [changelog 🔗](changelog/1.0.0-alpha04.md) | 08 Feb 2024 |
| 1.0.0-alpha03 | [changelog 🔗](changelog/1.0.0-alpha03.md) | 21 Sep 2023 |
| 1.0.0-alpha02 | [changelog 🔗](changelog/1.0.0-alpha02.md) | 25 Aug 2023 |
Expand All @@ -28,10 +29,13 @@ libraries, in TOML format.

```toml title="gradle/libs.versions.toml"
[versions]
sudoklify = "1.0.0-alpha04"
teogor-sudoklify = "1.0.0-beta01"

[libraries]
sudoklify = { group = "dev.teogor.sudoklify", name = "sudoklify", version.ref = "sudoklify" }
teogor-sudoklify-common = { module = "dev.teogor.sudoklify:sudoklify-common", version.ref = "teogor-sudoklify" }
teogor-sudoklify-core = { module = "dev.teogor.sudoklify:sudoklify-core", version.ref = "teogor-sudoklify" }
teogor-sudoklify-ktx = { module = "dev.teogor.sudoklify:sudoklify-ktx", version.ref = "teogor-sudoklify" }
teogor-sudoklify-seeds = { module = "dev.teogor.sudoklify:sudoklify-seeds", version.ref = "teogor-sudoklify" }
```

#### Dependencies Implementation
Expand All @@ -41,7 +45,10 @@ libraries, in TOML format.
```kotlin title="build.gradle.kts"
dependencies {
// Sudoklify Library
implementation(libs.sudoklify)
implementation(libs.teogor.sudoklify.common)
implementation(libs.teogor.sudoklify.core)
implementation(libs.teogor.sudoklify.ktx)
implementation(libs.teogor.sudoklify.seeds)
}
```

Expand All @@ -50,6 +57,9 @@ libraries, in TOML format.
```groovy title="build.gradle"
dependencies {
// Sudoklify Library
implementation(libs.sudoklify)
implementation libs.teogor.sudoklify.common
implementation libs.teogor.sudoklify.core
implementation libs.teogor.sudoklify.ktx
implementation libs.teogor.sudoklify.seeds
}
```
44 changes: 5 additions & 39 deletions docs/seed.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Managing Randomness for Sudoku Generation
# Managing Randomness for Sudoku Generation

This documentation explores the `Seed` class in the `sudoklify` library, a powerful tool for
controlling and customizing the randomness of your Sudoku puzzles. `Seed` offers a safe and
structured way to handle different types of seeds, ensuring reproducible and consistent puzzle
generation while providing flexibility and control.

## Key Benefits:
## **Key Benefits**

* **Type Safety and Validation:** Guarantees valid seed values, preventing errors and unexpected
behavior.
Expand All @@ -16,47 +16,14 @@ generation while providing flexibility and control.
* **Reproducible Puzzles:** Generate consistent Sudoku grids using the same seed for sharing or
testing purposes.

## Understanding Seed Types:
## **Understanding Seed Types**

* **`Random`:** Generates a new seed based on the system's random number generator, ensuring
different puzzles each time.
* **`Explicit`:** Allows you to specify a specific long value as the seed, enabling precise control
over the generated puzzle.

## Example: Generating a Sudoku with a Specific Seed:

```kotlin
// Create an explicit seed with value 42
val puzzleSeed = 42.toSeed()

// Use the seed to generate a Sudoku puzzle
val sudoku = generateSudoku(puzzleSeed)

// Solve the generated Sudoku
solveSudoku(sudoku)

// Share or test the puzzle using the seed for reproducibility
```

This revised documentation focuses on the specific context of Sudoku generation within
the `sudoklify` library, providing clearer explanations and specific examples relevant to its
intended use. Remember to replace the placeholder functions `generateSudoku` and `solveSudoku` with
the actual functions from your library.

I hope this enhanced documentation better serves your needs and informs users effectively about
the `Seed` class in the `sudoklify` library.


---

## **Overview:**

The `Seed` class is a sealed class with two subclasses:

* **`Random`:** Represents a seed generated using the system's random number generator.
* **`Explicit`:** Represents a seed with a specific long value provided by the user.

## **Key features:**
## **Key features**

* **`toRandom()` function:** Converts a `Seed` object to a `kotlin.random.Random` instance.
* **`Explicit` constructor:** Allows creation of explicit seeds with custom values.
Expand All @@ -65,7 +32,6 @@ The `Seed` class is a sealed class with two subclasses:
* **`copy()` function:** Creates a copy of the `Seed` object with an optional new value.
* **`toString()` function:** Provides a human-readable representation of the `Seed` object.


## **Working with Seeds**

### **Creating Seeds**
Expand Down Expand Up @@ -137,7 +103,7 @@ println(copiedSeed) // Output: ExplicitSeed(50)
val randomInstance = explicitSeed.toRandom()
```

### **Additional notes:**
### **Additional notes**

* You can use the `toRandom()` function to access the actual random number generator instance.
* Refer to the source code for further details on specific functionalities and potential exceptions.
Expand Down
38 changes: 12 additions & 26 deletions docs/sudoku-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ various Sudoku puzzle sizes and their associated properties.

## **Working with Sudoku Types**

### Benefits of Using SudokuType
### **Benefits of Using SudokuType**

* **Type Safety:** Enforces correct grid size representation and prevents errors or unexpected
behavior.
Expand Down Expand Up @@ -51,7 +51,7 @@ val customSize: SudokuType = SudokuType(GridSize(5, 8))
println("Custom Sudoku size: ${customSize}")
```

### Utilizing `SudokuType` Properties
### **Utilizing `SudokuType` Properties**

Directly access various properties available on any `SudokuType` object to gain insights into the
grid size and structure. These properties offer convenient ways to work with different Sudoku
Expand Down Expand Up @@ -194,12 +194,12 @@ println("Sudoku name: $sudokuName") // Output: Sudoku name: 16x16
- Log or store information about different Sudoku types being handled.
- Differentiate between different Sudoku types in text output or user interfaces.

## Working with Sudoku Types Extensions by Use Case
## **Working with Sudoku Types Extensions by Use Case**

These `SudokuType` extensions offer convenient methods for various common operations related to
Sudoku grids. They are categorized by their primary use cases:

### Analyzing Grid Structure
### **Analyzing Grid Structure**

* **`SudokuType.getAllDigits()`**
* **Use Case:** Retrieve the valid range of digits (1 to `digits`) for the specific Sudoku type.
Expand All @@ -219,7 +219,7 @@ Sudoku grids. They are categorized by their primary use cases:
val isInvalid = puzzle.isDigitValid(10) // False
```
### Accessing Cell Information
### **Accessing Cell Information**
* **`SudokuType.getCellRowIndex(cellIndex: Int)`**
* **Use Case:** Get the row index (0 to `height - 1`) for a given cell index.
Expand All @@ -239,7 +239,7 @@ Sudoku grids. They are categorized by their primary use cases:
val colIndex = puzzle.getCellColumnIndex(17)
```
### Working with Boxes
### **Working with Boxes**
* **`SudokuType.getBoxIndex(row: Int, col: Int)`**
* **Use Case:** Get the box index (0 to `boxes - 1`) for a cell at a specific row and column.
Expand Down Expand Up @@ -277,7 +277,7 @@ Sudoku grids. They are categorized by their primary use cases:
val boxColIndex = puzzle.getCellBoxColumnIndex(99)
```
### Checking Cell Relationships
### **Checking Cell Relationships**
* **`SudokuType.areCellsInSameRow(cellIndex1: Int, cellIndex2: Int)`**
* **Use Case:** Determine if two cells share the same row based on their indices.
Expand Down Expand Up @@ -321,24 +321,10 @@ Sudoku grids. They are categorized by their primary use cases:
val areRelated = puzzle.areCellsRelated(5, 3, 2, 7)
```
## Additional Notes
### **References**
* Remember that adding new `SudokuType` objects requires modifying the class itself.
* Consider future-proofing the `GridSize` class to handle potential variations in size or
complexity.
This documentation serves as a starting point for understanding and utilizing the `SudokuType` class
effectively within your Sudoku-related projects. By leveraging its features and principles, you can
manage different Sudoku sizes with clarity, type safety, and flexibility.
### References
* [Source code for `SudokuType` class](https://github.com/teogor/sudoklify/blob/main/sudoklify-common/src/main/kotlin/dev/teogor/sudoklify/common/types/SudokuType.kt){:
target="_blank"}
* [API documentation for `SudokuType` class](../html/sudoklify-common/dev.teogor.sudoklify.common.types/-sudoku-type/index.html){:
target="_blank"}
* [Source code for `SudokuTypeExtensions`](https://github.com/teogor/sudoklify/blob/main/sudoklify-ktx/src/main/kotlin/dev/teogor/sudoklify/ktx/SudokuTypeExtensions.kt){:
target="_blank"}
* [API documentation for `SudokuTypeExtensions`](../html/sudoklify-ktx/dev.teogor.sudoklify.ktx/index.html){:
target="_blank"}
* [Source code for `SudokuType` class](https://github.com/teogor/sudoklify/blob/main/sudoklify-common/src/main/kotlin/dev/teogor/sudoklify/common/types/SudokuType.kt){:target="_blank"}
* [API documentation for `SudokuType` class](../html/sudoklify-common/dev.teogor.sudoklify.common.types/-sudoku-type/index.html){:target="_blank"}
* [Source code for `SudokuTypeExtensions`](https://github.com/teogor/sudoklify/blob/main/sudoklify-ktx/src/main/kotlin/dev/teogor/sudoklify/ktx/SudokuTypeExtensions.kt){:target="_blank"}
* [API documentation for `SudokuTypeExtensions`](../html/sudoklify-ktx/dev.teogor.sudoklify.ktx/index.html){:target="_blank"}
* [Full `sudoklify` library documentation](../html){:target="_blank"}
Loading

0 comments on commit 9e0debb

Please sign in to comment.