Skip to content

datacloudgui/logic_problems_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logic_problems_API

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Testing
  5. Contact
  6. Acknowledgements

About The Project

This API solve two logical problems:

Can be reviewed: https://smklogic.herokuapp.com/index/

This project uses the following libraries and technologies:

  • Python3
  • Pandas - To analize the txt file
  • Django
  • PostgresQL - Two tablas created in Ping Pong problem
  • GIT
  • AWS - The deployed postgres DB attached to heroku settings

Ping pong problem

Ana, Jose and Juan play ping pong, each of them play the quantity of games viewed below.

If a player lose the game, in the next game the waiting player plays against the winner.

Player name Score
Ana 17
José 15
Juan 10

Question: Who is the loser of the second game? and which games this person lose?

Second problem: Find Password

Find the shortest password based in a .txt file, that contain sequences of the password.

A sequence contain some characters of the password keeping the order.

password: 34879 one possible sequence: 389

The input file must contain a sequence per line. An example file can be dowloaded from:

Right clic and Save Link As ...:

https://raw.githubusercontent.com/datacloudgui/logic_problems_API/main/keylog.txt

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repo

    git clone https://github.com/datacloudgui/logic_problems_API.git
  2. Don forget setup your virtual environment with your favorite tool

  3. Activate the virtual environment and install the dependencies

  4. Install requirements

    pip install -r requirements.txt
  5. Setup a Postgres DB, the recommended way is using a

    docker run --rm --name core-postgres -p 5432:5432 -e POSTGRES_PASSWORD=secret -d postgres

Usage

To use locally just run the server

python manage.py runserver

Testing

The two main files that contain the solution to the problems can be tested:

  1. Test the Ping Pong problem

Those test was writen using the Django dedicated file tests.py and can be run with:

python manage.py test logic.tests
  1. Test the Password finder

Those test was writen into the file that define the Class writen and can be run with:

python logic/password_finder.py

Contact

Guillermo Sanchez - @datacloudgui - guillermo@datacloudgui.com

Personal page: datacloudgui.com

Acknowledgements

About

An API that solve two logical problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors