Coder Social home page Coder Social logo

cyclotron's Introduction

Algorithm Cyclotron! ๐Ÿ˜Š

๐Ÿค” Contextualizing

Low complexity algorithm (O(n)) where the cyclotron function takes two inputs. An entry is a particle, and this particle can only be "p", "n" or "e". The other entry is a matrix, where this matrix must be quadratic, that is, all lists within the matrix must have the same size as the matrix, and the matrix must also have a minimum size of 4 elements. In case something comes up outside this scope, an error should be created.

๐Ÿ’Ž How the project works

When using the cyclotron function with particle "n", the function returns the same matrix, however, with the list of index 0 filled by "n" until the end.

When using the cyclotron function with particle "e", the function returns the same matrix, however, with the list of index 0 filled by "e" until the end, and all the last elements of the internal lists are also transformed into "e" .

The cyclotron function with particle "p" is a little more complex, the function returns the same matrix, however, with the list of index 0 filled by "p" until the end, all the last elements of the internal lists are also transformed into " p", with the exception of the last list, because in the last list, all elements are transformed into "p", except the last element. Furthermore, in the penultimate list of the matrix, the last 2 elements are transformed into "p".

In addition to cyclotron, a file called main.py was also made. With it you can run the cyclotron function in the shell with the command python3 main.py inside the ./src route.

๐Ÿ› ๏ธ Installation

Project installation

  • Download the repository
  git clone [email protected]:vicsantus/cyclotron.git && cd cyclotron
  • Install tests (Only if you want to test the project)
  python3 -m pip install -r dev-requirements.txt
  • Test the project (Only if you want to test the project)
  python3 -m pytest -s -vv
  • Use the main.py function (Only if you want to use the cyclotron function from the shell)
  cd src && python3 main.py

๐Ÿ‘จโ€๐Ÿ’ป Technologies

The entire project was done in python, and the tests were done in pytest.

Code for love, love for code โ™ฅ๏ธ.

cyclotron's People

Contributors

vicsantus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.