第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

分享一下我的代碼

import?java.util.ArrayList;

import?java.util.Random;


public?class?Pokegame{

????ArrayList<Poke>?cards?=?new?ArrayList<Poke>();

????public?void?init(){

????????for(int?i?=?1;i<=13;i++){

????????????for(int?j?=1;j<=4;j++){

????????????????cards.add(new?Poke(i,j));

????????????}

????????}

????}

????public?void?flushCards(){

????????Random?random?=?new?Random();

????????for(int?i?=0;i<100;i++){

????????????Poke?a??=?cards.get(random.nextInt(52));

????????????cards.remove(a);

????????????cards.add(a);???

????????}

????}

????public?void?show(){

????????for?(Poke?poke?:?cards)?{

????????????System.out.println(poke);

????????}

????}

????public?static?void?main(String[]?args)?{

????????Pokegame?game?=new?Pokegame();

????????game.init();

????????game.flushCards();

????????game.show();

????}

}


正在回答

3 回答

Collections.shuffle(list);不是更簡潔一點(diǎn)嗎?

1 回復(fù) 有任何疑惑可以回復(fù)我~

不秀,利用set的無序性就可以很簡單的做到打亂了

1 回復(fù) 有任何疑惑可以回復(fù)我~

感覺我這個(gè)洗牌很秀

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Java入門第三季
  • 參與學(xué)習(xí)       409767    人
  • 解答問題       4534    個(gè)

Java中你必須懂得常用技能,不容錯(cuò)過的精彩,快來加入吧

進(jìn)入課程

分享一下我的代碼

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號