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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -24,7 +24,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev

- name: Cache cargo registry
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand All @@ -40,7 +40,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -51,7 +51,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev

- name: Cache cargo registry
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand All @@ -67,7 +67,7 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -85,7 +85,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -95,7 +95,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev

- name: Cache cargo registry
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand All @@ -114,7 +114,7 @@ jobs:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install cargo-audit
run: cargo install cargo-audit
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
artifact: press-your-luck-windows-x86_64

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
Compress-Archive -Path dist/* -DestinationPath ${{ matrix.artifact }}.zip

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact }}
path: |
Expand All @@ -73,7 +73,7 @@ jobs:
name: Build AppImage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
mv *.AppImage press-your-luck-x86_64.AppImage

- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: press-your-luck-appimage
path: press-your-luck-x86_64.AppImage
Expand All @@ -141,15 +141,15 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Download all artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
path: artifacts

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description states "All GitHub Actions updates are Node.js 24 compatible", but softprops/action-gh-release@v2 actually uses Node.js 20, not Node.js 24. While this doesn't affect functionality (both are supported by runner v2.327.1), the description should be corrected for accuracy. Consider changing it to "All GitHub Actions updates are compatible with Node.js 20+ and minimum runner v2.327.1" or similar.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

with:
draft: false
prerelease: false
Expand Down
40 changes: 5 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rust-version = "1.70"
ggez = "0.9"

# Random number generation for board patterns and trivia
rand = "0.8"
rand = "0.9"
fastrand = "2.0"

# Serialization for save/load functionality
Expand Down
17 changes: 8 additions & 9 deletions src/game/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
//! - **Special**: Add-A-One, Double Your Money, Pick a Corner, etc.
//! - **Whammy**: Lose all money and prizes

use rand::seq::SliceRandom;
use rand::Rng;
use rand::prelude::*;
use serde::{Deserialize, Serialize};

// ═══════════════════════════════════════════════════════════════════════════
Expand Down Expand Up @@ -678,7 +677,7 @@ impl WhammyAnimationType {
pub fn random_whammy_out() -> Self {
let animations = [Self::GrimReaper, Self::FiringSquad, Self::AngelWhammy];
*animations
.choose(&mut rand::thread_rng())
.choose(&mut rand::rng())
.unwrap_or(&Self::GrimReaper)
}

Expand Down Expand Up @@ -754,7 +753,7 @@ impl WhammyAnimationType {
Self::Judge,
Self::ClownCar,
];
*animations.choose(&mut rand::thread_rng()).unwrap()
*animations.choose(&mut rand::rng()).unwrap()
}
}

Expand Down Expand Up @@ -841,7 +840,7 @@ impl TriviaQuestion {
choices.push(self.correct_answer.clone());

// Shuffle and find correct index
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
choices.shuffle(&mut rng);

let correct_index = choices
Expand Down Expand Up @@ -1219,9 +1218,9 @@ impl GameState {
};

// Initialize random prize indices
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
for square in &mut state.board {
square.current_index = rng.gen_range(0..3);
square.current_index = rng.random_range(0..3);
}

state
Expand Down Expand Up @@ -1794,7 +1793,7 @@ impl GameState {
available = (0..all_questions.len()).collect();
}

let idx = *available.choose(&mut rand::thread_rng()).unwrap();
let idx = *available.choose(&mut rand::rng()).unwrap();
qs.used_questions.push(idx);

let question = all_questions[idx].clone();
Expand Down Expand Up @@ -1956,7 +1955,7 @@ impl GameState {
self.spin_speed = 1.0; // Full speed
self.spin_decelerating = false;
self.spin_target_square = None;
self.light_speed = 15.0 + rand::thread_rng().gen_range(0.0..5.0);
self.light_speed = 15.0 + rand::rng().random_range(0.0..5.0);
self.message = "Press SPACE to stop!".to_string();
}

Expand Down