drawille-0.1.3.0: A port of asciimoo's drawille to haskell
Copyright(c) Pedro Yamada
LicenseGPL-3
MaintainerPedro Yamada <tacla.yamada@gmail.com>
Stabilitystable
Portabilitynon-portable (not tested on multiple environments)
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Drawille

Description

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

Synopsis

Documentation

type Canvas = Map (Int, Int) Int Source #

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

empty :: Canvas Source #

The empty canvas, to be drawn upon.

frame :: Canvas -> String Source #

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

get :: Canvas -> (Int, Int) -> Bool Source #

Gets the current state for a coordinate in a canvas.

set :: Canvas -> (Int, Int) -> Canvas Source #

Sets a coordinate in a canvas.

unset :: Canvas -> (Int, Int) -> Canvas Source #

Unsets a coordinate in a canvas.

toggle :: Canvas -> (Int, Int) -> Canvas Source #

Toggles the state of a coordinate in a canvas

fromList :: [(Int, Int)] -> Canvas Source #

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) -> Int Source #

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 => a Source #

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