Commit 826d8f0b authored by Zohten's avatar Zohten

checkchow

parent 96f8c8bb
...@@ -36,12 +36,13 @@ export default class Hand{ ...@@ -36,12 +36,13 @@ export default class Hand{
this.sort(); this.sort();
let chowArray = []; let chowArray = [];
const tile_ids = this.tiles_left.map(tile => tile.id_tuile); const tile_ids = this.tiles_left.map(tile => tile.id_tuile);
tile_ids.forEach( unique_tile => { let ids_set = new Set(tile_ids);
if (unique_tile<7 || (8<unique_tile && unique_tile<16) || (17<unique_tile && unique_tile<25)) { //bamboo <8 || char <8 || dot <8 ids_set.forEach(unique_tile_id => {
if ((tile_ids.indexOf(unique_tile+1) && tile_ids.indexOf(unique_tile+2)) != -1) { let modulo = unique_tile_id%9;
chowArray.push(unique_tile) 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; 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