static public void processCase(int currentCaseNumber) { string caseResult = ""; string debugString = ""; int count = 0; int W = 0; int H = 0; int D = 0; //Reading case variables processLine(new Action <IEnumerator <string> >[] { (e) => H = int.Parse(e.Current), (e) => W = int.Parse(e.Current), (e) => D = int.Parse(e.Current) }); string[] stringMap = new string[H]; for (int i = 0; i < H; i++) { processLine((s) => stringMap[i] = s); } MirrorMap map = new MirrorMap(stringMap); map.unfoldReflections(D); count = map.countReflections(D); caseResult = "" + count; //Result streamWriter.WriteLine("Case #" + currentCaseNumber + ": " + caseResult + debugString); }
public void unfoldReflections(int distance) { unfoldMap.players.Add(players[0]); unfoldMap.planes.AddRange(planes); unfoldMap.unfoldReflections(players[0].X, players[0].Y, distance); }