Design: Move Validation System
Design the core move validation logic and system architecture. Exclude UI design and player matchmaking.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
Client | v API Gateway | v Move Validation Service <--> Game State Cache <--> Persistent Storage | v Logging Service Undo Service <--> Move Validation Service Rule Engine (plug-in modules) <--> Move Validation Service
move.position = 5 and max_position = 4?
def validate_move(move, max_position):
if move.position < 0 or move.position > max_position:
return False
return True
print(validate_move(move, max_position))def validate_move(move, max_position):
if move.position <= 0 or move.position >= max_position:
return False
return True