Bootcamps

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Academy

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Full-Stack Software Developer - 16w

Data Science and Machine Learning - 16 wks

Search from all Lessons


LoginGet Started

Register to 4Geeks

← Back to Projects

Bubble Sorting Cards

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast

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 on 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 (recomendada) you can clone the boilerplate by clicking here.

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

1$ 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 much random cards the website should generate using a 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 hard to do while sorting the list of cards in a new array.
  6. Display the entire log of changes one on top of each 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 in 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, 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.

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Difficulty

  • intermediate

Average duration

8 hrs

Technologies

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast