Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
11-liner: unrolling solution in Clear category for Rolling 🎲! by przemyslaw.daniel
def rolling_dice(moves: str) -> int:
top, front, right = 1, 2, 3
for move in moves:
top, front, right = {
"N": (front, -top, right),
"S": (-front, top, right),
"W": (right, front, -top),
"E": (-right, front, top),
}[move]
return top % 7
April 28, 2023
Comments: