Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Java by eksi ( 4 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

Your Name: Code Language: