-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the flowchart translator and add history API. (#15)
- Loading branch information
1 parent
bbf3788
commit fe9fd23
Showing
21 changed files
with
257 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────────────┐ | ||
│Unimplemented│ | ||
└─────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────┐ | ||
│start│ | ||
└──┬──┘ | ||
__________▽__________ | ||
╱ ╲ ┌──────────────┐ | ||
╱ ╲________________________________________________________________________________________│Very expensive│ | ||
╲ Does it cost > 1000 ? ╱yes └──────────────┘ | ||
╲_____________________╱ | ||
│no | ||
_________▽_________ ___________________ | ||
╱ ╲ ╱ ╲ ┌──────────────┐ | ||
╱ ╲__________________ ╱ ╲_______________________________│Very expensive│ | ||
╲ Does it cost > 100? ╱yes ╲ Does it cost > 0.5? ╱yes └──────────────┘ | ||
╲___________________╱ ╲___________________╱ | ||
│no │no | ||
________▽_________ _________▽_________ | ||
╱ ╲ ┌───────┐ ╱ ╲ ┌─────────┐ | ||
╱ ╲_________│Correct│ ╱ ╲____________________│expensive│ | ||
╲ Does it cost > 10? ╱yes └───────┘ ╲ Does it cost > 0.1? ╱yes └─────────┘ | ||
╲__________________╱ ╲___________________╱ | ||
│no │no | ||
________▽________ _________▽__________ | ||
╱ ╲ ┌─────┐ ╱ ╲ ┌───────┐ | ||
╱ ╲___│Cheap│ ╱ ╲__________│Correct│ | ||
╲ Does it cost > 1? ╱yes└─────┘ ╲ Does it cost > 0.01? ╱yes └───────┘ | ||
╲_________________╱ ╲____________________╱ | ||
│no │no | ||
┌───▽──┐ __________▽__________ | ||
│coucou│ ╱ ╲ ┌─────┐ | ||
└──────┘ ╱ ╲___│Cheap│ | ||
╲ Does it cost > 0.001? ╱yes└─────┘ | ||
╲_____________________╱ | ||
│no | ||
┌──────▽──────┐ | ||
│Take my money│ | ||
└─────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └┬┘ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└┬┘ └┬┘ │ | ||
│ └─┬──┘ | ||
└──┬───┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└┬┘ | ||
╲___╱ ╲___╱ │ | ||
│no │no │ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└┬┘ └┬┘ │ | ||
│ └───┬───┘ | ||
└──────┬──────┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └─┘ | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
└─┬──┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└─┘ | ||
╲___╱ ╲___╱ | ||
│no │no | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
└────┬────┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └┬┘ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└┬┘ └─┘ │ | ||
│ │ | ||
└────┬────┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└┬┘ | ||
╲___╱ ╲___╱ │ | ||
│no │no │ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└┬┘ └─┘ │ | ||
│ │ | ||
└────────┬────────┘ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └┬┘ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└─┘ └┬┘ │ | ||
└─┬──┘ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└┬┘ | ||
╲___╱ ╲___╱ │ | ||
│no │no │ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└─┘ └┬┘ │ | ||
└───┬───┘ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └─┘ | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└─┘ └┬┘ | ||
│ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└─┘ | ||
╲___╱ ╲___╱ | ||
│no │no | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└─┘ └┬┘ | ||
│ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └┬┘ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└─┘ └─┘ │ | ||
│ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└┬┘ | ||
╲___╱ ╲___╱ │ | ||
│no │no │ | ||
┌▽┐ ┌▽┐ │ | ||
│e│ │d│ │ | ||
└─┘ └─┘ │ | ||
│ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └─┘ | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└┬┘ └─┘ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└─┘ | ||
╲___╱ ╲___╱ | ||
│no │no | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└┬┘ └─┘ | ||
│ | ||
┌▽┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
┌─┐ ┌─┐ ┌─┐ | ||
│a│─>│b│─>│c│ | ||
└┬┘ └┬┘ └─┘ | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└─┘ └─┘ | ||
┌─┐ | ||
│f│ | ||
└─┘ | ||
___ ___ | ||
╱ ╲ ╱ ╲ ┌─┐ | ||
╱ ╲___╱ ╲___│c│ | ||
╲ a ╱yes╲ b ╱yes└─┘ | ||
╲___╱ ╲___╱ | ||
│no │no | ||
┌▽┐ ┌▽┐ | ||
│e│ │d│ | ||
└─┘ └─┘ | ||
┌─┐ | ||
│f│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
┌┬┐ | ||
└┴┘ | ||
___ | ||
╱ ╲ ┌─┐ | ||
╱ ╲│b│ | ||
╲ a ╱└─┘ | ||
╲___╱ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
┌┬┐ | ||
└┴┘ | ||
___ | ||
╱ ╲ ┌─┐ | ||
╱ ╲│b│ | ||
╲ a ╱└─┘ | ||
╲___╱ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
┌┬┐ | ||
└┴┘ | ||
___ | ||
╱ ╲ ┌─┐ | ||
╱ ╲│b│ | ||
╲ a ╱└┬┘ | ||
╲___╱ ┌▽┐ | ||
│c│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
┌┬┐ | ||
└┴┘ | ||
___ | ||
╱ ╲ ┌─┐ | ||
╱ ╲│b│ | ||
╲ a ╱└┬┘ | ||
╲_│_╱ │ | ||
├────┘ | ||
┌▽┐ | ||
│c│ | ||
└─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
┌┬┐ | ||
└┴┘ | ||
___ | ||
╱ ╲ ┌───┐ | ||
╱ ╲│c d│ | ||
╲ a b ╱└───┘ | ||
╲___╱ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────────────┐ | ||
│Unimplemented│ | ||
└─────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────────────┐ | ||
│Unimplemented│ | ||
└──────┬──────┘ | ||
┌───────▽──────┐ | ||
│LET'S GO DRING│ | ||
└───────┬──────┘ | ||
┌────▽───┐ | ||
│6 DRINKS│ | ||
└────┬───┘ | ||
┌─────────▽─────────┐ | ||
│HEY, I SHOULD TRY │ | ||
│INSTALLING FREEBSD!│ | ||
└───────────────────┘ |
15 changes: 13 additions & 2 deletions
15
test/Flowchart/xkcd-do-you-understand-flowchart-switch/output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────────────┐ | ||
│Unimplemented│ | ||
└──────┬──────┘ | ||
┌───────▽──────┐ | ||
│LET'S GO DRING│ | ||
└───────┬──────┘ | ||
┌────▽───┐ | ||
│6 DRINKS│ | ||
└────┬───┘ | ||
┌─────────▽─────────┐ | ||
│HEY, I SHOULD TRY │ | ||
│INSTALLING FREEBSD!│ | ||
└───────────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
while("arthur") | ||
"chocolat" | ||
_________________ | ||
╱ ╲ ┌─────┐ | ||
╱ DO YOU UNDERSTAND ╲____________________________________________________│GOOD!│ | ||
╲ FLOW CHARTS? ╱yes └──┬──┘ | ||
╲_________________╱ │ | ||
│no │ | ||
_________▽_________ ______________________ │ | ||
╱ ╲ ╱ ╲ ┌────┐ │ | ||
╱ OKAY, YOU SEE THE ╲________________╱ ... AND YOU CAN SEE ╲___│GOOD│ │ | ||
╲ LINE LABELED "YES"? ╱yes ╲ THE ONES LABELED "NO"? ╱yes└──┬─┘ │ | ||
╲___________________╱ ╲______________________╱ │ │ | ||
│no │no │ │ | ||
________▽_________ _________▽__________ │ │ | ||
╱ ╲ ┌───────────┐ ╱ ╲ │ │ | ||
╱ BUT YOU SEE THE ╲___│WAIT, WHAT?│ ╱ BUT YOU JUST ╲___ │ │ | ||
╲ ONES LABELED "NO"? ╱yes└───────────┘ ╲ FOLLOWED THEM TWICE? ╱yes│ │ │ | ||
╲__________________╱ ╲____________________╱ │ │ │ | ||
│no │no │ │ │ | ||
┌───▽───┐ │ │ │ │ | ||
│LISTEN.│ └───────┬───────┘ │ │ | ||
└───┬───┘ ┌──────▽─────┐ │ │ | ||
┌─────▽────┐ │(THAT WASN'T│ │ │ | ||
│I HATE YOU│ │A QUESTION) │ │ │ | ||
└──────────┘ └──────┬─────┘ │ │ | ||
┌────▽───┐ │ │ | ||
│SCREW IT│ │ │ | ||
└────┬───┘ │ │ | ||
└─────┬─────┘ │ | ||
│ │ | ||
└─────┬─────┘ | ||
┌───────▽──────┐ | ||
│LET'S GO DRING│ | ||
└───────┬──────┘ | ||
┌─────────▽─────────┐ | ||
│HEY, I SHOULD TRY │ | ||
│INSTALLING FREEBSD!│ | ||
└───────────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
while("arthur") | ||
"chocolat" | ||
┌─────┐ | ||
│START│ | ||
└──┬──┘ | ||
┌──────▽──────┐ | ||
│Unimplemented│ | ||
└──────┬──────┘ | ||
┌────────▽───────┐ | ||
│ASK SOMEONE FOR │ | ||
│HELP OR GIVE UP.│ | ||
└────────────────┘ |