language

some fools attempt at an interpreted language
Log | Files | Refs | README

depthtest.ti (418B)


      1 include fibb;
      2 
      3 func fibbioRecurse(int target, FullFibb obj) -> int:
      4 {
      5 	if target > 1:
      6 	{
      7 		return fibbioRecurse(target - 1, obj) + fibbioRecurse(target - 2, obj);
      8 	}
      9 	else:
     10 	{
     11 		return obj.do(2);
     12 	}
     13 }
     14 
     15 func fibbio(int target) -> int:
     16 {
     17 	var fibb = new FullFibb();
     18 
     19 	if target > 1:
     20 	{
     21 		return fibbioRecurse(target - 1, fibb) + fibbioRecurse(target - 2, fibb);
     22 	}
     23 	else:
     24 	{
     25 		return fibb.do(2);
     26 	}
     27 }
     28 
     29 print fibbio(20);