Skip to content

Instantly share code, notes, and snippets.

View spiechu's full-sized avatar

Dawid Spiechowicz spiechu

View GitHub Profile
@sethladd
sethladd / secret_santas.dart
Created December 9, 2013 05:46
My humble entry for Dart Dare - Secret Santa. I'm sure there are smaller or faster ways to do this. However, I wanted to try to solve the problem with sorting and processing lists. The entire solution hinges on sorting the santas by last name and by family size. Features of Dart that I used: * Classes * String interpolation * Type annotations * …
class Person {
String firstName, lastName;
Person(List<String> raw) : firstName = raw[0], lastName = raw[1];
String toString() => '$firstName $lastName';
}
/**
* Expects one person per line, each line containing a first and last name
* separated by a single space.
*/