Skip to main content
added ungolfed code
Source Link
Geo
  • 91
  • 3

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

Try it online

Ungolfed

void f(int k){ printf("%d ",k); if(k) f(rand()%k); } 

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

Try it online

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

Try it online

Ungolfed

void f(int k){ printf("%d ",k); if(k) f(rand()%k); } 
added 180 characters in body
Source Link
Geo
  • 91
  • 3

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

Try it online

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 

Try it online

previous program didn't meet a condition for the challenge
Source Link
Geo
  • 91
  • 3

C, 7038 bytes

Full program compiles in ubuntu with gcc. Recursively calls itself until it prints 0.

mainf(int a,char **bk){printf("%d ",a=rand()%atoi(b[1])k);a;k?mainf(a,brand()%k):0;} 

C, 70 bytes

Full program compiles in ubuntu with gcc. Recursively calls itself until it prints 0.

main(int a,char **b){printf("%d ",a=rand()%atoi(b[1]));a?main(a,b):0;} 

C, 38 bytes

f(k){printf("%d ",k);k?f(rand()%k):0;} 
Source Link
Geo
  • 91
  • 3
Loading