Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Last active July 10, 2017 06:30
Show Gist options
  • Save CyberShadow/11329584 to your computer and use it in GitHub Desktop.
Save CyberShadow/11329584 to your computer and use it in GitHub Desktop.
Drowning
digraph {
"start" [label="There is nothing.
(10 seconds)"];
"age0" [label="You are not.
(5 seconds)"];
"age1" [label="You are starting to become.
(3 seconds)"];
"age2" [label="You are.
(3 seconds)"];
"age3" [label="You are born.
(3 seconds)"];
"age4" [label="You are a toddler.
(3 seconds)"];
"age5" [label="You are a child.
(3 seconds)"];
"age6" [label="You are a teenager.
(3 seconds)"];
"age7" [label="You are a human.
(3 seconds)"];
"age8" [label="You are troubled.
(3 seconds)"];
"age9" [label="You are bitter.
(3 seconds)"];
"age10" [label="You are starting to accept.
(0.8 seconds)"];
"age11" [label="You are dead.
(60 seconds)"];
"age12" [label="You are forgotten.
(300 seconds)"];
"age13" [label="There is nothing.
(600 seconds)"];
"play" [color=gray][label="You need to play.
(2 seconds)"];
"findwork" [label="You need to find a job.
(8 seconds)"];
"work" [color=gray][label="You need to go to work.
(4 seconds)"];
"relax" [color=gray][label="You need to relax.
(8 seconds)"];
"meetfriend" [color=gray][label="You need more friends.
(8 seconds)"];
"friend" [color=gray][label="You need to see a friend.
(4 seconds)"];
"moveon" [label="You need to move on.
(2 seconds)"];
"betterjob" [color=gray][label="You need a better job.
(6 seconds)"];
"learn" [color=gray][label="You need learn.
(2 seconds)"];
"meetlove" [label="You need to find a lover.
(6 seconds)"];
"makelove" [color=gray][label="You need to make love.
(4 seconds)"];
"loselover" [label="You need to feel accepted.
(2 seconds)"];
"create" [color=gray][label="You need to create.
(5 seconds)"];
"fail" [label="You need to fail.
(5 seconds)"];
"changeworld" [label="You need to try harder.
(10 seconds)"];
"morestuff" [color=gray][label="You need more stuff.
(2 seconds)"];
"Hope" [shape=box];
"Body" [shape=box];
"Life" [shape=box];
"Love" [shape=box];
"Knowledge" [shape=box];
"Integrity" [shape=box];
"Experience" [shape=box];
"Loyalty" [shape=box];
"Broken Heart" [shape=box];
"Crushed Dream" [shape=box];
"Lost Ambition" [shape=box];
"Memory" [shape=box];
"Job" [shape=box];
"Money" [shape=box];
"Stress" [shape=box];
"Friend" [shape=box];
"Respect" [shape=box];
"Lover" [shape=box];
"Project" [shape=box];
"Stuff" [shape=box];
start;
"start" -> "age0";
age0;
"age0" -> "age1";
age0 -> "Hope" [color=green];
age1;
"age1" -> "age2";
age1 -> "Body" [color=green];
age2;
"age2" -> "learn";
"age2" -> "age3";
age2 -> "Life" [color=green];
age3;
"age3" -> "play";
"age3" -> "age4";
age3 -> "Love" [color=green];
age4;
"age4" -> "meetfriend";
"age4" -> "age5";
"Knowledge" -> "age4" [color=red label="8"];
age4 -> "Integrity" [color=green];
age5;
"age5" -> "findwork";
"age5" -> "meetlove";
"age5" -> "age6";
"Experience" -> "age5" [color=red label="4"];
age5 -> "Loyalty" [color=green];
age6;
"age6" -> "morestuff";
"age6" -> "create";
"age6" -> "age7";
"Broken Heart" -> "age6" [color=red label="2"];
age7;
"age7" -> "changeworld";
"age7" -> "age8";
"Loyalty" -> "age7" [color=red];
"Crushed Dream" -> "age7" [color=red];
age8;
"age8" -> "age9";
"Integrity" -> "age8" [color=red];
"Lost Ambition" -> "age8" [color=red];
"age8" -> "meetfriend" [style=dotted color=red];
"age8" -> "play" [style=dotted color=red];
"age8" -> "meetlove" [style=dotted color=red];
age9;
"age9" -> "age10";
"Love" -> "age9" [color=red];
"Memory" -> "age9" [color=red label="10"];
"age9" -> "create" [style=dotted color=red];
"age9" -> "meetlove" [style=dotted color=red];
"age9" -> "makelove" [style=dotted color=red];
"age9" -> "friend" [style=dotted color=red];
"age9" -> "learn" [style=dotted color=red];
age10;
"age10" -> "age11";
"Life" -> "age10" [color=red];
age11;
"age11" -> "age12";
"Body" -> "age11" [color=red];
age12;
"age12" -> "age13";
"Hope" -> "age12" [color=red];
age13;
play;
play -> "Memory" [color=green];
findwork;
"findwork" -> "work";
findwork -> "Job" [color=green];
work;
"work" -> "betterjob";
"work" -> "relax";
work -> "Money" [color=green];
work -> "Stress" [color=green];
"Job" -> "work" [style=dotted];
relax;
"Stress" -> "relax" [color=red];
"Stress" -> "relax" [style=dotted];
meetfriend;
"meetfriend" -> "friend";
meetfriend -> "Friend" [color=green];
friend;
"friend" -> "moveon";
friend -> "Memory" [color=green];
"Friend" -> "friend" [style=dotted];
moveon;
"Friend" -> "moveon" [color=red];
moveon -> "Experience" [color=green];
betterjob;
"Knowledge" -> "betterjob" [color=red label="4"];
betterjob -> "Respect" [color=green];
"Job" -> "betterjob" [style=dotted];
learn;
learn -> "Knowledge" [color=green];
meetlove;
"meetlove" -> "makelove";
meetlove -> "Lover" [color=green];
makelove;
"makelove" -> "loselover";
makelove -> "Memory" [color=green];
"Lover" -> "makelove" [style=dotted];
loselover;
"loselover" -> "meetlove";
"Lover" -> "loselover" [color=red];
loselover -> "Broken Heart" [color=green];
loselover -> "Experience" [color=green];
"loselover" -> "makelove" [style=dotted color=red];
create;
"create" -> "fail";
"Money" -> "create" [color=red label="4"];
create -> "Project" [color=green];
fail;
"Project" -> "fail" [color=red];
fail -> "Crushed Dream" [color=green];
fail -> "Memory" [color=green];
changeworld;
"Respect" -> "changeworld" [color=red label="5"];
"Stuff" -> "changeworld" [color=red label="10"];
changeworld -> "Lost Ambition" [color=green];
morestuff;
"Money" -> "morestuff" [color=red];
morestuff -> "Stuff" [color=green];
}
var assert = require('assert');
function createDuration(a,b,c,ms,e,seconds) {
assert(a==0);
assert(b==0);
assert(c==0);
assert(e==0);
return seconds + ms/1000;
}
function newTrig() { return []; }
function createX() { return null; }
var problems = {};
function addProblem(a, name, problem) {
assert(name == problem.name);
assert(a==0);
problems[name] = problem;
}
function newProblem(name, text, duration, removes, adds, x1, x2, b, requirements) {
return {
name : name,
text : text,
duration : duration,
removes : removes,
adds : adds,
inputs : {},
outputs : {},
requirements : requirements,
removeSelf : true,
addInput : function(input) {
this.inputs[input] = 1;
},
addInputN : function(input, n) {
this.inputs[input] = n;
},
addOutput : function(output) {
this.outputs[output] = 1;
},
};
}
function insertAt(arr, at, val) {
assert(at == 0);
arr.unshift(val);
}
var z,y,x,w,v
addProblem(0,"start",newProblem("start","There is nothing.",z=createDuration(0,0,0,0,0,10),y=newTrig(),x=newTrig(),w=createX(),v=createX(),true,[]))
insertAt(x,0,"age0")
addProblem(0,"age0",v=newProblem("age0","You are not.",x=createDuration(0,0,0,0,0,5),v=newTrig(),w=newTrig(),createX(),createX(),true,[]))
insertAt(w,0,"age1")
v.addOutput("Hope")
addProblem(0,"age1",w=newProblem("age1","You are starting to become.",v=createDuration(0,0,0,0,0,3),w=newTrig(),x=newTrig(),createX(),createX(),true,[]))
insertAt(x,0,"age2")
w.addOutput("Body")
addProblem(0,"age2",x=newProblem("age2","You are.",w=createDuration(0,0,0,0,0,3),x=newTrig(),v=newTrig(),createX(),createX(),true,[]))
insertAt(v,0,"age3")
x.addOutput("Life")
insertAt(v,0,"learn")
addProblem(0,"age3",x=newProblem("age3","You are born.",v=createDuration(0,0,0,0,0,3),x=newTrig(),w=newTrig(),createX(),createX(),true,[]))
insertAt(w,0,"age4")
x.addOutput("Love")
insertAt(w,0,"play")
addProblem(0,"age4",x=newProblem("age4","You are a toddler.",w=createDuration(0,0,0,0,0,3),x=newTrig(),v=newTrig(),createX(),createX(),true,[]))
insertAt(v,0,"age5")
x.addOutput("Integrity")
insertAt(v,0,"meetfriend")
x.addInputN("Knowledge",8)
addProblem(0,"age5",v=newProblem("age5","You are a child.",x=createDuration(0,0,0,0,0,3),v=newTrig(),w=newTrig(),createX(),createX(),true,[]))
insertAt(w,0,"age6")
v.addOutput("Loyalty")
v.addInputN("Experience",4)
insertAt(w,0,"meetlove")
insertAt(w,0,"findwork")
addProblem(0,"age6",v=newProblem("age6","You are a teenager.",w=createDuration(0,0,0,0,0,3),v=newTrig(),x=newTrig(),createX(),createX(),true,[]))
insertAt(x,0,"age7")
v.addInputN("Broken Heart",2)
insertAt(x,0,"create")
insertAt(x,0,"morestuff")
addProblem(0,"age7",v=newProblem("age7","You are a human.",x=createDuration(0,0,0,0,0,3),v=newTrig(),w=newTrig(),createX(),createX(),true,[]))
insertAt(w,0,"age8")
v.addInput("Loyalty")
v.addInputN("Crushed Dream",1)
insertAt(w,0,"changeworld")
addProblem(0,"age8",w=newProblem("age8","You are troubled.",w=createDuration(0,0,0,0,0,3),v=newTrig(),x=newTrig(),createX(),createX(),true,[]))
insertAt(x,0,"age9")
w.addInput("Integrity")
v.push("meetfriend")
v.push("play")
v.push("meetlove")
w.addInput("Lost Ambition")
addProblem(0,"age9",w=newProblem("age9","You are bitter.",w=createDuration(0,0,0,0,0,3),v=newTrig(),x=newTrig(),createX(),createX(),true,[]))
insertAt(x,0,"age10")
w.addInput("Love")
v.push("create")
v.push("meetlove")
v.push("makelove")
v.push("friend")
v.push("learn")
w.addInputN("Memory",10)
addProblem(0,"age10",v=newProblem("age10","You are starting to accept.",w=createDuration(0,0,0,800,0,0),v=newTrig(),x=newTrig(),createX(),createX(),true,[]))
insertAt(x,0,"age11")
v.addInput("Life")
v.No=true
v.E6=true
addProblem(0,"age11",x=newProblem("age11","You are dead.",v=createDuration(0,0,0,0,0,60),x=newTrig(),w=newTrig(),createX(),createX(),true,[]))
insertAt(w,0,"age12")
x.addInput("Body")
addProblem(0,"age12",w=newProblem("age12","You are forgotten.",x=createDuration(0,0,0,0,0,300),w=newTrig(),v=newTrig(),createX(),createX(),true,[]))
insertAt(v,0,"age13")
w.addInput("Hope")
addProblem(0,"age13",newProblem("age13","There is nothing.",w=createDuration(0,0,0,0,0,600),v=newTrig(),x=newTrig(),y=createX(),z=createX(),true,[]))
addProblem(0,"play",z=newProblem("play","You need to play.",createDuration(0,0,0,0,0,2),newTrig(),newTrig(),createX(),createX(),true,[]))
z.removeSelf=false
z.addOutput("Memory")
addProblem(0,"findwork",y=newProblem("findwork","You need to find a job.",z=createDuration(0,0,0,0,0,8),y=newTrig(),x=newTrig(),createX(),createX(),true,[]))
y.addOutput("Job")
insertAt(x,0,"work")
addProblem(0,"work",y=newProblem("work","You need to go to work.",x=createDuration(0,0,0,0,0,4),y=newTrig(),z=newTrig(),createX(),createX(),true,v=[]))
y.addOutput("Money")
y.addOutput("Stress")
y.removeSelf=false
insertAt(z,0,"relax")
insertAt(z,0,"betterjob")
v.push("Job")
addProblem(0,"relax",z=newProblem("relax","You need to relax.",createDuration(0,0,0,0,0,8),newTrig(),newTrig(),createX(),createX(),true,v=[]))
z.removeSelf=false
z.addInput("Stress")
v.push("Stress")
addProblem(0,"meetfriend",z=newProblem("meetfriend","You need more friends.",v=createDuration(0,0,0,0,0,8),z=newTrig(),y=newTrig(),createX(),createX(),true,[]))
z.addOutput("Friend")
z.removeSelf=false
insertAt(y,0,"friend")
addProblem(0,"friend",z=newProblem("friend","You need to see a friend.",y=createDuration(0,0,0,0,0,4),z=newTrig(),v=newTrig(),createX(),createX(),true,x=[]))
z.removeSelf=false
z.addOutput("Memory")
insertAt(v,0,"moveon")
x.push("Friend")
addProblem(0,"moveon",x=newProblem("moveon","You need to move on.",createDuration(0,0,0,0,0,2),newTrig(),newTrig(),createX(),createX(),true,[]))
x.addInput("Friend")
x.addOutput("Experience")
addProblem(0,"betterjob",v=newProblem("betterjob","You need a better job.",createDuration(0,0,0,0,0,6),newTrig(),newTrig(),createX(),createX(),true,x=[]))
v.addInputN("Knowledge",4)
v.removeSelf=false
x.push("Job")
v.addOutput("Respect")
addProblem(0,"learn",v=newProblem("learn","You need learn.",createDuration(0,0,0,0,0,2),newTrig(),newTrig(),createX(),createX(),true,[]))
v.addOutput("Knowledge")
v.removeSelf=false
addProblem(0,"meetlove",x=newProblem("meetlove","You need to find a lover.",v=createDuration(0,0,0,0,0,6),x=newTrig(),z=newTrig(),createX(),createX(),true,[]))
insertAt(z,0,"makelove")
x.addOutput("Lover")
addProblem(0,"makelove",z=newProblem("makelove","You need to make love.",x=createDuration(0,0,0,0,0,4),z=newTrig(),v=newTrig(),createX(),createX(),true,y=[]))
z.removeSelf=false
z.addOutput("Memory")
insertAt(v,0,"loselover")
y.push("Lover")
addProblem(0,"loselover",y=newProblem("loselover","You need to feel accepted.",y=createDuration(0,0,0,0,0,2),v=newTrig(),z=newTrig(),createX(),createX(),true,[]))
y.addInput("Lover")
y.addOutput("Broken Heart")
insertAt(z,0,"meetlove")
v.push("makelove")
y.addOutput("Experience")
addProblem(0,"create",v=newProblem("create","You need to create." ,createDuration(0,0,0,0,0, 5),v=newTrig(),z=newTrig(),createX(),createX(),true,[]))
v.removeSelf=false
v.addOutput("Project")
insertAt(z,0,"fail")
v.addInputN("Money",4)
addProblem(0,"fail",v=newProblem("fail","You need to fail." ,createDuration(0,0,0,0,0, 5), newTrig(),newTrig(),createX(),createX(),true,[]))
v.addInput("Project")
v.addOutput("Crushed Dream")
v.addOutput("Memory")
addProblem(0,"changeworld",v=newProblem("changeworld","You need to try harder.",createDuration(0,0,0,0,0,10), newTrig(),newTrig(),createX(),createX(),true,[]))
v.addOutput("Lost Ambition")
v.addInputN("Respect",5)
v.addInputN("Stuff",10)
addProblem(0,"morestuff",v=newProblem("morestuff", "You need more stuff." ,createDuration(0,0,0,0,0, 2), newTrig(),newTrig(),createX(),createX(),true,[]))
v.addOutput("Stuff")
v.addInput("Money")
v.removeSelf=false
//console.log(JSON.stringify(problems, undefined, "\t"));
var things = {};
console.log('digraph {');
for (var pname in problems) {
var problem = problems[pname];
var attrs = '';
if (!problem.removeSelf)
attrs += '[color=gray]';
console.log('\t"' + pname + '" ' + attrs + '[label="'+problem.text+'\n('+problem.duration+' seconds)"];');
for (var name in problem.inputs)
things[name] = true;
for (var name in problem.outputs)
things[name] = true;
}
console.log();
for (var thing in things) {
console.log('\t"' + thing + '" [shape=box];');
}
for (var pname in problems) {
console.log('\t' + pname + ';');
var problem = problems[pname];
for (var i in problem.adds)
console.log('\t"' + pname + '" -> "' + problem.adds[i] + '";');
for (var name in problem.inputs)
console.log('\t"' + name + '" -> "' + pname + '" [color=red' + (problem.inputs[name] == 1 ? '' : ' label="'+problem.inputs[name]+'"') + '];');
for (var name in problem.outputs)
console.log('\t' + pname + ' -> "' + name + '" [color=green];');
for (var i in problem.requirements)
console.log('\t"' + problem.requirements[i] + '" -> "' + pname + '" [style=dotted];');
for (var i in problem.removes)
console.log('\t"' + pname + '" -> "' + problem.removes[i] + '" [style=dotted color=red];');
}
console.log();
console.log('}');
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
drowning.svg : drowning.dot
dot -Tsvg drowning.dot > drowning.svg
drowning.dot : drowning.js
node drowning.js > drowning.dot
@themacinator
Copy link

asdsa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment