3. Dart - Built in Libraries 1
Importing Libaries:
import 'LIBRARYNAME';
RNG Library:
import 'dart:math';
Create a new RNG generator
Random variable = new Random();
RNG:
int variable = rand.nextInt(100);
// rolls from 0 to 99 for the variable
Input Library:
import 'dart:io';
Create a variable to hold input:
String variable = stdin.readLineSync();
Converting String to int:
variable = int.parse(variablestring);
Converting int to String:
variablestring = variableint.toString();
Comments
Post a Comment