You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Avery R. 384ee7468d Corrected typo in `README.md` 8 months ago
src Initial Commit (v0.1.0) 8 months ago
.gitignore Corrected `.gitignore` 8 months ago
README.md Corrected typo in `README.md` 8 months ago

README.md

TDMG

Inspiration

TDMG is a Haskell module for generating directed graphs according to the technique from the above tweet. A brief overview of that technique:

Given an arbitrary base,

  1. Pick a one or two digit number
  2. Create a list of all of the two digit multiples of that number
  3. For every digit that appears in the list, create a node in your graph
  4. For every number in the list, create an arrow from the most significant digit's node to the least significant digit's node

Contents

  • Edge
    Edge is a data structure containing two integers, a head and a tail. It represents an edge in a directed graph.
    The constructor for Edge takes the form Edge tail head, where tail and head are Integers.

  • Graph
    Graph is a data structure composed of a cons list of Edges. It represents a directed graph.
    The constructors for Graph are Empty and Graph Edge Graph.

  • fromList :: [(Integer,Integer)] -> Graph
    fromList converts a list of the form [(Integer,Integer)] into a Graph.

  • gen :: Integer -> Integer -> Graph
    gen generates the directed graph for some arbitrary base and some arbitrary number. It takes the form gen base num.

Executable

TDMG also ships with an executable. This can be compiled using ghc. Run the executable for usage instructions. For all intents and purposes, it can be thought of as exposing the gen function to the system.