Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 2 characters in body
Source Link
jdt
  • 5.1k
  • 1
  • 16
  • 21

C (clang), (削除) 82 (削除ここまで) 78 bytes

d;f(*s,*r,n){for(*r=n>2*r=n>3?strcmp(s,++s):0;*s;*r*=!d|d<1^*r>0)d=strcmp(s-1,s++);}

Try it online! Try it online!

-4 bytes thanks to @ceilingcat!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy

C (clang), (削除) 82 (削除ここまで) 78 bytes

d;f(*s,*r,n){for(*r=n>2?strcmp(s,++s):0;*s;*r*=!d|d<1^*r>0)d=strcmp(s-1,s++);}

Try it online!

-4 bytes thanks to @ceilingcat!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy

C (clang), (削除) 82 (削除ここまで) 78 bytes

d;f(*s,*r,n){for(*r=n>3?strcmp(s,++s):0;*s;*r*=!d|d<1^*r>0)d=strcmp(s-1,s++);}

Try it online!

-4 bytes thanks to @ceilingcat!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy
added 37 characters in body
Source Link
jdt
  • 5.1k
  • 1
  • 16
  • 21

C (clang), 82(削除) 82 (削除ここまで) 78 bytes

d;f(*s,*r,n){for(*r=n>3*r=n>2?strcmp(s,++s):0;*s;*r=d&&d>0^*r>0?0:*r0;*s;*r*=!d|d<1^*r>0)d=strcmp(s-1,s++);}

Try it online! Try it online!

-4 bytes thanks to @ceilingcat!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy

C (clang), 82 bytes

d;f(*s,*r,n){for(*r=n>3?strcmp(s,++s):0;*s;*r=d&&d>0^*r>0?0:*r)d=strcmp(s-1,s++);}

Try it online!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy

C (clang), (削除) 82 (削除ここまで) 78 bytes

d;f(*s,*r,n){for(*r=n>2?strcmp(s,++s):0;*s;*r*=!d|d<1^*r>0)d=strcmp(s-1,s++);}

Try it online!

-4 bytes thanks to @ceilingcat!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy
edited body
Source Link
jdt
  • 5.1k
  • 1
  • 16
  • 21

C (clang), 82 bytes

d;f(*s,*r,n){for(*r=n>3?strcmp(s,++s):0;*s;*r=d&&d>0^*r>0?0:*r)d=strcmp(s-1,s++);}

Try it online!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not WaveWavy

C (clang), 82 bytes

d;f(*s,*r,n){for(*r=n>3?strcmp(s,++s):0;*s;*r=d&&d>0^*r>0?0:*r)d=strcmp(s-1,s++);}

Try it online!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wave

C (clang), 82 bytes

d;f(*s,*r,n){for(*r=n>3?strcmp(s,++s):0;*s;*r=d&&d>0^*r>0?0:*r)d=strcmp(s-1,s++);}

Try it online!

Returns:

  • < 0 for Increasing Wavy
  • > 0 for Decreasing Wavy
  • 0 for not Wavy
Source Link
jdt
  • 5.1k
  • 1
  • 16
  • 21
Loading

AltStyle によって変換されたページ (->オリジナル) /