Skip to main content
deleted 3295 characters in body
Source Link
RamenChef
  • 1.2k
  • 6
  • 9

Making a Mountain out of a Molehill

(I'm not sure what other tags to give this)


You are given a string of terrain, with molehills and mountains:

 /\ / \ _/\__ / \ ___/ \_/ \_ ____/\___/ \___ 

Your job is to replace every molehill in the string with an equivalent mountain centered in the same column. The rest of the string must be unaffected. This may require additional lines at the beginning of the string.

A molehill consists of adjacent columns where the terrain goes up, immediately followed by adjacent columns where the terrain goes down. The shortest side must be exactly one column wide.

These are all molehills:

_____/\______ /\________ __/ ________/\ \__ \ / \ / \ / \ / \/\_/ 

These are not molehills:

 /\ ___/ \______ ___ _____/ \___ ____ _______ \/ 

A mountain is like a molehill, but the shortest side is four lines high instead of one.

Examples

 /\ / \ -> / \ ____/\____ _/ \_ /\ / \ / \ __ -> / \__ _ /\__/ __/ \___/ /\ / \ -> / \ /\ /\/ \ _/ \__/\_____ _/ \_ _ _ _ _ \ / \ /\ / \ / \ / \ / \ / \ / \ / \ / -> \/ \/ \ / \ / \/\/ /\ /\ / \ / \ / \ / \ _ -> _/ \/ \ \ \ \ \ \/\______/\_______ \_ /\ /\ /\ / \ /\ / \ / \ _/\__ / \ -> / \ / \ / \ ___/ \_/ \_ / \ __/ \_/ \_ ____/\___/ \___ _/ \/ \___ 

Additional RulesMaking a Mountain out of a Molehill

  • Standard loopholes are forbidden.
  • Input and output can be in any reasonable format.
  • You may assume the presence or absence of trailing whitespace in the input string.
  • There will always be enough space in the sides of the string as well as between molehills for any mountains you might need.
  • If replacing the molehills with mountains creates additional molehills, you do not need to turn those molehills into mountains.
  • The terrain cannot go both up and down in the same column. If this happens, the terrain does not move.

This is , so the shortest answer in bytes wins.

Making a Mountain out of a Molehill

(I'm not sure what other tags to give this)


You are given a string of terrain, with molehills and mountains:

 /\ / \ _/\__ / \ ___/ \_/ \_ ____/\___/ \___ 

Your job is to replace every molehill in the string with an equivalent mountain centered in the same column. The rest of the string must be unaffected. This may require additional lines at the beginning of the string.

A molehill consists of adjacent columns where the terrain goes up, immediately followed by adjacent columns where the terrain goes down. The shortest side must be exactly one column wide.

These are all molehills:

_____/\______ /\________ __/ ________/\ \__ \ / \ / \ / \ / \/\_/ 

These are not molehills:

 /\ ___/ \______ ___ _____/ \___ ____ _______ \/ 

A mountain is like a molehill, but the shortest side is four lines high instead of one.

Examples

 /\ / \ -> / \ ____/\____ _/ \_ /\ / \ / \ __ -> / \__ _ /\__/ __/ \___/ /\ / \ -> / \ /\ /\/ \ _/ \__/\_____ _/ \_ _ _ _ _ \ / \ /\ / \ / \ / \ / \ / \ / \ / \ / -> \/ \/ \ / \ / \/\/ /\ /\ / \ / \ / \ / \ _ -> _/ \/ \ \ \ \ \ \/\______/\_______ \_ /\ /\ /\ / \ /\ / \ / \ _/\__ / \ -> / \ / \ / \ ___/ \_/ \_ / \ __/ \_/ \_ ____/\___/ \___ _/ \/ \___ 

Additional Rules

  • Standard loopholes are forbidden.
  • Input and output can be in any reasonable format.
  • You may assume the presence or absence of trailing whitespace in the input string.
  • There will always be enough space in the sides of the string as well as between molehills for any mountains you might need.
  • If replacing the molehills with mountains creates additional molehills, you do not need to turn those molehills into mountains.
  • The terrain cannot go both up and down in the same column. If this happens, the terrain does not move.

This is , so the shortest answer in bytes wins.

added 70 characters in body
Source Link
RamenChef
  • 1.2k
  • 6
  • 9
  • Standard loopholesStandard loopholes are forbidden.
  • Input and output can be in any reasonable format.
  • You may assume the presence or absence of trailing whitespace in the input string.
  • There will always be enough space in the sides of the string as well as between molehills for any mountains you might need.
  • If replacing the molehills with mountains creates additional molehills, you do not need to turn those molehills into mountains.
  • The terrain cannot go both up and down in the same column. If this happens, the terrain does not move.
  • Standard loopholes are forbidden.
  • Input and output can be in any reasonable format.
  • You may assume the presence or absence of trailing whitespace in the input string.
  • There will always be enough space in the sides of the string as well as between molehills for any mountains you might need.
  • If replacing the molehills with mountains creates additional molehills, you do not need to turn those molehills into mountains.
  • The terrain cannot go both up and down in the same column. If this happens, the terrain does not move.
  • Standard loopholes are forbidden.
  • Input and output can be in any reasonable format.
  • You may assume the presence or absence of trailing whitespace in the input string.
  • There will always be enough space in the sides of the string as well as between molehills for any mountains you might need.
  • If replacing the molehills with mountains creates additional molehills, you do not need to turn those molehills into mountains.
  • The terrain cannot go both up and down in the same column. If this happens, the terrain does not move.
added 61 characters in body
Source Link
RamenChef
  • 1.2k
  • 6
  • 9

A molehill is wheneverconsists of adjacent columns where the terrain goes up and then immediately back down, withimmediately followed by adjacent columns where the terrain goes down. The shortest side beingmust be exactly one line highcolumn wide.

A molehill is whenever the terrain goes up and then immediately back down, with the shortest side being exactly one line high.

A molehill consists of adjacent columns where the terrain goes up, immediately followed by adjacent columns where the terrain goes down. The shortest side must be exactly one column wide.

Source Link
RamenChef
  • 1.2k
  • 6
  • 9
Loading