Skip to content

Instantly share code, notes, and snippets.

@b099l3
Last active December 22, 2021 21:55
Show Gist options
  • Save b099l3/96bf2e5f1c0aa246e4d4595aaeabdb1c to your computer and use it in GitHub Desktop.
Save b099l3/96bf2e5f1c0aa246e4d4595aaeabdb1c to your computer and use it in GitHub Desktop.
WTF dart?
void main() {
// Careful with filled it will use the same object
//final _map = List.filled(10, List.filled(10, 0));
final _map = List.generate(10, (_) => List.generate(10, (_) => 0));
_map[1][1] = 1;
_map[0][1] = 1;
print('This is madness ${_map[1][2] == 1 ? 'yes' : 'no'} ');
_map.forEach(print);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment