Fix pawlonia set teyaku
This commit is contained in:
		
							parent
							
								
									6114c2d5d4
								
							
						
					
					
						commit
						e0e4013b1f
					
				
							
								
								
									
										9
									
								
								teyaku.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								teyaku.c
									
									
									
									
									
								
							| @ -6,9 +6,11 @@ | ||||
| SetTeyaku calculate_set_teyaku(const Hand h) { | ||||
|   int month_counts[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | ||||
|   int month_stands[12] = { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1 }; | ||||
|   int pawlonia_chaff = 0; | ||||
|   for (int i = 0; i < h.count; i++) { | ||||
|     Card c = *h.cards[i]; | ||||
|     month_counts[c.month]++; | ||||
|     if (c.index >= 45) pawlonia_chaff++; | ||||
|   } | ||||
| 
 | ||||
|   int triplets = 0, standing_triplets = 0, pairs = 0, four_of_a_kind = 0; | ||||
| @ -16,8 +18,11 @@ SetTeyaku calculate_set_teyaku(const Hand h) { | ||||
|     if (month_counts[i] == 4) { | ||||
|       four_of_a_kind++; | ||||
|     } else if (month_counts[i] == 3) { | ||||
|       if (month_stands[i]) standing_triplets++; // TODO Pawlonia is weird
 | ||||
|       else triplets++; | ||||
|       if (month_stands[i] && (i != 12 || pawlonia_chaff == 3)) { | ||||
| 	standing_triplets++; | ||||
|       } else { | ||||
| 	triplets++; | ||||
|       } | ||||
|     } else if (month_counts[i] == 2) { | ||||
|       pairs++; | ||||
|     } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user