Commit 826d8f0b authored by Zohten's avatar Zohten

checkchow

parent 96f8c8bb
......@@ -36,12 +36,13 @@ export default class Hand{
this.sort();
let chowArray = [];
const tile_ids = this.tiles_left.map(tile => tile.id_tuile);
tile_ids.forEach( unique_tile => {
if (unique_tile<7 || (8<unique_tile && unique_tile<16) || (17<unique_tile && unique_tile<25)) { //bamboo <8 || char <8 || dot <8
if ((tile_ids.indexOf(unique_tile+1) && tile_ids.indexOf(unique_tile+2)) != -1) {
chowArray.push(unique_tile)
let ids_set = new Set(tile_ids);
ids_set.forEach(unique_tile_id => {
let modulo = unique_tile_id%9;
if(unique_tile_id<25 && modulo<7){
if (tile_ids.includes(unique_tile_id+1) && tile_ids.includes(unique_tile_id+2)) {
chowArray.push(unique_tile_id);
}
}
});
return chowArray;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment