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
void main() { | |
const two = 2; | |
const ten = 10; | |
var aNumber = ten; | |
print('aNumber before pureAdd: $aNumber'); | |
print(pureAdd(aNumber, two)); | |
print('aNumber after pureAdd: $aNumber'); | |
print('aNumber before impureAdd: $aNumber'); |
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
import 'dart:math' show Random; | |
void main() { | |
print('Testing'); | |
const age = 59; | |
print('Age: $age. Class: ${classifyAthlet(age)}.'); | |
print('Random tests'); | |
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
void main() {} | |
final class ElanDeyan extends Programmer with Entusiasm implements Person { | |
ElanDeyan(); | |
@override | |
String get name => 'Elan Deyan'; | |
// Interests | |
final studiesTheBible = true; |
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
void main() { | |
const a = Vec2(horizontalDimension: 2, verticalDimension: 3); | |
const b = Vec2(horizontalDimension: -4, verticalDimension: -2); | |
print(4.multiplyInVec2(a) - 2.multiplyInVec2(b)); | |
} | |
final class Vec2 { | |
final num horizontalDimension; | |
final num verticalDimension; | |
const Vec2( |
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
import 'dart:math' show pow, sqrt; | |
typedef Point = ({num x, num y}); | |
typedef Triple = (Point, Point, Point); | |
const epsilon = 0.00001; | |
void main() { | |
for (final triple in [ | |
scalenTriangle, |