Giter Site home page Giter Site logo

42_pushswap's Introduction

42_pushswap

push swap, a 42 school project about ordination algorithm.

push_swape 100sucess

Tip

This project was done with in TDD mode -> Test Driven Development. Screenshot from 2024-07-05 13-15-13

If you wanna try my tester, you should type: cd _ci_tdd && make

Efficiency vs Efficacy

  • What's the difference between them?
  • Which one is required for the push_swap project?

Real Case Study

Let's suppose that you need to commute from your house to your work by car, but here is a traffic jam ahead, like Mr. Goofy from Disney: https://www.youtube.com/watch?v=_Tlk6e61E6w

Screenshot from 2024-05-28 19-43-27

Efficiency - The goal, whatever it takes

You can drive like Mr. Goofy but at crazy mode accelerating a lot, changing lanes every second, hitting brakes... and eventually arriving at work. Screenshot from 2024-05-28 19-34-53

Did you make the goal? Yes.

But probably, you burned some really important resources from your car (gas, oil, brakes, engine), and from yourself (mental health, stress, anxiety, etc...)

Efficacy - The goal, with minimal resources

However, you can also goes like the initial state from Mr. Goofy: a pleasant guy which could find another path or even just wait with pacience and love the innevitable truth: there will be a traffic jam ahead. Screenshot from 2024-05-28 19-39-16

Did you make the goal? Yes.

Without burning your brain, tires and fuel unnecessarily.

Push_Swap - Which one is required?

Push Swap is about a program that sort numbers from user's input, but also:

  • has 2 stacks to store the given numbers;
  • has 11 basic functions to move the numbers between stacks;
  • calculates the cost of every number, with a given target
  • search for the cheapest moviment
  • do the moviments to sort the list Even with cost calculation, this program works only with efficiency mode (the goal, whatever it takes). The project's algorithm was created by Mia Combeau: https://github.com/mcombeau/push_swap

Screenshot from 2024-07-05 13-24-06

42_pushswap's People

Contributors

biralavor avatar

Watchers

 avatar  avatar

42_pushswap's Issues

bugfix all negative numbers list

if the list only have negative numbers, like ./push_swap -42 -2 -10 -20 -11 -1, it gives an error

Screenshot from 2024-06-28 19-42-33

Possible solution: update the function ft_argv_only_nbrs_per_string

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.