drawille-0.1.0.5: A port of asciimoo's drawille to haskell

Portabilitynon-portable (not tested on multiple environments)
Stabilitystable
MaintainerPedro Yamada <tacla.yamada@gmail.com>
Safe HaskellSafe-Inferred

System.Drawille

Description

This module enables using UTF-8 braille characters to render drawings onto the console.

Synopsis

Documentation

type Canvas = Map (Int, Int) IntSource

The Canvas type. Represents a canvas, mapping points to their braille px codes.

empty :: CanvasSource

The empty canvas, to be drawn upon.

frame :: Canvas -> StringSource

Pretty prints a canvas as a String, ready to be printed.

get :: Canvas -> (Int, Int) -> BoolSource

Gets the current state for a coordinate in a canvas.

set :: Canvas -> (Int, Int) -> CanvasSource

Sets a coordinate in a canvas.

unset :: Canvas -> (Int, Int) -> CanvasSource

Unsets a coordinate in a canvas.

toggle :: Canvas -> (Int, Int) -> CanvasSource

Toggles the state of a coordinate in a canvas

fromList :: [(Int, Int)] -> CanvasSource

Creates a canvas from a List of coordinates

toPs :: (Int, Int) -> (Int, Int)Source

Helper to convert a coordinate to its corespondent in the bigger braille grid's size

toPx :: (Int, Int) -> IntSource

Converts a coordinate into its local braille px code, using the pxMap.

pxMap :: Num a => [[a]]Source

A mapping between local coordinates, inside of a single cell, and each of the braille characters they correspond to (with an offset).

pxOff :: Num a => aSource

The offset between the values in the pxMap, which have nice binary properties between each other, and the actual braille character codes.