Created
May 30, 2020 16:11
-
-
Save cipto-hd/5a7241464e34fcd941541347b66d6f12 to your computer and use it in GitHub Desktop.
Using Map to describe stories flow in Dart Lang. Awesome
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
main() { | |
void nextStory(int userChoice) { | |
int _storyNumber = 4; | |
_storyNumber = { | |
0: {1: 2, 2: 1}, | |
1: {1: 2, 2: 3}, | |
2: {1: 5, 2: 4}, | |
3: {1: 0, 2: 0}, | |
4: {1: 0, 2: 0}, | |
5: {1: 0, 2: 0}, | |
}[_storyNumber][userChoice]; | |
print(_storyNumber); | |
} | |
nextStory(2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment