Last active
December 22, 2021 21:55
-
-
Save b099l3/96bf2e5f1c0aa246e4d4595aaeabdb1c to your computer and use it in GitHub Desktop.
WTF dart?
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() { | |
// 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