1
Lecture 6 Final Project
Tirsvad edited this page 2026-11-06 06:08:41 +01:00

English · Dansk · Bahasa Melayu

Lecture 6: Final project

3 is too low 7 is too high 5 is correct

Code: server.py and src/higher_lower/.

What we gained

  • Everything of the day in one program: routes, a variable URL section, HTML, styles and GIFs.
  • The secret number is chosen once when the app starts; /<int:guess> compares the guess with it.
  • Each answer has its own heading colour and GIF. The headings, colours and GIF addresses live in constants.py.
  • The rule that compares two numbers is a plain function in the domain layer, so tests do not need Flask.
  • Tests use the Flask test client with a fixed secret number and need no network.