Skip to main content
added 13 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements from the end each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements from the end each time, until there are only two elements left and we're done.

added 116 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

added 111 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

C (gcc), 88 71 62 6060 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemmovewmemcpy(l,l+1,n-=2);} 

Try it online!Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 bytes

Saved 9 bytes thanks to ceilingcat!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemmove(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

C (gcc), 88 71 62 60 59 bytes

Saved 9 bytes thanks to ceilingcat!!!

Saved a byte thanks to G. Sliepen!!!

t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);} 

Try it online!

Inputs a pointer to the array and its length and milks the array in place.

Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last. This is repeated, shifting down 2 elements each time, until there are only two elements left and we're done.

added 24 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
deleted 12 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
deleted 12 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
deleted 30 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading