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
Framework To Ease Operating with Quantum Computers

QType Framework To Ease Operating with Quantum Computers Concept # define an array of 15 cubits:

Antonio Párraga Navarro 2 Jun 06, 2022
An OpenSource crowd-sourced cooking recipes website

An OpenSource crowd-sourced cooking recipes website

21 Jul 31, 2022
Integer sets where all subsets have unique sums

Evil Sums Generation of sets of numbers where all constituents are recoverable from a partial sum.

Charlotte 5 Sep 24, 2022
Blender Add-on That Provides Quick Access to Render Controls

Blender Render Buttons Blender Add-on That Provides Quick Access to Render Controls A Blender 3.0 compatablity update of Blender2.8x-RenderButton v0.0

Don Schnitzius 3 Oct 18, 2022
redun aims to be a more expressive and efficient workflow framework

redun yet another redundant workflow engine redun aims to be a more expressive and efficient workflow framework, built on top of the popular Python pr

insitro 372 Jan 04, 2023
Whatsapp Messenger master

Whatsapp Messenger master

Swarup Kharul 5 Nov 21, 2021
Listen Surah, prepare for next and Endless life...

Al-Quran In this repository, I have linked up all Surah with Arabic-Bangla Audio From Youtube. So, you just need to choose and listen. and the ( surah

SpiderX 1 Sep 30, 2022
Advent of Code 2021 challenges

Data analysis Document here the project: AoC21 Description: Project Description Data Source: Type of analysis: Please document the project the better

Daniel Wendel 1 Jan 07, 2022
Some ideas and tools to develop Python 3.8 plugins for GIMP 2.99.4

gimp-python-development Some ideas and tools to develop Python 3.8 plugins for GIMP 2.99.4. GIMP 2.99.4 is the latest unstable pre-release of GIMP 3.

Ismael Benito 53 Sep 25, 2022
Apilytics for Python - Easy API analytics for Python backends

apilytics-python Installation Sign up and get your API key from https://apilytics.io - we offer a completely free trial with no credit card required!

Apilytics 6 Sep 29, 2022
Create or join a private chatroom without any third-party middlemen in less than 30 seconds, available through an AES encrypted password protected link.

PY-CHAT Create or join a private chatroom without any third-party middlemen in less than 30 seconds, available through an AES encrypted password prote

1 Nov 24, 2021
A simple, light-weight and highly maintainable online judge system for secondary education

y³OJ a simple, light-weight and highly maintainable online judge system for secondary education 一个简单、轻量化、易于维护的、为中学信息技术学科课业教学设计的 Online Judge 系统。 Onlin

20 Oct 04, 2022
This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.

py-12f-common About This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principl

Tamás Benke 1 Dec 15, 2022
LeetComp - Background tasks powering the static content at LeetComp

LeetComp Analysing compensations mentioned on the Leetcode forums (https://kuuts

Kumar Utsav 125 Dec 21, 2022
Introduction to Databases Coursework 2 (SQL) - dataset generator

Introduction to Databases Coursework 2 (SQL) - dataset generator This is python script generates a text file with insert queries for the schema.sql fi

Javier Bosch 1 Nov 08, 2021
Sublime Text 2/3 style auto completion for ST4

Hippie Autocompletion Sublime Text 2/3 style auto completion for ST4: cycle through words, do not show popup. Simply hit Tab to insert completion, hit

Alexander Schepanovski 20 May 19, 2022
A comprensive software collection for nmea manipulation

nmeatoolkit A comprensive software collection for nmea manipulation; it includes a library and a collections of command line tools. Library pipes: con

Davide Gessa 1 Sep 14, 2022
A Notifier Program that Notifies you to relax your eyes Every 15 Minutes👀

Every 15 Minutes is an application that is used to Notify you to Relax your eyes Every 15 Minutes, This is fully made with Python and also with the us

Ashely Sato 1 Nov 02, 2021
✨ Udemy Coupon Finder For Discord. Supports Turkish & English Language.

Udemy Course Finder Bot | Udemy Kupon Bulucu Botu This bot finds new udemy coupons and sends to the channel. Before Setup You must have python = 3.6

Penguen 4 May 04, 2022
Create a program for generator Truth Table

Python-Truth-Table-Ver-1.0 Create a program for generator Truth Table in here you have to install truth-table-generator module for python modules inst

JehanKandy 10 Jul 13, 2022