An open API service indexing awesome lists of open source software.

https://github.com/sandre58/mygames

This repository contains a collection of classic board games implemented using WPF.
https://github.com/sandre58/mygames

chess connect4 games net80 wpf xaml

Last synced: about 1 month ago
JSON representation

This repository contains a collection of classic board games implemented using WPF.

Awesome Lists containing this project

README

          






My Games

[![Downloads][downloads-shield]][downloads-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]




A comprehensive collection of classic board games implemented in C# with .NET 10.
Features both console applications and rich WPF desktop interfaces with AI opponents,
customizable gameplay, and modern user experiences.

[![Language][language-shield]][language-url]
[![Build][build-shield]][build-url]

## ๐ŸŽฏ Overview

My Games is a modern implementation of classic board games built with .NET 10, offering multiple ways to play your favorite games. Each game includes:

- **Multiple Interfaces**: Console applications for quick play and WPF desktop apps for rich visual experiences
- **AI Opponents**: Sophisticated artificial intelligence with configurable difficulty levels
- **Customizable Gameplay**: Adjustable rules, board sizes, and game settings
- **Clean Architecture**: Well-structured, testable code with comprehensive unit test coverage
- **Cross-Platform Core**: Game logic built for portability and extensibility

## โœจ Key Features

- **๐ŸŽฎ Multiple Game Modes**: Play against AI opponents or challenge friends in local multiplayer
- **๐Ÿ–ฅ๏ธ Dual Interfaces**: Choose between lightweight console apps or feature-rich WPF desktop applications
- **๐Ÿค– Advanced AI**: Alpha-beta pruning algorithms with multiple difficulty levels for challenging gameplay
- **โš™๏ธ Highly Customizable**: Adjust board sizes, rules, difficulty settings, and visual themes
- **๐Ÿ—๏ธ Modern Architecture**: Clean, testable code structure with comprehensive unit test coverage
- **๐ŸŽจ Rich UI**: Beautiful WPF interfaces with animations, themes, and intuitive drag-and-drop controls

## ๐ŸŽฒ Available Games

### โ™Ÿ๏ธ Chess




[![Framework][framework-shield]][framework-url]
[![Version][chess-version-shield]][chess-version-url]

**[๐Ÿ“– View Chess Documentation](src/Chess/README.md)**

A complete chess implementation featuring all standard rules including castling, en passant, and pawn promotion. Play against sophisticated AI opponents or challenge friends with both console and future WPF interfaces.

**Features:**
- Complete chess rule implementation
- AI with Alpha-beta pruning algorithm
- Console interface with algebraic notation
- Special moves: castling, en passant, promotion
- Comprehensive unit test coverage

### ๐Ÿ”ด Connect 4




[![Framework][framework-shield]][framework-url]
[![Version][connect4-version-shield]][connect4-version-url]

**[๐Ÿ“– View Connect4 Documentation](src/Connect4/README.md)**

The classic Connect 4 game with both console and beautiful WPF interfaces. Customize board dimensions, winning conditions, and enjoy smooth gameplay with multiple AI difficulty levels.

**Features:**
- Console and WPF desktop applications
- Customizable board sizes (4x4 to 12x10)
- Configurable win conditions (3-6 in a row)
- Drag-and-drop WPF interface with animations
- Theme support and visual customization

## ๐Ÿš€ Quick Start

### Prerequisites

- **.NET 10.0** or later
- **Visual Studio 2022** or compatible IDE
- **Windows OS** (for WPF applications)

### Installation

1. **Clone the repository:**
```bash
git clone https://github.com/sandre58/MyGames.git
cd MyGames
```

2. **Build the solution:**
```bash
dotnet build
```

3. **Run a game:**

**Chess Console:**
```bash
dotnet run --project src/Chess/MyGames.Chess.Console
```

**Connect4 Console:**
```bash
dotnet run --project src/Connect4/MyGames.Connect4.Console
```

**Connect4 WPF:**
```bash
dotnet run --project src/Connect4/MyGames.Connect4.Wpf
```

## ๐Ÿ—๏ธ Project Structure

```
MyGames/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ Chess/ # Chess game implementation
โ”‚ โ”‚ โ”œโ”€โ”€ MyGames.Chess/ # Core chess library
โ”‚ โ”‚ โ”œโ”€โ”€ MyGames.Chess.Console/ # Console application
โ”‚ โ”‚ โ””โ”€โ”€ README.md # Chess documentation
โ”‚ โ”œโ”€โ”€ Connect4/ # Connect4 game implementation
โ”‚ โ”‚ โ”œโ”€โ”€ MyGames.Connect4/ # Core Connect4 library
โ”‚ โ”‚ โ”œโ”€โ”€ MyGames.Connect4.Console/ # Console application
โ”‚ โ”‚ โ”œโ”€โ”€ MyGames.Connect4.Wpf/ # WPF desktop application
โ”‚ โ”‚ โ””โ”€โ”€ README.md # Connect4 documentation
โ”‚ โ””โ”€โ”€ Common/
โ”‚ โ””โ”€โ”€ MyGames.Core/ # Shared game framework
โ”œโ”€โ”€ tests/ # Unit tests for all projects
โ”œโ”€โ”€ assets/ # Game icons and images
โ””โ”€โ”€ build/ # Build configuration files
```

## ๐Ÿงช Testing

Run all tests across the solution:
```bash
dotnet test
```

Run tests for a specific game:
```bash
dotnet test tests/MyGames.Chess.UnitTests/
dotnet test tests/MyGames.Connect4.UnitTests/
```

## ๐ŸŽฎ Game Features Comparison

| Feature | Chess | Connect4 |
|---------|-------|----------|
| Console Interface | โœ… | โœ… |
| WPF Desktop App | ๐Ÿ”„ (Planned) | โœ… |
| AI Opponents | โœ… | โœ… |
| Customizable Rules | โœ… | โœ… |
| Board Customization | โŒ | โœ… |
| Themes/Visual Options | โŒ | โœ… |
| Drag & Drop UI | โŒ | โœ… |

## ๐Ÿค– AI Implementation

Both games feature sophisticated AI opponents powered by:

- **Alpha-Beta Pruning**: Efficient minimax algorithm implementation
- **Position Evaluation**: Strategic position assessment functions
- **Configurable Difficulty**: Adjustable search depth from beginner to expert
- **Move Ordering**: Optimization techniques for better performance

## ๐Ÿ› ๏ธ Development

### Building from Source

1. **Prerequisites**: Ensure you have .NET 10.0 SDK installed
2. **Clone**: `git clone https://github.com/sandre58/MyGames.git`
3. **Build**: `dotnet build` in the root directory
4. **Test**: `dotnet test` to run all unit tests

### Contributing

Contributions are welcome! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on:

- Code style and standards
- Adding new games or features
- Improving AI algorithms
- UI/UX enhancements
- Testing requirements

### Architecture

The project follows a clean architecture pattern:

- **Core Libraries**: Game logic and rules (platform-independent)
- **Console Applications**: Lightweight interfaces for quick gameplay
- **WPF Applications**: Rich desktop experiences with themes and animations
- **Shared Framework**: Common game abstractions and utilities

## ๐Ÿ—บ๏ธ Roadmap

### Near Term
- [ ] Chess WPF application with rich UI
- [ ] Online multiplayer support
- [ ] Game replay and analysis features
- [ ] Additional AI difficulty levels

### Future
- [ ] Mobile applications (MAUI)
- [ ] Additional classic games (Checkers, Reversi)
- [ ] Tournament and rating systems
- [ ] Advanced AI with machine learning

## ๐Ÿ“Š Statistics

- **Languages**: C#, XAML
- **Framework**: .NET 10
- **Architecture**: Clean Architecture with MVVM (WPF)
- **Testing**: Unit tests with high coverage
- **Games**: 2 implemented, more planned

## ๐Ÿค Contributing

We welcome contributions of all kinds:

- ๐Ÿ› **Bug Reports**: Found an issue? Let us know!
- ๐Ÿ’ก **Feature Ideas**: Have suggestions for improvements?
- ๐Ÿ”ง **Code Contributions**: Submit pull requests for fixes or features
- ๐Ÿ“ **Documentation**: Help improve our documentation
- ๐ŸŽจ **UI/UX**: Design improvements and theme contributions

## ๐Ÿ“„ License

Copyright ยฉ Stรฉphane ANDRE.

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- Classic game rules and mechanics
- Algorithm implementations for AI opponents
- .NET community for frameworks and tools
- Contributors and testers

(back to top)

[language-shield]: https://img.shields.io/github/languages/top/sandre58/MyGames
[language-url]: https://github.com/sandre58/MyGames
[forks-shield]: https://img.shields.io/github/forks/sandre58/MyGames?style=for-the-badge
[forks-url]: https://github.com/sandre58/MyGames/network/members
[stars-shield]: https://img.shields.io/github/stars/sandre58/MyGames?style=for-the-badge
[stars-url]: https://github.com/sandre58/MyGames/stargazers
[issues-shield]: https://img.shields.io/github/issues/sandre58/MyGames?style=for-the-badge
[issues-url]: https://github.com/sandre58/MyGames/issues
[license-shield]: https://img.shields.io/github/license/sandre58/MyGames?style=for-the-badge
[license-url]: https://github.com/sandre58/MyGames/blob/main/LICENSE
[build-shield]: https://img.shields.io/github/actions/workflow/status/sandre58/MyGames/ci.yml?logo=github&label=CI
[build-url]: https://github.com/sandre58/MyGames/actions
[downloads-shield]: https://img.shields.io/github/downloads/sandre58/MyGames/total?style=for-the-badge
[downloads-url]: https://github.com/sandre58/MyGames/releases
[framework-shield]: https://img.shields.io/badge/.NET-10.0-purple
[framework-url]: https://dotnet.microsoft.com/download/dotnet/10.0
[connect4-version-shield]: https://img.shields.io/badge/version-1.0.0-blue
[connect4-version-url]: https://github.com/sandre58/MyGames/releases
[chess-version-shield]: https://img.shields.io/badge/version-1.0.0-blue
[chess-version-url]: https://github.com/sandre58/MyGames/releases