Giter VIP home page Giter VIP logo

pushswap's Introduction

Pushswap

Epitech Project Tech 1

The game is constituted of two lists, named l_a and l_b. At the start, l_b is empty and l_a contains a certain amount of positive or negative unique numbers. The goal of the game is to make it so l_a contains the same numbers, but in ascending order. To do so, we only have the following operations :

• sa : swaps the first 2 elements of l_a (does nothing if not enough elements)

• pa : takes the first element of l_b and puts it in first position in l_a (if l_b is empty, does nothing)

• pb : takes the first element of l_a and puts it in first position in l_b (if l_a is empty, does nothing)

The Program

./push_swap [l_a]

Example

./push_swap 2 1 3 6 5 8

sa pb pb pb sa pa pa pa

pushswap's People

Contributors

adrijere 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.