Skip to main content
suggestion from comments
Source Link
rtpax
  • 721
  • 3
  • 7

C (GCC) 161161 158 bytes

-3 bytes from ceilingcat

#define B,b[i++]
b[]=L"";main(a,t,i){srand(time(0));for(i=b;--i;t=b[a],b[a]=*b,*b=ti;b[a]=t)a=rand*b=b[a=rand(t=*b)%7;printf%7];printf("  1\n %d %d\n%d 9 %d\n %d %d\n  %d"B B B B B B B);}

L"" has non-printing characters that I can't get to show in SE is equivalent to {2,3,4,5,6,7,8}

this code makes the assumption that the address of b is at least 14 in order to guarantee all results are possible

Try it online!Try it online!

C (GCC) 161 bytes

#define B,b[i++]
b[]=L"";main(a,t,i){srand(time(0));for(i=b;--i;t=b[a],b[a]=*b,*b=t)a=rand()%7;printf("  1\n %d %d\n%d 9 %d\n %d %d\n  %d"B B B B B B B);}

L"" has non-printing characters that I can't get to show in SE is equivalent to {2,3,4,5,6,7,8}

this code makes the assumption that the address of b is at least 14 in order to guarantee all results are possible

Try it online!

C (GCC) 161 158 bytes

-3 bytes from ceilingcat

#define B,b[i++]
b[]=L"";main(a,t,i){srand(time(0));for(i=b;--i;b[a]=t)*b=b[a=rand(t=*b)%7];printf("  1\n %d %d\n%d 9 %d\n %d %d\n  %d"B B B B B B B);}

L"" has non-printing characters that I can't get to show in SE is equivalent to {2,3,4,5,6,7,8}

this code makes the assumption that the address of b is at least 14 in order to guarantee all results are possible

Try it online!

Source Link
rtpax
  • 721
  • 3
  • 7

C (GCC) 161 bytes

#define B,b[i++]
b[]=L"";main(a,t,i){srand(time(0));for(i=b;--i;t=b[a],b[a]=*b,*b=t)a=rand()%7;printf("  1\n %d %d\n%d 9 %d\n %d %d\n  %d"B B B B B B B);}

L"" has non-printing characters that I can't get to show in SE is equivalent to {2,3,4,5,6,7,8}

this code makes the assumption that the address of b is at least 14 in order to guarantee all results are possible

Try it online!