Recode this python code into p5.js. Have fun and give the full code!

import os
import time

# --- Constants for our tiles ---
WALL = "⬛"
EMPTY = "⬜"
PLAYER = "🟦"
GOAL = "🟩"

# --- ASCII Art for the Title ---
TITLE_ART = """
  ___                   _               ___
  / __\\ __ __ ___      _| | ___ _ __    / __\\___  _ __ ___
 / / | '__/ _` \\ \\ /\\ / / |/ _ \\ '__|  / /  / _ \\| '__/ _ \\
/ /__| | | (_| |\\ V  V /| |  __/ |    / /__| (_) | | |  __/
\\____/_|  \__,_| \\_/\_/ |_|\\___|_|    \\____/\\___/|_|  \___|

"""

# --- Map Database ---
MAPS = {
    "Map 1: The Classic": [
        [WALL, WALL, WALL, WALL, WALL, WALL],
        [WALL, PLAYER, WALL, EMPTY, GOAL, WALL],
        [WALL, EMPTY, WALL, EMPTY, WALL, WALL],
        [WALL, EMPTY, WALL, EMPTY, EMPTY, WALL],
        [WALL, EMPTY, WALL, WALL, EMPTY, WALL],
        [WALL, EMPTY, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, WALL, WALL, WALL, WALL, WALL],
    ],
    "Map 2: Open Field": [
        [WALL, WALL, WALL, WALL, WALL, WALL, WALL],
        [WALL, PLAYER, EMPTY, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, EMPTY, EMPTY, GOAL, EMPTY, EMPTY, WALL],
        [WALL, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, WALL, WALL, WALL, WALL, WALL, WALL],
    ],
    "Map 3: The Corridor": [
        [WALL, WALL, WALL, WALL, WALL, WALL],
        [WALL, PLAYER, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, WALL, WALL, WALL, EMPTY, WALL],
        [WALL, GOAL, EMPTY, EMPTY, EMPTY, WALL],
        [WALL, WALL, WALL, WALL, WALL, WALL],
    ],
}


def clear_screen():
    """Clears the terminal screen."""
    os.system("cls" if os.name == "nt" else "clear")


def print_map(current_map):
    """Takes a list of lists and prints it as a clean grid."""
    for row in current_map:
        print("".join(row))
    print("\n")


def find_player(current_map):
    """Searches the map to find the row and column of the PLAYER tile."""
    for row_index, row_content in enumerate(current_map):
        for col_index, tile in enumerate(row_content):
            if tile == PLAYER:
                return (row_index, col_index)
    return (None, None)


def show_menu_and_get_choice():
    """Displays the main menu and handles map selection."""
    map_names = list(MAPS.keys())
    while True:
        clear_screen()
        print(TITLE_ART)
        print("Available Maps")
        for i, name in enumerate(map_names):
            print(f"{i + 1}: {name}")
        print(f"{len(map_names) + 1}: Quit Game")
        print("\n")

        try:
            choice = input("Enter Map number: ")
            choice_num = int(choice)
            if choice_num == len(map_names) + 1:
                return None  # Signal to quit the program
            if not (1 <= choice_num <= len(map_names)):
                raise ValueError

            selected_name = map_names[choice_num - 1]
            confirm = input(f"Load {selected_name}? [y/n]: ").lower().strip()
            if confirm == "y":
                return MAPS[selected_name]
            else:
                continue
        except ValueError:
            print(f"Invalid input. Please enter a number from 1 to {len(map_names) + 1}.")
            time.sleep(2)


def play_game(game_map_data):
    """Takes map data and runs the main game loop. Returns a status string."""
    map_data = [row[:] for row in game_map_data]  # Deep copy is crucial for resets

    while True:
        clear_screen()
        print_map(map_data)
        player_row, player_col = find_player(map_data)

        if player_row is None:
            # --- NEW VICTORY SCREEN ---
            print("Victory, you made it!")
            while True:
                post_game_move = input(
                    "Press M to go back to the menu or R to reset the map: "
                ).upper().strip()
                if post_game_move == "M":
                    return "MENU"
                elif post_game_move == "R":
                    return "RESET"
                else:
                    print("Invalid option. Please press M or R.")
                    time.sleep(1.5)

        move = input("Enter a move (W/A/S/D) or action (R/M): ").upper().strip()

        if move in ["W", "A", "S", "D"]:
            next_row, next_col = player_row, player_col
            if move == "W": next_row -= 1
            elif move == "S": next_row += 1
            elif move == "A": next_col -= 1
            elif move == "D": next_col += 1

            if not (0 <= next_row < len(map_data) and 0 <= next_col < len(map_data[0])):
                print("You can't move off the map!")
                time.sleep(1)
                continue

            destination_tile = map_data[next_row][next_col]
            if destination_tile == WALL:
                print("You can't move into a wall!")
                time.sleep(1)
                continue
            elif destination_tile == GOAL:
                map_data[player_row][player_col] = EMPTY
                map_data[next_row][next_col] = EMPTY
            else:
                map_data[next_row][next_col] = PLAYER
                map_data[player_row][player_col] = EMPTY
        # --- NEW ACTION HANDLING ---
        elif move == "R":
            confirm = input("Do you want to reset the map? [y/n]: ").lower().strip()
            if confirm == "y":
                return "RESET"
        elif move == "M":
            confirm = input("Do you want to go back to the menu? [y/n]: ").lower().strip()
            if confirm == "y":
                return "MENU"
        else:
            print("Invalid input!")
            time.sleep(1)


# --- Main Program Execution ---
if __name__ == "__main__":
    while True:  # Main program loop to allow returning to menu
        chosen_map = show_menu_and_get_choice()
        if chosen_map is None:
            break  # Exit the main loop if user chose to quit

        while True:  # Gameplay loop to allow for resets
            game_status = play_game(chosen_map)
            if game_status == "MENU":
                break  # Exit gameplay loop, will go back to main menu
            elif game_status == "RESET":
                continue  # Continue gameplay loop, re-running the game
    
    clear_screen()
    print("Thanks for playing!")