Seed random number generation

This commit is contained in:
cool-mist 2025-02-23 17:16:15 +05:30
parent 89e43686ca
commit 5560013e33
2 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,11 @@
./build-web.sh && \
cargo build --target wasm32-unknown-unknown --release
if [ $? -ne 0 ]; then
echo "Wasm build failed"
exit 1
fi
mkdir -p ./local-deploy && \
./deploy-ltpd.sh ./local-deploy && \
cp ./web/index.html ./local-deploy/index.html && \
cp ./target/wasm32-unknown-unknown/release/sol_chess.wasm ./local-deploy/sol_chess.wasm && \
basic-http-server ./local-deploy

View File

@ -3,6 +3,7 @@ use std::fmt::{Display, Formatter};
use game::texture::PieceTexture;
use macroquad::prelude::*;
use miniquad::date;
use sol_chess::{
board::{Board, BoardState},
generator,
@ -12,6 +13,7 @@ mod game;
#[macroquad::main("Solitaire Chess")]
async fn main() {
rand::srand(date::now() as u64);
let background_color = Color::from_rgba(196, 195, 208, 255);
let mut game = init().await;
loop {