Judge | Example |
---|---|
炸弹 | [ K K K K ] + ( A ) |
五花牛 | [ 10 J Q K K ] |
五小牛 | [ A A 2 2 4 ] |
牛牛 | [ 2 3 5 ] + ( 4 6 ) |
牛九 | [ K Q J ] + ( 4 5 ) |
牛八 | [ 10 A 9 ] + ( 2 6 ) |
牛七 | [ A 4 5 ] + ( 3 4 ) |
牛六 | [ 3 8 9 ] + ( 3 3 ) |
牛五 | [ 10 J Q ] + ( 9 6 ) |
牛四 | [ 4 3 3 ] + ( 2 A ) |
牛三 | [ 9 9 2 ] + ( 5 8 ) |
牛二 | [ 7 4 9 ] + ( A A ) |
牛丁 | [ 8 8 4 ] + ( A Q ) |
没牛 | ( 3 5 7 A 9 ) |
输入仅识别数字和 a / j / q / k / A / J / Q / K,其余字符不作处理
1 看做 A, 0 看做 10
超过5个参数以前5个做计算
参数不足需重新输入5个参数
程序开始:
Welcome to the game:
what pokers ?
("0" for 10, joker not allowed)
输入5张牌,输出结果:
2 3 4 5 6
========= BULL =========
10 : [ 2 3 5 ] + ( 4 6 )
...
12345
========= BULL =========
5 : [ A 4 5 ] + ( 2 3 )
...
Jqa13
--------- LOSE ---------
C_POP/Poker_C.exe (gcc 4.9.2, Windows 10 x64)
GET http(s)://your.domain.site/Poker.php?{参数}
返回 JSON
errCode | errText | judgeText |
---|---|---|
400 | "unknown error" | NULL |
401 | "empty pokers" | NULL |
402 | "not enough pokers" | NULL |
0 | NULL | judgeText_JSON |
type | value | toSum | toLeft |
---|---|---|---|
"BOMB" | which four-of-a-kind | NULL | NULL |
"FIVE BULLS" | NULL | NULL | NULL |
"FIVE SMALL BULLS" | NULL | NULL | NULL |
"BULLS" | value of bull | 3 of pokers to sum | 2 of pokers then left |
PHP_POP/Poker.htm (CentOS 7.2 x64, Nginx 1.10.0, PHP 5.5.36)
HTML head 需引用 Poker.js :
<script type="text/javascript" src="Poker.js"></script>
HTML body 需设置以下两个标签和参数:
<input type="text" id="in">
<button onclick="run()">OK</button>
<p id="result"></p>
结果将会展示在:
<p id="result"></p>
JavaScript_POP/Poker.htm (Chrome 57.0.2987.98 (64-bit), Windows 10 x64)
Poker pokers = new Poker();
pokers.gameStart();
Java_OOP/Demo.java (JDK 1.8.0_121)
终端运行:
python3 Poker.py
Python_POP/Poker.py (Python 3.6, Windows 10 x64)
php 中include Poker.php :
include 'Poker.php';
创建对象:
$joker = new Poker();
传入参数并计算:
$joker->gameStart($_SERVER['QUERY_STRING']);
$joker -> gameStart('12345');
返回 JSON
echo $joker->toJSON();
PHP_OOP/Demo.php (CentOS 7.2 x64, Nginx 1.10.0, PHP 5.5.36)