Skip to content

Instantly share code, notes, and snippets.

@GirlBossRush
Created January 29, 2013 22:34
Show Gist options
  • Save GirlBossRush/4668609 to your computer and use it in GitHub Desktop.
Save GirlBossRush/4668609 to your computer and use it in GitHub Desktop.
digraph vending_machine {
node [shape = point]; start
node [shape = square]; open
node [shape = circle];
splines=true;
sep="+25,25";
overlap=scalexy;
nodesep=0.35;
node [fontsize=11];
start -> "0¢" [ label = "Reset" ];
// Nickels
"0¢" -> "5¢" [ label = "N" color = purple ];
"5¢" -> "10¢" [ label = "N" color = purple ];
"10¢" -> "15¢" [ label = "N" color = purple ];
"15¢" -> "20¢" [ label = "N" color = purple ];
"20¢" -> "25¢" [ label = "N" color = purple ];
"25¢" -> "30¢" [ label = "N" color = purple ];
"30¢" -> "35¢" [ label = "N" color = purple ];
"35¢" -> "40¢" [ label = "N" color = purple ];
"40¢" -> "45¢" [ label = "N" color = purple ];
"45¢" -> "50¢" [ label = "N" color = purple ];
"50¢" -> open [ label = "N" color = purple ];
// Dimes
"0¢" -> "10¢" [ label = "D" color = green ];
"5¢" -> "15¢" [ label = "D" color = green ];
"10¢" -> "20¢" [ label = "D" color = green ];
"15¢" -> "25¢" [ label = "D" color = green ];
"20¢" -> "30¢" [ label = "D" color = green ];
"25¢" -> "35¢" [ label = "D" color = green ];
"30¢" -> "40¢" [ label = "D" color = green ];
"35¢" -> "45¢" [ label = "D" color = green ];
"40¢" -> "50¢" [ label = "D" color = green ];
"45¢" -> "50¢" [ label = "D" color = green ];
"50¢" -> open [ label = "D" color = green ];
// Quarters
"0¢" -> "25¢" [ label = "Q" style = dashed color = red ];
"5¢" -> "30¢" [ label = "Q" style = dashed color = red ];
"10¢" -> "35¢" [ label = "Q" style = dashed color = red ];
"15¢" -> "40¢" [ label = "Q" style = dashed color = red ];
"20¢" -> "45¢" [ label = "Q" style = dashed color = red ];
"25¢" -> "50¢" [ label = "Q" style = dashed color = red ];
"50¢" -> open [ label = "Q" style = dashed color = red ];
"50¢" -> open [ shape = square]
// Loops
"0¢" -> "0¢" [ style = dotted color = blue ]
"5¢" -> "5¢" [ style = dotted color = blue ]
"10¢" -> "10¢" [ style = dotted color = blue ]
"15¢" -> "15¢" [ style = dotted color = blue ]
"20¢" -> "20¢" [ style = dotted color = blue ]
"25¢" -> "25¢" [ style = dotted color = blue ]
"30¢" -> "30¢" [ style = dotted color = blue ]
"35¢" -> "35¢" [ style = dotted color = blue ]
"40¢" -> "40¢" [ style = dotted color = blue ]
"45¢" -> "45¢" [ style = dotted color = blue ]
"50¢" -> "50¢" [ style = dotted color = blue ]
// Edge cases
"30¢" -> "50¢" [ label = "Q" style = dashed color = red ];
"35¢" -> "50¢" [ label = "Q" style = dashed color = red ];
"40¢" -> "50¢" [ label = "Q" style = dashed color = red ];
"45¢" -> "50¢" [ label = "Q" style = dashed color = red ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment