Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Y Fibonnoci
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { delegate T id<T>(T arg0); static id<T> Y<T>(id<id<T>> f) { //Y f = f ( Y f ) return x => f(Y(f))(x); } static id<id<T>> _<T>(id<id<T>> f) { return f; } public static void Main(string[] args) { var fib = _<int>(f => n => n < 3 ? n : f(n - 1) + f(n - 2)); Console.WriteLine(Y(fib)(5)); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Returning object as parameter (pre-example without overloading)
asdasd
Find duplicated values in a list
miner
3
Generic Reference constraint
Programmes
Konsol Kelebek Deseni
123
D11
Please log in to post a comment.