Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
pip install mypy
stubgen -p tictactoe_c -o stubs
- name: Upload stubs
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: Stub-file-${{ matrix.python-version }}
path: ./tictactoe_c/stubs/
2 changes: 1 addition & 1 deletion .github/workflows/dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
flutter test --coverage
perl C:\ProgramData\chocolatey\lib\lcov\tools\bin\genhtml -o coverage\html coverage\lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: code-coverage-report
path: ./tictactoe_dart/coverage/html/
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
go test -fuzz=FuzzRandomMove -fuzztime 30s
go test -fuzz=FuzzMinMax -fuzztime 60s
- name: Archive code coverage results
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: code-coverage-report-${{ matrix.go-version }}
path: ./tictactoe_go/coverage.html
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Test
run: cabal test --enable-coverage
- name: Archive code coverage results
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: code-coverage-report
path: ./tictactoe_haskell/dist-newstyle/build/x86_64-linux/ghc-9.10.1/tictactoe-haskell-0.1.0.0/t/testing-tictactoe/hpc/vanilla/html
6 changes: 3 additions & 3 deletions .github/workflows/kotlin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: ./gradlew lint

- name: Generate lint report
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with: # Define extra parameters
name: lint_report.html # Name of the artifact to be uploaded
path: tictactoe_kotlin/app/build/reports/ # Specifies the path where the artifact to be uploaded is located
Expand All @@ -50,7 +50,7 @@ jobs:

# Generates tests reports as an artifact
- name: Generate test report
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: unit_tests_report.html
path: tictactoe_kotlin/app/build/reports/tests/testDebugUnitTest/
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
script: ./gradlew connectedCheck
# Generates tests reports as an artifact
- name: Generate test report
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: android_tests_report.html
path: tictactoe_kotlin/app/build/reports/androidTests/connected
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uv run coverage json
uv run coverage html
- name: Archive code coverage results
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: code-coverage-report-${{ matrix.python-version }}
path: ./tictactoe_python/htmlcov/
4 changes: 2 additions & 2 deletions tictactoe_rust/tictactoe_rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ impl TicTacToe {
// If there is none return a random one instead
fn win_move(&self, player: char) -> Move {
self.get_winning_move(player)
.map_or_else(|| self.random_move(), |win_move| win_move)
.unwrap_or_else(|| self.random_move())
}

// Tries to find a move that would block the opponent
Expand All @@ -576,7 +576,7 @@ impl TicTacToe {
return win_move;
}
self.get_blocking_move(player)
.map_or_else(|| self.random_move(), |block_move| block_move)
.unwrap_or_else(|| self.random_move())
}

/// Gets the game settings from the user via the command line
Expand Down
5 changes: 2 additions & 3 deletions tictactoe_rust/tictactoe_rust_python/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use pyo3::prelude::*;
use tictactoe_rust::TicTacToe;
/// Play the game with the x_strength and o_strength for the AI.
/// Play the game with the `x_strength` and `o_strength` for the AI.
#[pyfunction]
fn play_game(x_strength: usize, o_strength: usize) -> PyResult<()> {
fn play_game(x_strength: usize, o_strength: usize) {
let mut tictactoe = TicTacToe::with_ai_strengths(x_strength, o_strength);
tictactoe.play();
Ok(())
}

/// A Python module implemented in Rust.
Expand Down
Loading