This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int powers_recursive(int b, int l){ | |
if(l>0){ | |
for(int i=0; i<b-1; ++i){ | |
int p = powers_recursive(b, l-1); | |
printf("%d", p); | |
} | |
powers_recursive(b,l-1); | |
return l; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-- | |
This file is a slight extension of Sigfpe's "Quick and dirty reinversion of control": | |
http://blog.sigfpe.com/2011/10/quick-and-dirty-reinversion-of-control.html | |
I only added input capabilities: yieldInput + modification to yield | |
and of course the lines in imperative (i.e. our re-captured "main loop") which have to do with getting input. | |
--} |