MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / increment_score

Function increment_score

matrix/matrix_based_game.py:164–173  ·  view source on GitHub ↗

Calculates the score for a move based on the number of elements removed. >>> increment_score(3) 6 >>> increment_score(0) 0

(count: int)

Source from the content-addressed store, hash-verified

162
163
164def increment_score(count: int) -> int:
165 """
166 Calculates the score for a move based on the number of elements removed.
167
168 >>> increment_score(3)
169 6
170 >>> increment_score(0)
171 0
172 """
173 return int(count * (count + 1) / 2)
174
175
176def move_x(matrix_g: list[list[str]], column: int, size: int) -> list[list[str]]:

Callers 1

playFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected