Skip to content

A simple Python module for creating and manipulating a grid with colored symbols.

License

Notifications You must be signed in to change notification settings

agx-r/colorful-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Colorful Grid Module

A simple Python module for creating and manipulating a grid with colored symbols.

Colorful Grid

Table of Contents

Introduction

This Python module provides a Grid class that allows you to create a grid and set colored symbols at specific coordinates. The module uses ANSI escape codes for terminal color formatting.

Installation

  1. Install the colorama library:

    pip install colorama
  2. Download the colorful_grid.py file from this repository.

Usage

  1. Import the Grid class from colorful_grid.py:

    from colorful_grid import Grid
  2. Create a Grid object with the desired width and height:

    my_grid = Grid(5, 5)
  3. Use the create_symbol method to set a colored symbol at specific coordinates:

    my_grid.create_symbol('R', 0, 0, 255, 0, 0)
  4. Use the delete_symbol method to remove a symbol at specific coordinates:

    my_grid.delete_symbol(2, 2)
  5. Draw the grid using the draw_grid method:

    my_grid.draw_grid()

Example

Here's a simple example demonstrating the usage:

from colorful_grid import Grid

my_grid = Grid(5, 5)

my_grid.create_symbol('R', 0, 0, 255, 0, 0)
my_grid.create_symbol('G', 2, 2, 0, 255, 0)
my_grid.create_symbol('B', 4, 4, 0, 0, 255)

my_grid.draw_grid()

my_grid.delete_symbol(2, 2)

my_grid.draw_grid()

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple Python module for creating and manipulating a grid with colored symbols.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages