Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8020247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:38:05+00:00 2026-06-04T21:38:05+00:00

I have a quite interesting problem that’s making my head twist. I’m working on

  • 0

I have a quite interesting problem that’s making my head twist. I’m working on a small system consisting of users and awards (called badges). There is a special badge that is awarded to users depending on the following criteria: 10 bronze badges, 5 silver badges and 1 gold badge. That is pretty simple, however, if an user has 8 bronze badges, 7 silver badges and 1 gold badge, he can use his 2 additional silver badges as bronze ones.

This happens everytime the user has available “higher” badges to distribute. Again, for example, if he has 8 bronze badges, 4 silver badges and 4 gold badges, he can “transform” 2 of his gold badges into bronze and 1 to silver, in order to earn the special badge.

I have absolutely no idea of how to do this. I’ve tried with various loops, ifs, but i can never distribute properly. Maybe someone can help me out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:38:07+00:00Added an answer on June 4, 2026 at 9:38 pm

    The user needs at least 1 gold badge, at least 6 badges that are either silver or gold, and at least 16 badges that are bronze, silver or gold.

    The pseudocode is

    count(gold) >= 1
    && count(gold) + count(silver) >= 6
    && count(gold) + count(silver) + count(bronze) >= 16
    

    If you also have a diamond medal that can swap for a gold, silver or bronze then include that as well, like

    count(diamond) + count(gold) >= 1
    && count(diamond) + count(gold) + count(silver) >= 6
    // etc
    

    Or you could use a ‘medal rank’ so that you can do something simpler like

    count(rank of gold or higher) >= 1
    && count(rank of silver or higher) >= 6
    && count(rank of bronze or higher) >= 16
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've come across a very interesting problem.. quite lost actually. Suppose I have a
This is an interesting problem I've come across that I feel should have an
I have an interesting problem, however I don't know quite how to articulate it
He're an interesting problem that looks for the most Pythonic solution. Suppose I have
K here is an interesting problem We have an app that is presenting with
I have recently started diving into Haskell. Its quite interesting, but the definition of
I have quite a problem concerning the use of relational database concepts in Delphi
I have quite big document in html format that generated from Microsoft Word. It
I have quite a strange problem with PHP and Apache on my local testing
We've run into an interesting situation that needs solving, and my searches have turned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.