Skip to main content
Reword one of the subheadings to make more sense
Source Link
Teron
  • 141
  • 4

#Haskell, 52 bytes

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function soas it isn't defined in two placesis only used once (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

#Haskell, 52 bytes

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function so it isn't defined in two places (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

#Haskell, 52 bytes

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function as it is only used once (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y
Nitpicked header
Source Link
DJMcMayhem
  • 59.6k
  • 17
  • 196
  • 348

#Haskell (52, 52 bytes)#

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function so it isn't defined in two places (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

#Haskell (52 bytes)#

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function so it isn't defined in two places (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

#Haskell, 52 bytes

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function so it isn't defined in two places (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y
Source Link
Teron
  • 141
  • 4

#Haskell (52 bytes)#

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y

I suspect I could get this a chunk smaller if I managed to get rid of the "where" construct, but I'm probably stuck with zipWith.

This works by making a list of the rises (True) and falls (False), then making a list of if the ajacent entries in this list are different


This is my first attempt at one of these, so I'll go through my thought process in case I've gone horribly wrong somewhere.

###Ungolfed Version (168 bytes)###

isBumpy :: [Char] -> Bool
isBumpy input = and $ areBumps $ riseFall input
  where
    riseFall ax@(x:xs) = zipWith (>) xs ax
    areBumps ax@(x:xs) = zipWith (/=) xs ax

###Shorten names, remove type information (100 bytes)###

f x = and $ g $ h x
  where
    h ax@(x:xs) = zipWith (>) xs ax
    g ax@(x:xs) = zipWith (/=) xs ax

###Move h into the main function so it isn't defined in two places (86 bytes)###

f ax@(x:xs) = and $ g $ zipWith (>) xs ax
  where
    g ax@(x:xs) = zipWith (/=) xs ax

###Realise that areBumps and riseFall are similar enough to abstract (73 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h ya@(y:ys) = zipWith h ys ya

###Note that (tail y) is shorter than ya@(y:ys) (70 bytes)###

f x  = and $ g (/=) $ g (>) x
  where
    g h y = zipWith h (tail y) y

###Tidy up; remove unneeded spaces (52 bytes)###

f x=and$g(/=)$g(>)x
  where g h y=zipWith h(tail y)y