Skip to main content
Tweeted twitter.com/StackCodeGolf/status/1222399122914848768
added 69 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume every word has at least 2 letters
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE, AZL, ZA

False

BONES, ACDB, ALBZ, EGDF

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE

False

BONES, ACDB, ALBZ

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume every word has at least 2 letters
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE, AZL, ZA

False

BONES, ACDB, ALBZ, EGDF

Became Hot Network Question
Add "decision-problem" tag
Link
Deadcode
  • 12.9k
  • 2
  • 71
  • 55
added 7 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE

False

BONES, ACDB, ALBZ

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE

False

ACDB, ALBZ

A "simple circular" word is a word whose chords do not intersect. The chords of a word may be seen by laying out the alphabet in a circle, and then connecting the word's consecutive letters.

Examples of Simple Circular Words

ROLE

ROLE

LAKE

LAKE

BALMY

BALMY

Failing Example

A word fails to be simple circular if any of its chords intersect:

BONES

The Challenge

Write a program or function that takes a word and returns true if it's simple circular, false otherwise.

  • Code golf, fewest bytes wins.
  • Standard rules.
  • You may assume there are no repeated letters in the word.
  • You may assume the word is all uppercase, or all lowercase, whichever you prefer.
  • You may output any two consistent values for true and false.

Test Cases

True

ROLE, LAKE, BALMY, AEBDC, ABZCYDXE

False

BONES, ACDB, ALBZ

You've shown BALMY to be true but had it in the False category.
Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148
Loading
added 101 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95
Loading
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95
Loading