Skip to content

fumiko8/python-project-49

Repository files navigation

Hexlet tests and linter status:

Actions Status Quality Gate Status Maintainability Rating

Brain Games

Description

A set of five math-based mini-games for the terminal:

  • brain-even - Determine if a number is even
  • brain-calc - Calculate the result of arithmetic expressions
  • brain-gcd - Find the greatest common divisor of two numbers
  • brain-progression - Find the missing number in arithmetic progression
  • brain-prime - Determine if a number is prime

Installation

uv tool install dist/hexlet_code-0.1.0-py3-none-any.whl

Usage

After installation, run any game:

brain-even
brain-calc
brain-gcd
brain-progression
brain-prime

Game Rules

  • You need to answer 3 questions correctly to win
  • One wrong answer ends the game

Requirements

  • Python 3.10 or higher
  • uv package manager

Asciinema Demo

asciicast

Project Structure

brain_games/
├── cli.py              # User greeting
├── engine.py           # Common game engine
├── games/              # Game logic
│   ├── brain_even.py
│   ├── brain_calc.py
│   ├── brain_gcd.py
│   ├── brain_progression.py
│   └── brain_prime.py
└── scripts/            # Game launchers
    ├── brain_even.py
    ├── brain_calc.py
    ├── brain_gcd.py
    ├── brain_progression.py
    └── brain_prime.py

Code Quality

Ruff - Linter for code style checking

SonarQube - Code quality inspection

GitHub Actions - Automated testing

Run linter locally:

uv run ruff check brain_games

Development

# Setup
uv sync

# Build package
uv build

# Install locally
uv tool install --force dist/hexlet_code-0.1.0-py3-none-any.whl

Created by fumiko8

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors