static void Main(string[] args) { //LudoTerning 1 = new LudoTerning(); Terning[] terninger = new Terning[4]; terninger[0] = new Terning(); terninger[1] = new LudoTerning(); terninger[2] = new LudoTerning(); terninger[3] = new Terning(); foreach (var item in terninger) { item.Skriv(); } Console.ReadKey(); }
static void Main(string[] args) { YatzyTerning t1 = new YatzyTerning(); Console.WriteLine(t1.ToString()); YatzyTerning t2 = new YatzyTerning(6); Console.WriteLine(t2.ToString()); for (int i = 0; i < 10; i++) { LudoTerning l1 = new LudoTerning(); Console.WriteLine(l1.ToString()); } Console.WriteLine(); Terning t5 = new LudoTerning(); Console.WriteLine(t5.ToString()); try { LudoTerning y = new LudoTerning(10); } catch (TerningException ex) { Console.WriteLine(ex.Message); } catch (ApplicationException ex) { Console.WriteLine(ex.Message); } catch (Exception ex) { Console.WriteLine(ex.Message); } }