@@ -15,7 +15,7 @@ public class GameScenarioBenchmarks
1515{
1616 private List < int > _initialValues6x4 = null ! ;
1717 private List < int > _initialValues8x5 = null ! ;
18-
18+
1919 [ GlobalSetup ]
2020 public void Setup ( )
2121 {
@@ -41,14 +41,14 @@ public List<int> SimulateMidGame6x4_Move3()
4141 // Simulate mid-game with some black matches
4242 var values = _initialValues6x4 . ToList ( ) ;
4343 var selection1 = BenchmarkTestData . CreateTestSelection ( GameType . Game6x4 ) ;
44-
44+
4545 // First move: no matches
4646 values = values . HandleNoMatches ( GameType . Game6x4 , selection1 ) ;
47-
47+
4848 // Second move: 1 black match
4949 var selection2 = 0b_001000_000100_000100_000100 ; // Different first position
5050 values = values . HandleBlackMatches ( GameType . Game6x4 , 1 , selection2 ) ;
51-
51+
5252 // Third move: 2 white matches
5353 var selection3 = 0b_000100_001000_000100_000100 ; // Rearranged colors
5454 return values . HandleWhiteMatches ( GameType . Game6x4 , 2 , selection3 ) ;
@@ -61,12 +61,12 @@ public List<int> SimulateLateGame6x4_Move5()
6161 // Simulate late game with high precision
6262 var values = _initialValues6x4 . ToList ( ) ;
6363 var baseSelection = BenchmarkTestData . CreateTestSelection ( GameType . Game6x4 ) ;
64-
64+
6565 // Apply multiple filtering operations
6666 values = values . HandleNoMatches ( GameType . Game6x4 , baseSelection ) ;
6767 values = values . HandleBlackMatches ( GameType . Game6x4 , 2 , 0b_001000_000100_000100_000100 ) ;
6868 values = values . HandleWhiteMatches ( GameType . Game6x4 , 3 , 0b_000100_001000_010000_000100 ) ;
69-
69+
7070 // Final precise move
7171 return values . HandleBlackMatches ( GameType . Game6x4 , 3 , 0b_001000_010000_000100_100000 ) ;
7272 }
@@ -86,13 +86,13 @@ public List<int> SimulateMidGame8x5_Move3()
8686 {
8787 // Simulate more complex 8x5 game progression
8888 var values = _initialValues8x5 . ToList ( ) ;
89-
89+
9090 // Move 1: Some white matches
9191 values = values . HandleWhiteMatches ( GameType . Game8x5 , 3 , 0b_000100_001000_010000_100000_000010 ) ;
92-
92+
9393 // Move 2: Black matches
9494 values = values . HandleBlackMatches ( GameType . Game8x5 , 2 , 0b_001000_000100_010000_000010_100000 ) ;
95-
95+
9696 // Move 3: More precise filtering
9797 return values . HandleBlackMatches ( GameType . Game8x5 , 4 , 0b_000100_001000_000010_010000_100000 ) ;
9898 }
@@ -107,14 +107,14 @@ public List<int> SimulateWorstCaseFiltering()
107107 {
108108 // Scenario where filtering operations don't reduce the list much
109109 var values = _initialValues6x4 . ToList ( ) ;
110-
110+
111111 // Multiple operations that don't filter much
112112 for ( int i = 0 ; i < 5 ; i ++ )
113113 {
114114 var selection = 0b_000001_000001_000001_000001 << i ; // Different selections
115115 values = values . HandleWhiteMatches ( GameType . Game6x4 , 1 , selection ) ;
116116 }
117-
117+
118118 return values ;
119119 }
120120
@@ -124,11 +124,11 @@ public List<int> SimulateBestCaseFiltering()
124124 {
125125 // Scenario where filtering operations reduce the list significantly
126126 var values = _initialValues6x4 . ToList ( ) ;
127-
127+
128128 // Operations that should filter aggressively
129129 values = values . HandleBlackMatches ( GameType . Game6x4 , 3 , BenchmarkTestData . CreateTestSelection ( GameType . Game6x4 ) ) ;
130130 values = values . HandleBlackMatches ( GameType . Game6x4 , 3 , 0b_001000_010000_100000_000010 ) ;
131-
131+
132132 return values ;
133133 }
134134
@@ -142,13 +142,13 @@ public int SimulateCompleteGame6x4()
142142 {
143143 var values = _initialValues6x4 . ToList ( ) ;
144144 int moveCount = 0 ;
145-
145+
146146 // Simulate a complete game until very few values remain
147147 while ( values . Count > 10 && moveCount < 8 )
148148 {
149149 moveCount ++ ;
150150 var selection = 0b_000100_000100_000100_000100 << ( moveCount % 6 ) ;
151-
151+
152152 switch ( moveCount % 4 )
153153 {
154154 case 0 :
@@ -168,7 +168,7 @@ public int SimulateCompleteGame6x4()
168168 break ;
169169 }
170170 }
171-
171+
172172 return values . Count ;
173173 }
174174
0 commit comments