从列表中选择一个随机数组并将其移动到另一个列表

时间:2017-03-28 02:20:18

标签: javascript arrays app-lab

我的班级评估我正在应用实验室做一个纸牌游戏,所以我将每张卡片制作成一个阵列列表,并将ace,jack,queen和king作为变量,并列在列表中, 我正在尝试将一个随机数组移动到另一个列表中,这个列表将成为我手中的卡片而且我一直在挖掘API,但它没有告诉我,我不能想到一种方法,如果没有它运行错误。我对编码仍然很陌生,如果不是那么好对不起 到目前为止这是我的代码

var A=1;
var J=11;
var Q=12;
var k=13;
var yourcards= [];
var AICards =[];
var chooseCard = randomNumber(0,51);

var cards = ["A", "2", "3","4","5","6","7","8","9","10","J","Q","K","A", "2", "3","4","5","6","7","8","9","10","J","Q","K","A", "2", "3","4","5","6","7","8","9","10","J","Q","K","A", "2", "3","4","5","6","7","8","9","10","J","Q","K"];

onEvent("War", "click", function(event) {
etScreen("gameGrounds");
});

 function CardDeal(){
    for (var i = 0; i < 25; i++) {
     chooseCard();




 }
}

0 个答案:

没有答案