Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HashSet<List<KeyValuePair<int, int>>> puzzle = new HashSet<List<KeyValuePair<int, int>>>();
- List<KeyValuePair<int, int>> act = new List<KeyValuePair<int, int>>();
- for (int i = 0; i < 50; ++i) {
- for (int j = 0; j < 49; ++j) {
- if (!table[i, j] && table[i,j+1]) {
- if (j+1== 49) { //vege
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(i, j + 1));
- puzzle.Add(act);
- } else {
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(i, j+1));
- }
- } else if (table[i,j] && table[i,j+1]) {
- if (j +1 == 49) { //vege
- act.Add(new KeyValuePair<int, int>(i, j + 1));
- puzzle.Add(act);
- } else if (j == 0) { //eleje
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(i, j));
- act.Add(new KeyValuePair<int, int>(i, j + 1));
- } else { //egyeb
- act.Add(new KeyValuePair<int, int>(i, j + 1));
- }
- } else if (table[i,j] && !table[i,j+1]) {
- if (j == 0) { //eleje
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(i, j));
- puzzle.Add(act);
- } else {
- puzzle.Add(act);
- }
- }
- }
- }
- HashSet<List<KeyValuePair<int, int>>> puzzlevert = new HashSet<List<KeyValuePair<int, int>>>();
- /*hehe, fuggoleges helyek*/
- for (int i = 0; i < 50; ++i) {
- for (int j = 0; j < 49; ++j) {
- if (!table[j, i] && table[j + 1, i]) {
- if (j + 1 == 49) { //vege
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(j + 1, i));
- puzzlevert.Add(act);
- } else {
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(j+1, i));
- }
- } else if (table[j, i] && table[j+1, i]) {
- if (j + 1 == 49) { //vege
- act.Add(new KeyValuePair<int, int>(j+1, i));
- puzzlevert.Add(act);
- } else if (j == 0) { //eleje
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(j, i));
- act.Add(new KeyValuePair<int, int>(j+1, i));
- } else { //egyeb
- act.Add(new KeyValuePair<int, int>(j+1, i));
- }
- } else if (table[j, i] && !table[j+1, i]) {
- if (j == 0) { //eleje
- act = new List<KeyValuePair<int, int>>();
- act.Add(new KeyValuePair<int, int>(j, i));
- puzzlevert.Add(act);
- } else {
- puzzlevert.Add(act);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement