[email protected] webmail now available. Want one? Go here.
You will not find us on Bing and you will get a bounce when you try registering with an outlook/hotmail/live email address here. And the irony is they spam us and we don't spam them. Not our fault. Blame the corporate bully. #microsoftdeez
Paste
Pasted as Java by eksi ( 3 years ago )
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package eksideneme;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Random;
class Card{
String rank; // a,2,3,4,5,6,7,8,9
String suit;
public Card(String r,String s){
this.rank=r;
this.suit=s;
}
}
public class Eksideneme {
public static void main(String[] args) {
Random rand = new Random();
int random;
Card h2=new Card("h","2");
Card c7=new Card("c","7");
Card s4=new Card("s","4");
Card c6=new Card("c","6");
Card s5=new Card("s","5");
Queue<Card> deste = new LinkedList<>();
deste.add(h2);
deste.add(c7);
deste.add(s5);
deste.add(s4);
deste.add(c6);
System.out.println("KARIŞTIRMA ÖNCESİ");
for(Card a:deste){
System.out.println(a.suit+""+a.rank);
}
Collections.shuffle((List<?>) deste);
System.out.println("KARIŞTIRMA SONRASI");
for(Card a:deste){
System.out.println(a.suit+""+a.rank);
}
}
}
Revise this Paste