Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class Uno{
- public static void main(String[] args){
- System.out.println("Welcome to Uno");
- System.out.println("");
- ArrayList<Card> =new ArrayList<Card>();
- newdeck(deck);
- ArrayList<Card> p1hand=new ArrayList<Card>();
- ArrayList<Card> p2hand=new ArrayList<Card>();
- Random xdxd=new Random();
- for(int x=0; x<7;x++){
- p1hand.add(deck.get(xdxd.nextInt(deck.size()-1)));
- p2hand.add(deck.get(xdxd.nextInt(deck.size()-1)));
- }
- int cardnum xdxd.nextInt(deck.size()-1);
- Card tablecard= deck.get(xdxd);
- deck.remove(cardnum);
- do{
- System.out.println("lay down a card to match the one on the board");
- System.out.println(tablecard.getcolour()+" "+tablecard.getpowerlvl());
- }while(true);
- }
- //shuffle deck
- static void newdeck(ArrayList<Card> deck){
- do{
- int t=1;
- String colour
- if(t==1) colour="blue";
- else if(t==2) colour="green";
- else if(t==3) colour="red";
- else if(t==4) colour="yellow";
- for(int x=0; x<=10;x++){
- Card card=new Card(x, colour);
- deck.add(card);
- }
- t++;
- }while(t<=4);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement