Skip to main content
1 of 2
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!

rtpax
  • 721
  • 3
  • 7