What?

The goal is to offset a certain ASCII image in a way to create an animation.

"""
* Creator: Nighthawk Coding Society
Sailing Ship Animation (programatic method)
"""

import time # used for delay
from IPython.display import clear_output  # jupyter specific clear


# ANSI Color Codes
OCEAN_COLOR = u"\u001B[34m\u001B[2D"
SHIP_COLOR = u"\u001B[32m\u001B[2D"
RESET_COLOR = u"\u001B[0m\u001B[2D"

def ship_print(position):  # print ship with colors and leading spaces according to position
    clear_output(wait=True)
    print(RESET_COLOR)
    
    sp = " " * position
    print(sp + "    |\   ")
    print(sp + "    |/   ")
    print(SHIP_COLOR, end="")
    print(sp + "\__ |__/ ")
    print(sp + " \____/  ")
    print(OCEAN_COLOR + "--"*35 + RESET_COLOR)


def ship():  # ship function, loop/controller for animation speed and times
    # loop control variables
    start = 0  # start at zero
    distance = 60  # how many times to repeat
    step = 2  # count by 2

    # loop purpose is to animate ship sailing
    for position in range(start, distance, step):
        ship_print(position)  # call to function with parameter
        time.sleep(.2)

        
ship() # activate/call ship function
                                                              |\   
                                                              |/   
                                                          \__ |__/ 
                                                           \____/  
----------------------------------------------------------------------

Attempt 1

I tried to make a walk cycle.

print("  O  ")
print(" /|\ ")
print(" | | ")
print("-----")
  O  
 /|\ 
 | | 
-----
print("  O  ")
print("\/|\ ")
print(" / | ")
print("-----")
  O  
\/|\ 
 / | 
-----

It didn't turn out great.

Attempt 2

This time I tried a simple wave.

def startpos():
    print("  O  ")
    print(" /|\ ")
    print(" | | ")
    print("-----")

startpos()
  O  
 /|\ 
 | | 
-----
def waveup():
    print("  O /")
    print(" /|  ")
    print(" | | ")
    print("-----")

waveup()
  O /
 /|  
 | | 
-----
def wavemid():
    print("  O|  ")
    print(" /|  ")
    print(" | | ")
    print("-----")

wavemid()
  O|  
 /|  
 | | 
-----

And here it is iterated.

import time # used for delay
from IPython.display import clear_output  # jupyter specific clear

def startpos():
    print("  O  ")
    print(" /|\ ")
    print(" | | ")
    print("-----")

def waveup():
    print("  O /")
    print(" /|  ")
    print(" | | ")
    print("-----")

def wavemid():
    print("  O|  ")
    print(" /|  ")
    print(" | | ")
    print("-----")

i = 0
while i < 30:
    clear_output(wait=True)
    if i == 0:
        startpos()
    else:
        if i % 2 == 0:
            wavemid()
        else:
            waveup()
    i += 1
    time.sleep(.2)
  O /
 /|  
 | | 
-----