GithubHelp home page GithubHelp logo

exercise-sorting-cards-with-bubble's Introduction

Sorting Cards with Bubble algorithm

Sorting is considered to be an important concept in many programming languages, as it helps us locate elements in a faster and easier manner.

The bubble sorting algorithm is one of the easiest to learn, and that is the first one normally taught. Here is a 5min explanation of how the bubble algorithm works: https://www.youtube.com/watch?v=xli_FI7CuzA

VANILLAJS BOILERPLATE ENGLISH

๐ŸŒฑ How to start this project

Do not clone this repository. The first step to start coding is cloning the vanillajs boilerplate on your local computer or opening it using gitpod.

a) If using Gitpod (recommended) you can clone the boilerplate by clicking here.

b) If working locally, type the following command from your command line:

$ git clone https://github.com/4GeeksAcademy/vanillajs-hello

๐Ÿ’ก Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>), and upload the code to your new repository using add, commit and push.

๐Ÿ“ Instructions

  1. Create a function that generates a list of random cards with suits.
  2. Let the user specify how many random cards the website should generate using text input.
  3. Add a "draw" button that when clicked it renders those cards on the website in a beautiful way.
  4. Add one "sort" button that sorts the cards using the bubble sorting algorithm.
  5. Save all the changes that you had to do while sorting the list of cards in a new array.
  6. Display the entire log of changes, one on top of the other.

This animation shows how your application should look like:

Bubble Sorting Cards on a website

๐Ÿ’ก Hint:

  1. Strategize first, no one starts coding the solution before having a clear strategy.
  2. Stick to your strategy, forget about Stack Overflow for strategy.
  3. Divide and conquer, try separating the exercise into smaller exercises, for example:
    • Make the hardcoded CSS and HTML before trying to make it dynamic, that will give you a clear sense of what HTML code you need to build with your algorithm.
    • Generate an array of random cards first, and make sure is properly being generated (using the console.log) before trying to render it into the website.
    • Make a function just for building the HTML of ONE card, and then re-use it to render all.

exercise-sorting-cards-with-bubble's People

Contributors

alesanchezr avatar elviraqdp avatar jimenaeb avatar lorenagubaira avatar mortegac avatar tommygonzaleza 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.