Skip to content

Palindrome

James Brundage edited this page Oct 23, 2026 · 1 revision

Palindrome

Wave Melody Palindrome

Plays a melody in normal order, and then plays a melody in reversed order.

The resulting letters in the melody will form a palindrome

View Source
<#
.SYNOPSIS
    Wave Melody Palindrome
.DESCRIPTION
    Plays a melody in normal order, and then plays a melody in reversed order.

    The resulting letters in the melody will form a palindrome
.LINK
    https://en.wikipedia.org/wiki/Palindrome
#>
$melody = @($this.Melody)

# If there is not a current melody, return this
if (-not $melody) { return $this }

# Assign the current melody to the palindrome
$this.Melody = @(
    $melody
    [Array]::Reverse($melody)
    $melody    
)

# Play the sound.
return $this.Sound()

Clone this wiki locally