Closed. This question is off-topic. It is not currently accepting answers. Learn more
想改进这个问题吗?Update the question所以堆栈溢出的值小于aa>。
四年前关闭。
on-topic
http://postimg.org/image/3uy1elypj/
大家好,我想做一个石头剪子游戏,做所有的事情,在上面的图片放置。我只能在这里张贴两个链接,但如果你想更多的图片请让我知道。游戏应该从没有显示图像开始,直到选择了某个对象。我已经创建了一些代码,但对我来说效果不太好。如果你能帮我做这件事,我会非常感激的!下面是我的代码。
<body>
<div class="game">
        <div class= "choice">
            <input name="player" type="radio" id="rock"
                    value = "0"  checked="checked"/> <img src="rock.png" width="268" height="291" alt=""/>ROCK <br />


            <input name="player" type="radio" id="paper"
                value = "1" data-photo-url="http://www.clker.com/cliparts/Y/t/o/V/q/F/paper-md.png"/>
                                         PAPER <br />


            <input name="player"  type="radio" id="scissors"
                value = "2" data-photo-url="http://www.clker.com/cliparts/8/B/i/M/Y/Z/scissors-md.png" /> SCISSORS <br />
            <button id = "play">
                    PLAY
            </button>
        </div>

         <div class="players">
            <div>
                <H3>PLAYER</H3> <img class="player-pick" src="scissors-purple.png" width="268" height="291" alt=""/></div>
           <div>
               <H3>COMPUTER</H3><img class="computer-pick" src="http://www.clker.com/cliparts/Y/t/o/V/q/F/paper-md.png"></img>
           </div>
        </div>

        <div class = "answers">
            <li>YOUR WINS:<input type="text" id= "output" size="5" /></li>
            <li>MY WINS:<input type="text" id = "output" size="5" /></li>
            <li>DRAWS:<input type="text" id = "output" size="5" /></li>
            <button id = "newgame">
                    NEW GAME
            </button>
        </div>
       <h3 class="instructions">Make your pick and click PLAY</h3>

    </div>
    <script src = "projectt.js"> </script>
</body>

这是CSS
.game {
    width: 100%;
    min-width: 500px;
}
.game > div {
    float: left;
}
.choice {
    width: 25%;
}
.players {
    width: 50%;
}
.answers {
    width: 25%;
}

.players > div {
    width: 50%;
    float: left;
    min-height: 200px;
}
h3 {
    text-align: center;
}

.instructions {
    clear: both;
}

.players img {
    display: block;
    max-width: 100%;
}

我在javascript上遇到了最大的问题。这就是我所拥有的:
var choiceArray = ["paper", "rock", "scissors"];
var computerChoice = Math.floor(3*Math.random());
console.log(computerChoice);
if(computerChoice=0){
    computerChoice="rock";
}else if(computerChoice>1){
    computerChoice="paper";
}else{
    computerChoice="scissors";
}

console.log(computerChoice);

最佳答案

一开始,我建议你换衣服

if(computerChoice=0){


if(computerChoice==0){

09-20 00:10