static void Main(string[] args) { InputCacher.AddCache("10 6 "); InputCacher.AddCache("XXXXXXXXXX"); InputCacher.AddCache("X....X...X"); InputCacher.AddCache("X....X...X"); InputCacher.AddCache("X.X..X.X.X"); InputCacher.AddCache("X.X..>.X.X"); InputCacher.AddCache("XXXXXXXXXX"); InputCacher.Disable(); Bludiste bludiste = new Bludiste(CodexReader.getInt(), CodexReader.getInt()); List <int> buffer = new List <int>(); while (buffer.Count() < bludiste.VelikostMapy()) { int c = InputCacher.Read(); if (".X^>v<".Contains((char)c)) { buffer.Add(c); } } bludiste.NactiMapu(buffer.ToArray()); for (int i = 1; i <= 20; i++) { bludiste.PohniObjekty(); bludiste.VypisMapu(); } }
/// <returns>Returns last char read</returns> protected static int skipNonIntegers() { int c = InputCacher.Read(); while ((c != '-') && !isDigit(c)) { c = InputCacher.Read(); } return(c); }
public static int getInt() { int x = 0; int c = skipNonIntegers(); bool isNegative = false; if (c == '-') { isNegative = true; c = InputCacher.Read(); } while (isDigit(c)) { x = 10 * x + (c - '0'); c = InputCacher.Read(); } return(isNegative ? (-1) * x : x); }
public static int getChar() { int c = InputCacher.Read(); return(c); }