Created
September 9, 2019 11:32
-
-
Save muchirijane/40ee24d7f35c5ed8eb9d6fcfc7c0fc4b to your computer and use it in GitHub Desktop.
This is an example of how you can generate random numbers in Dart.
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 is how to generate a rondom number in Dart | |
// The integer will be from 1 - 6 since i added (+1) | |
import 'dart:math'; | |
void main() { | |
int randomNumber = Random().nextInt(6) + 1; | |
print(randomNumber); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment