En este repositorio realizaré la tarea del laberinto.

Overview

Laberinto

Perfil de GitHub del autor de este proyecto:

  1. @jmedina28

En este repositorio queda resuelta la composición de un laberinto 5x5 con sus muros correspondientes y con su posterior resolución en Python. Para mayor claridad véase la foto que se muestra a continuación:



El diagrama de flujo empleado para resolver el ejercicio es el siguiente:

(Diagrama de flujo)

El código empleado para resolver el ejercicio es el siguiente:

# Creo la tupla del muro.
muro = (
    (0, 1),
    (0, 2),
    (0, 3),
    (0, 4),
    (1, 1),
    (2, 1),
    (2, 3),
    (3, 3),
    (4, 0),
    (4, 1),
    (4, 2),
    (4, 3),
)


def creacionlab(dimension, muros):
    """Ahora vamos a crear la función
    que genera el laberinto.
    Para ello incluyo 2 parámetros en la misma:
    - La dimensión que es un integer.
    - Los muros que es una lista formada por tuplas.
    Buscamos que esta función genere el laberinto.
    """
    # Creo una lista en la que se van a incluir las filas del laberinto.
    lab = []
    # Ahora vamos a crear el bucle que añade las filas anteriormente mencionadas.
    for x in range(dimension):
        fila = []
        # El siguiente bucle va a "rellenar" las filas anteriormente generadas.
        for y in range(dimension):
            if tuple([x, y]) in muro:
                # En caso de que la tupla aparezca en la lista de muros se añade una X en la misma.
                fila.append("X")
            else:
                # En caso contrario se añadirá un espacio.
                fila.append(" ")
        lab.append(fila)
    return lab


# En la parte donde se encuentra la dimensión sustituimos por el 5 ya que el laberinto dado es 5x5.
laberinto = creacionlab(5, muro)
""" El join() devuelve un string 
uniendo todos los elementos 
de una lista, tupla o string 
 con otro string que elijamos.
"""
for x in laberinto:
    print("".join(x))
Owner
Juan Medina
Mathematical Engineering Student.
Juan Medina
ASCII-Wordle - A port of the game Wordle to terminal emulators/CMD

ASCII-Wordle A 'port' of Wordle to text-based interfaces A near-feature complete

32 Jun 11, 2022
You can change your mac address with this program.

1 - Warning! You can use this program with Kali Linux. Therefore if you don't install the Kali Linux. Firstly you need to install Kali Linux. 2 - Star

Mustafa Bahadır Doğrusöz 1 Jun 10, 2022
Automator anble you to create automations on your system

WELCOME TO AUTOMATOR BETA This programm is able to create automations on your system. This programm is only an experimantal release; infact it works v

Davide 1 Jan 12, 2022
Semantic Data Management - Property Graphs 📈

SDM - Lab 1 @ UPC 👨🏻‍💻 Table of contents Introduction Property Graph Dataset 1. Introduction This repo is all about what we have done in SDM lab 1

Mohammad Zain Abbas 1 Mar 20, 2022
0CD - BinaryNinja plugin to introduce some quality of life utilities for obsessive compulsive CTF enthusiasts

0CD Author: b0bb Quality of life utilities for obsessive compulsive CTF enthusia

12 Sep 14, 2022
Imitate Moulinette written in Python

Imitate Moulinette written in Python

Pumidol Leelerdsakulvong 2 Jul 26, 2022
An upgraded version of extractJS

extractJS_2.0 An enhanced version of extractJS with even more functionality Features Discover JavaScript files directly from the webpage Customizable

Ali 4 Dec 21, 2022
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors ins

Tyler Laceby 2 Aug 06, 2021
Automatización del proceso Inmofianza

Selenium Inmofianza Proyecto de pruebas automatizadas con selenium webdriver para el aplicativo Omnicanalidad Pre-requisitos 📋 Componentes que deben

Natalia Narváez 1 Jan 07, 2022
OpenSea NFT API App using Python and Streamlit

opensea-nft-api-tutorial OpenSea NFT API App using Python and Streamlit Tutorial Video Walkthrough https://www.youtube.com/watch?v=49SupvcFC1M Instruc

64 Oct 28, 2022
プレヤフHackUチーム「キャット・タン」が作成したアプリ「illustection」

cat_tongue_illustection プレヤフHackUチーム「キャット・タン」が作成した, プライバシー保護アプリ「illustection」です! デモ動画 https://youtu.be/z3I7LuB_i58 機能 アップロードされた画像をいい感じのイラストやの素材に置き換える(

4 Jul 03, 2021
A Web app to Cross-Seed torrents in Deluge/qBittorrent/Transmission

SeedCross A Web app to Cross-Seed torrents in Deluge/qBittorrent/Transmission based on CrossSeedAutoDL Require Jackett Deluge/qBittorrent/Transmission

ccf2012 76 Dec 19, 2022
Recreating my first CRUD in python, but now more professional

Recreating my first CRUD in python, but now more professional

Ricardo Deo Sipione Augusto 2 Nov 27, 2021
Simple Python script I use to manage and build my Reflux themes.

Simple Python script I use to manage and build my Reflux themes. Built for personal use, but anyone can easily fork and tweak to suit thier needs.

Ire 3 Jan 25, 2022
A telegram bot which programed to countdown.

countdown-vi this is a telegram bot which programed to countdown. usage well, first you should specify a exact interval. there is 5 column, very first

Arya Shabane 3 Feb 15, 2022
App to decide weekly winners in H2H 1 Win (9 Cat)

Fantasy Weekly Winner for H2H 1 Win (9 Cat) Yahoo Fantasy API Read

Sai Atmakuri 1 Dec 31, 2021
🌌A Python library to exhaustively enumerate a combinatorial space represented by a function

exhaust A Python library to exhaustively enumerate a combinatorial space represented by a function. The API is modelled after Python's random module a

Maik Riechert 1 Dec 05, 2021
A Google sheet which keeps track of the locations that want to visit and a price cutoff

FlightDeals Here's how the program works. First, I have a Google sheet which keeps track of the locations that I want to visit and a price cutoff. It

Lynne Munini 5 Nov 21, 2022
PaintPrint - This module can colorize any text in your terminal

PaintPrint This module can colorize any text in your terminal Author: tankalxat3

Alexander Podstrechnyy 2 Feb 17, 2022
Checks for Vaccine Availability at your district and notifies you using E-mail, subscribe to our website.

Vaccine Availability Notifier Project Description Checks for Vaccine Availability at your district and notifies you using E-mail every 10 mins. Kindly

Farhan Hai Khan 19 Jun 03, 2021