Read the high score from the file #24

Closed
opened 2026-10-13 08:13:32 +02:00 by Tirsvad · 0 comments
Owner

Add a function that opens the file with with open(path) as data, reads it, converts the text with int and returns it; Scoreboard.__init__ takes the path as a parameter with the constant as default and sets high_score from it. Tests with a temporary file.

Phase: MIL-004

Add a function that opens the file with `with open(path) as data`, reads it, converts the text with `int` and returns it; `Scoreboard.__init__` takes the path as a parameter with the constant as default and sets `high_score` from it. Tests with a temporary file. Phase: MIL-004
Tirsvad added this to the MIL-004: High score file milestone 2026-10-13 08:13:32 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/024-snake#24