Skip to content

Instantly share code, notes, and snippets.

@TanisukeGoro
Created November 29, 2019 16:41
Show Gist options
  • Save TanisukeGoro/e6b871087b07ec82fc13e5eb8749ecf4 to your computer and use it in GitHub Desktop.
Save TanisukeGoro/e6b871087b07ec82fc13e5eb8749ecf4 to your computer and use it in GitHub Desktop.
// こういうのが
if(r2==1){
view4 = list1[0];
}
if(r2==2){
view4 = list1[1];
}
if(r2==3){
view4 = list1[2];
}
// こんな感じに書ける
view4 = list[judge(相手の手, 自分の手)]
// 判定して1~3の値を返す関数
function judge(hand1, hand2){
// 判定の式を書く
// return で1~3の値が返るようにする
return hantei_kekka
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment