0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

じゃんけんゲーム

Posted at

ランダム関数の小数点以下を切り捨て、整数にする→Math.floor

var cphand = Math.random() * 3

これを

var cphand = Math.floor(Math.random() * 3)

とすることで「0,1,2」のみにする。

###フォームのvalueを受ける

var myhand = document.getElementById('myhand').value

https://itsakura.com/js-selectbox

条件分岐
myhandとcphandを9回比較する。

参考サイト>https://myx.skr.jp/game0.html
http://www.ics.kagoshima-u.ac.jp/edu/katuyoukiso/vc/step4.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?