Advertisement
Forlorn_Hope

Untitled

Mar 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3. public class Uno{
  4. public static void main(String[] args){
  5. System.out.println("Welcome to Uno");
  6. System.out.println("");
  7. ArrayList<Card> =new ArrayList<Card>();
  8. newdeck(deck);
  9. ArrayList<Card> p1hand=new ArrayList<Card>();
  10. ArrayList<Card> p2hand=new ArrayList<Card>();
  11. Random xdxd=new Random();
  12. for(int x=0; x<7;x++){
  13. p1hand.add(deck.get(xdxd.nextInt(deck.size()-1)));
  14. p2hand.add(deck.get(xdxd.nextInt(deck.size()-1)));
  15. }
  16. int cardnum xdxd.nextInt(deck.size()-1);
  17. Card tablecard= deck.get(xdxd);
  18. deck.remove(cardnum);
  19. do{
  20. System.out.println("lay down a card to match the one on the board");
  21. System.out.println(tablecard.getcolour()+" "+tablecard.getpowerlvl());
  22. }while(true);
  23. }
  24. //shuffle deck
  25. static void newdeck(ArrayList<Card> deck){
  26. do{
  27. int t=1;
  28. String colour
  29. if(t==1) colour="blue";
  30. else if(t==2) colour="green";
  31. else if(t==3) colour="red";
  32. else if(t==4) colour="yellow";
  33. for(int x=0; x<=10;x++){
  34. Card card=new Card(x, colour);
  35. deck.add(card);
  36. }
  37. t++;
  38. }while(t<=4);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement