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 Question

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words! Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM, ABCA

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM, ABCA

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM, ABCA

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

Tweeted twitter.com/StackCodeGolf/status/792649313319002112
added 6 characters in body
Source Link
Mario
  • 3.1k
  • 1
  • 21
  • 32

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM, ABCA

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM, ABCA

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

More cases.
Source Link
xnor
  • 149.6k
  • 26
  • 287
  • 676

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

(Note: this is an easier spin-off of my previous challenge Find the Infinity Words!, which is a spin-off of my other previous challenge Find the Swirling Words! :) )

Definition of a Wavy Word:

  1. If you connect with curves all the characters of a Wavy Word on the alphabet (A-Z) you obtain the path of a wave continuously going toward right or toward left and never changing direction, like in the diagrams below.
  2. A Wavy Word can be:
    • Raising if each consecutive character is at the right (on the alphabet) of the previous one.
    • Decreasing if each consecutive character is at the left (on the alphabet) of the previous one.
  3. All the even connection must be down, all the odd connections must be up.
  4. You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.
  5. The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, or symbols.
  6. If a word has double characters, like "SPOON", you must collapse the doubles to one character: "SPOON" > "SPON" (because if you go from O to O is zero distance).
  7. The Wavy Words will contain at least 3 distinct characters (even after doubles collapsing).

Here there are some examples:

enter image description here

Task:

Write a full program or function that will take a word from standard input and will output if it is a Wavy Word or not, and in positive case, output if it is raising or decreasing. The output can be True/False/Null, 2/1/0, 1/Null/0, -1/0/1, NO/WR/WD, etc, you decide how to represent it.

Test cases:

WAVY WORDS:
 ADEPT, BEGIN, BILL, BOSS, BOOST, CHIMP,
 KNOW, SPONGE, SPOON, TROLL, WOLF 
ADEPT > YES > RAISING
BEGIN > YES > RAISING
BILL > YES > RAISING
BOSS > YES > RAISING
BOOST > YES > RAISING
CHIMP > YES > RAISING
KNOW > YES > RAISING
SPONGE > YES > DECREASING
SPOON > YES > DECREASING
TROLL > YES > DECREASING
WOLF > YES > DECREASING
NOT WAVY WORDS:
 WATCH, EARTH, NINON, FOO, BAR, WAVE, SELECTION,
 YES, NO, DEFINITION, WATER, WINE, CODE, AAAHHHH, I, MM

Rules:

  • Shortest code wins.

Optional Task:

Find, as a list, as many Wavy Words as you can in an English dictionary, and the longest as well. You can take for example as reference the complete list of English words here.

Test case: long word with 2 distinct letters.
Source Link
xnor
  • 149.6k
  • 26
  • 287
  • 676
Loading
deleted 52 characters in body
Source Link
Mario
  • 3.1k
  • 1
  • 21
  • 32
Loading
added 1 character in body
Source Link
Mario
  • 3.1k
  • 1
  • 21
  • 32
Loading
Source Link
Mario
  • 3.1k
  • 1
  • 21
  • 32
Loading

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