TypeScript
by gibito
HTML
<div id="app"></div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
text-align: center;
}
TypeScript
let C2 = 1; // Hard coded numbers so they don't depend on anynody
let D2 = 1;
let D5 = 1;
let D6 = "=D10"; // D6 depends on D10, D10 is a precedent of D6
let D7 = "=if(D2===C2) D5+D6 else 0";
let D8 = "=D5+D6+D7";
let D9 = "=D8";
function DFS ([D6, D7, D8, D9]) {
}
function precedentsOf(cellId: string) {
}
// augmented Tarjan
interface dfs_data {
vertexIDs: { [id: string]: number };
lowlink: { [id: string]: number }; // the smallest index of any node known to be reacheable from current node v, including v itself
onStack: { [id: string]: number }; // contains indexes of stack N for vertex V, if vertex V is in stack number N
children: { [id: string]: Array<any> }; // list of children of current node
processedChildrenCounter: { [id: string]: number }; // processed children counter
parent: { [id: string]: Vertex };
processing_child: { [id: string]: Vertex }; // child which is currently being processed by algo
// added for our augmentation
d_counter: { [id: string]: number }; // number of times precedents of the dynamic formula was changed
mayBeRequired: { [id: string]: boolean }; // a special flag that says "It is neither clean nor circular node (yet), but it is OK to require its value during recalculation". For Tarjan algo
precsNotFullySet: { [id: string]: boolean }; // TRUE if the case is dynamic and calculation of it was not even started or was interrupted in DFS
}
function greeter(person: Person) {
return "Hello, " + person.firstName + " " + person.lastName;
}
let user = {
firstName: "Malcolm",
lastName: "Reynolds"
};
document.querySelector("#app").innerHTML = greeter(user);