ポーカーの役判定
お題にしようと思っていたのに間違えてしまいました。今から変更可能でしょうか?
(説明) 当初間違ってトピックに投稿していたので、このようなコメントを付けていたのですが、 このコメントに気づいた管理人さんにお題に移していただきました。 (最初の2つだけ投稿日時が早いのはそのためです)
Posted feedbacks - diff
すみません、1箇所ミスってました。
1 2 3 4 5 6 7 8 9 | @@ -8,7 +8,7 @@
case _ => false
}
val flush_? = cs.forall(cs(0)._1 == _._1)
- val st_? = (1 to 9).map(i=>cs(0)._2==i && cs(4)._2==i+4).exists(true==) || royalSt_?
+ val st_? = (1 to 9).map(i=>(0 to 4).forall(j=>cs(j)._2==i+j)).exists(true==) || royalSt_?
val p = (((List(List[(char,int)]())) /: List.make(2, cs)){
for(i <-_; j <-_) yield j::i
}.filter(c=>c(0)._2 == c(1)._2).size - 5)/2
|
すいません、修正前のをコピペしてました。実行例も不要なxが混じってました。正確には、 (format t "~A => ~A~%" (hand "SQSJSASKST")) です。
1 2 3 4 | 40c40
< (destructuring-bind (ignore flashp kinds 3-2p) hand
---
> (destructuring-bind (ignore flashp straightp kinds 3-2p) hand
|






xsd
#4978()
Rating6/10=0.60
引数に手札を与えると、ポーカーの役を表示するプログラムを作ってください。
条件:
実行例:
see: ポーカー - Wikipedia
1 reply [ reply ]