Skip to content

About

Console-based C#/.NET paint app for teaching programming fundamentals — variables, loops, branches, functions & recursion.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

Repository files navigation

🖼️ TerminalPaint

TerminalPaint is a basic paint application running in the terminal. The application features a color picker, rectangle and line drawing tools, as well as loading and saving of images. The color picker provides access to a small palette of colors supported on a wide range of platforms (e.g. Windows, Linux, and MacOS). The line drawing tool uses a simple implementation of the Bresenham algorithm for line discretization. And image loading and saving uses a custom image format, which intentionally is not compatible with other tools.

We use this application for teaching programming at the School of Engineering of the University of Applied Sciences Upper Austria. According to our experience, the application is simple enough to be fully unterstood even by beginners, but interesting enough to motivate students to work on the assigments.

Enjoy! 😉

Screencasts

Here are some screencasts showing TerminalPaint in action:

Lessons

We use the TerminalPaint application to teach the following lessons:

Drawings

Here are some drawings made with TerminalPaint:

Details

Here is an overview of the classes including their fields, methods, and dependencies:

classDiagram
    class Program {
        Main() void$
    }

    class Tool {
        <<abstract>>
    }
    class Color {
        current: ConsoleColor$
        PaintPalette() void$
        Change(delta: int) void$
    }
    class Pointer {
        currentX: int$
        currentY: int$
        Move(dx: int, dy: int) void$
        Brush() void$
    }
    class Clear {
        Execute() void$
    }
    class Fill {
        Execute() void$
    }
    class Rectangle {
        -startX: int$
        -startY: int$
        Execute() void$
        -Move(dx: int, dy: int) void$
        -Commit() void$
        -Cancel() void$
    }
    class Line {
        -startX: int$
        -startY: int$
        Execute() void$
        -Move(dx: int, dy: int) void$
        -Commit() void$
        -Cancel() void$
    }
    class Open {
        Execute() void$
    }
    class Save {
        Execute() void$
    }

    class Core {
        <<abstract>>
    }
    class Image {
        width: int$
        height: int$
        size: int = width * height$
        data: ConsoleColor[]$
        Paint() void$
    }
    class Util {
        borderTop: int$
        borderLeft: int$
        borderRight: int$
        borderBottom: int$
        PaintFrame() void$
        PaintBorderTop() void$
        PaintBorderLeft() void$
        PaintBorderRight() void$
        PaintBorderBottom() void$
        PaintTextTop() void$
        PaintTextBottom() void$
        ReadBool() bool$
        ReadFileName(exists: bool) string$
    }

    Program ..> Tool: calls

    Tool <|-- Color: is a
    Tool <|-- Pointer: is a
    Tool <|-- Clear: is a
    Tool <|-- Fill: is a
    Tool <|-- Rectangle: is a
    Tool <|-- Line: is a
    Tool <|-- Open: is a
    Tool <|-- Save: is a

    Color ..> Core: uses
    Pointer ..> Core: uses
    Clear ..> Core: uses
    Fill ..> Core: uses
    Rectangle ..> Core: uses
    Line ..> Core: uses
    Open ..> Core: uses
    Save ..> Core: uses

    Core <|-- Image: is a
    Core <|-- Util: is a

Loading

Documents

Finally, here are the standard documents shipped with open source software:

  • 📄 LICENSE.md - Explains the license of the source code.
  • 📄 CHANGELOG.md - Summarizes major changes to the source code.
  • 📄 CONTRIBUTING.md - Defines guidelines for contributing to the source code.

About

Console-based C#/.NET paint app for teaching programming fundamentals — variables, loops, branches, functions & recursion.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Used by

Contributors

Languages