When visiting e.g. http://localhost:3000/draw/cat we would always be starting at the first image.
If I would want to link to a different image I would need an indicator inside the link to determine the offset from the starting point.
Solution
We solve this by adding a query parameter named image which represents the offset from the starting point.
Example
http://localhost:3000/draw/cat?image=5 would show the fifth image in the cat category.
Conditions
image=1 should represent the first image
- Given: images in drawing sesion
n and the query parameter value x. Then the following invariant should hold x <= n
When visiting e.g.
http://localhost:3000/draw/catwe would always be starting at the first image.If I would want to link to a different image I would need an indicator inside the link to determine the offset from the starting point.
Solution
We solve this by adding a query parameter named
imagewhich represents the offset from the starting point.Example
http://localhost:3000/draw/cat?image=5would show the fifth image in the cat category.Conditions
image=1should represent the first imagenand the query parameter valuex. Then the following invariant should holdx <= n