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 8947205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:41:53+00:00 2026-06-15T12:41:53+00:00

I am creating a basic top trumps app in android development. I only need

  • 0

I am creating a basic top trumps app in android development. I only need 6 top trumps card which have been made by using a database. I already have the code for this and have successfully created the cards.

I am stuck on this bit

When the user selects Play you should randomly assign half of the cards in the database to the human player, and half of the cards to the computer.

And was wondering if anyone had any ideas on how to do this? Thanks everyone.

UPDATE

I have tried doing this

ArrayList<Integer> cards = new ArrayList<Integer>();
for(int i=1;i<=6;i++)
{
this.cards.add(i);
}
Collections.shuffle(this.cards);

To shuffle the cards but I’m unsure on how to assign the computer and user the cards.

  • 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-15T12:41:54+00:00Added an answer on June 15, 2026 at 12:41 pm

    I’m not sure what you are aiming for here, but would something like this do (after you have shuffled):

    ArrayList<Integer> playerCards = new ArrayList<Integer>(cards.subList(0,2));    
    ArrayList<Integer> computerCards = new ArrayList<Integer>(cards.subList(3,5));  
    

    Of course, you should use variables instead of constants everywhere, but you get the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What should I read for creating a basic augmented reality app for android? I
I'm creating an Android app utilising OpenGL ES, and need some help with the
I'm creating a Django app in which I have a table which has 'items',
I am working on my first ever android app, and I'm creating basic exercise/calorie
I'm creating some basic OO scripts using MySQLi and getting an Undefined Method error
I'm creating a basic form with ajax submit using jquery framework. This is my
Using jQuery I'm creating a basic 'tooltip' animation so that the tooltip will appear
My current class is planning on creating a basic networked game, but we have
I am using the Grails ajaxflow plugin for creating a basic wizard. One issue
I am creating a multiplayer chess game in Visual Basic.Net and I need to

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.