Add game stubs

This commit is contained in:
cool-mist
2025-01-26 20:14:39 +05:30
parent 61b71eb8f0
commit 90a6ae7716
5 changed files with 271 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
pub(crate) fn run() {
println!("Running game...");
}
+1
View File
@@ -0,0 +1 @@
pub(crate) mod game;
+12 -1
View File
@@ -7,15 +7,22 @@ mod solver;
#[allow(unused)]
mod generator;
#[allow(unused)]
mod game;
use argh::FromArgs;
use engine::board::Board;
use crate::game::game as sol_chess_game;
use crate::generator::generator::generate;
use crate::solver::solver::Solver;
fn main() {
let args: Args = argh::from_env();
if args.generate {
if args.game {
sol_chess_game::run();
} else if args.generate {
let puzzle = generate_puzzle(args.num_pieces, args.solutions);
let Some(board) = puzzle else {
return;
@@ -92,6 +99,10 @@ struct Args {
/// generate a puzzle
generate: bool,
#[argh(switch)]
/// run the game
game: bool,
#[argh(option, short = 'n')]
/// number of pieces to place on the board while generating a puzzle
num_pieces: Option<u32>,