static void Main() { Fibbonacci fi = new Fibbonacci(); TriangleNums tri = new TriangleNums(); foreach (int numb in fi.nextMemb(7)) { Console.Write(numb + " "); } Console.WriteLine(); foreach (double numb in tri.nextMemb(7)) { Console.Write(numb + " "); } Console.WriteLine(); var fifi = fi.nextMemb(7).GetEnumerator(); var tritri = tri.nextMemb(7).GetEnumerator(); for (int i = 0; i < 7; i++) { fifi.MoveNext(); tritri.MoveNext(); Console.Write((int)fifi.Current + (double)tritri.Current + " "); } }
public void ShouldCalculateFor54() { //arrange Fibbonacci fib = new Fibbonacci(); //act Int64 actualNumber = fib.CalculateFibonnacciNumber(54); //assert actualNumber.Should().Be(1485L); }
public void ShouldTake0AndReturn0() { //arrange Fibbonacci fib = new Fibbonacci(); //act Int64 actualNumber = fib.CalculateFibonnacciNumber(0); //assert actualNumber.Should().Be(0); }
static void Main() { Fibbonacci fi = new Fibbonacci(); foreach (int numb in fi.NextMemb(7)) { Console.Write(numb + " "); } Console.WriteLine(); foreach (int numb in fi.NextMemb(7)) { Console.Write(numb + " "); } Console.WriteLine(); }
internal static int Solve() { Timer timer = new Timer(); timer.Begin(); var fibbonacci = new Fibbonacci(1, 2); while (fibbonacci.Num2 < 4000000) { fibbonacci.Next(); } var evens = fibbonacci.Sequence.Where(x => x % 2 == 0); return(evens.Sum()); }
static void Main() { Fibbonacci fi = new Fibbonacci(); var fib = fi.NextMemb(7).ToArray(); TriangleNumbers triangleNumbers = new TriangleNumbers(); var tr = triangleNumbers.NextMemb(7).ToArray(); Console.WriteLine("Fib"); Array.ForEach(fib, Console.WriteLine); Console.WriteLine("triangle"); Array.ForEach(tr, Console.WriteLine); Console.WriteLine("+"); for (int i = 0; i < Math.Max(tr.Count(), fib.Count()); i++) { Console.WriteLine(tr[i] + fib[i]); } }
public void RedisCacheFibonacci() { var fibbonacci = new Fibbonacci(new FiboRedisCache("localhost")); Console.WriteLine(fibbonacci.Get(10)); }
public void MemoryCacheFibonacci() { var fibbonacci = new Fibbonacci(new FiboMemoryCache()); Console.WriteLine(fibbonacci.Get(10)); }