Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: samples/pop_pop_win/lib/src/poppopwin/field.dart

Issue 200723008: samples/poppopwin: upgrade to first-class sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed pkgbuild.status for rename Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of ppw; 1 part of ppw;
2 2
3 class Field extends Array2d<bool> { 3 class Field extends Array2d<bool> {
4 final int bombCount; 4 final int bombCount;
5 final Array2d<int> _adjacents; 5 final Array2d<int> _adjacents;
6 6
7 factory Field([bombCount = 40, cols = 16, rows = 16, int seed = null]) { 7 factory Field([bombCount = 40, cols = 16, rows = 16, int seed = null]) {
8 final squares = new List<bool>.filled(rows * cols, false); 8 final squares = new List<bool>.filled(rows * cols, false);
9 assert(bombCount < squares.length); 9 assert(bombCount < squares.length);
10 assert(bombCount > 0); 10 assert(bombCount > 0);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 val++; 76 val++;
77 } 77 }
78 } 78 }
79 _adjacents.set(x, y, val); 79 _adjacents.set(x, y, val);
80 } 80 }
81 return val; 81 return val;
82 } 82 }
83 83
84 String toString() => 'w${width}h${height}m${bombCount}'; 84 String toString() => 'w${width}h${height}m${bombCount}';
85 } 85 }
OLDNEW
« no previous file with comments | « samples/pop_pop_win/lib/src/html/high_score_view.dart ('k') | samples/pop_pop_win/lib/src/poppopwin/game.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698