Skip to content

Instantly share code, notes, and snippets.

@karuhi
Created July 1, 2019 06:32
Show Gist options
  • Save karuhi/3de5a57128225f844a81472951bdfedd to your computer and use it in GitHub Desktop.
Save karuhi/3de5a57128225f844a81472951bdfedd to your computer and use it in GitHub Desktop.
var Field, Visited;
void main() {
Field = [
[1, 1, 0, 0, 0],
[1, 0, 1, 1, 0],
[1, 1, 1, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
];
Visited = [
[true, true, true, true, true, true, true],
[true, false, false, false, false, false, true],
[true, false, false, false, false, false, true],
[true, false, false, false, false, false, true],
[true, false, false, false, false, false, true],
[true, false, false, false, false, false, true],
[true, true, true, true, true, true, true]
];
addWall(Field, 5);
}
void addWall(var list, int fillObject) {
var length = list.length;
var allWall = new List.filled(length+2, 5);
print("$allWall");
//list.insert(0,allWall);
list.add(allWall);
for (int i = 0; i < length; i++) {
list[i].insert(0,5);
}
print("$Field");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment