Avery R.
384ee7468d

2 years ago  

src  2 years ago  
.gitignore  2 years ago  
README.md  2 years 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,
 Pick a one or two digit number
 Create a list of all of the two digit multiples of that number
 For every digit that appears in the list, create a node in your graph
 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 forEdge
takes the formEdge tail head
, wheretail
andhead
areInteger
s. 
Graph
Graph
is a data structure composed of a cons list ofEdge
s. It represents a directed graph.
The constructors forGraph
areEmpty
andGraph Edge Graph
. 
fromList :: [(Integer,Integer)] > Graph
fromList
converts a list of the form[(Integer,Integer)]
into aGraph
. 
gen :: Integer > Integer > Graph
gen
generates the directed graph for some arbitrary base and some arbitrary number. It takes the formgen 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.