Dart mode

AخA
 
1
 import 'dart:math' show Random; void main() { print(new Die(n: 12).roll()); } // Define a class. class Die { // Define a class variable. static Random shaker = new Random(); // Define instance variables. int sides, value; // Define a method using
2
            shorthand syntax. String toString() => '$value'; // Define a constructor. Die({int n: 6}) { if (4
3
            <=n && n <=2 0) { sides=n ; } else { // Support for errors and exceptions. throw new ArgumentError(/* */); } } // Define an instance method.
4
                int roll() { return value=s haker.nextInt(sides) + 1; } }