Skip to content

Instantly share code, notes, and snippets.

View ElanDeyan's full-sized avatar

Elan Deyan ElanDeyan

View GitHub Profile
@ElanDeyan
ElanDeyan / main.dart
Last active May 6, 2024 15:52
Dart read-only function parameters.
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');
@ElanDeyan
ElanDeyan / main.dart
Last active October 11, 2023 00:26
elegant-lantern-8613
import 'dart:math' show Random;
void main() {
print('Testing');
const age = 59;
print('Age: $age. Class: ${classifyAthlet(age)}.');
print('Random tests');
@ElanDeyan
ElanDeyan / main.dart
Created October 4, 2023 00:01
swift-pool-3288
void main() {}
final class ElanDeyan extends Programmer with Entusiasm implements Person {
ElanDeyan();
@override
String get name => 'Elan Deyan';
// Interests
final studiesTheBible = true;
@ElanDeyan
ElanDeyan / main.dart
Last active September 5, 2023 17:49
primal-jungle-2630
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(
@ElanDeyan
ElanDeyan / main.dart
Last active September 2, 2023 00:44
bold-aqueduct-4564
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,