static void Main(string[] args) { int power = 0; // Display powers of 2 up to the exponent of 8: foreach (int i in PowersOf2.Power(2, 8)) { power += 1; Console.WriteLine("2^{0} = {1} ", power, i); } // Display powers of 2 up to the exponent of 8: power = 0; foreach (int i in PowersOf2.Power(2, 8)) { power += 1; Console.WriteLine("2^{0} = {1} ", power, i); } GalaxyClass.ShowGalaxies(); }
public void BasicTests() { Assert.AreEqual(new BigInteger[] { 1 }, PowersOf2.PowersOfTwo(0)); Assert.AreEqual(new BigInteger[] { 1, 2 }, PowersOf2.PowersOfTwo(1)); Assert.AreEqual(new BigInteger[] { 1, 2, 4, 8, 16 }, PowersOf2.PowersOfTwo(4)); }