home—lects—hws
D2L—breeze (snow day)
php-arrays-practice
array practice
Design exercise:
We want to set up a web-form, where people enter information about
PokemonOkaymon.
discussion answers:
If solutions are not already being displayed,
see php-arrays-practice-soln.html for a sketch of where the discussion might lead.
-
For the monster's element (
fire, grass, watercandle, clover, puddle),
what input-type should we use?
-
The list of elements might change over time (adding new elements).
Should the drop-down be hand-coded?
-
Each monster has some elements that they are weak to.
How should we collect that?
-
And each monster also has some elements they are resistant to.
So that'd be another bank of checkboxes.
But wait: you can't be both resistant and weak to the same element.
So what should the form do, as we mark various weaknesses/resistances?
-
Is there a better way?
-
Will this scheme generalize to other purposes?
-
So we'll make this a php function, which takes in information and
produces a (big long) string of html, for this 'radio-table'.
A table-layout seems reasonable.
What should the signature be?
-
(We sketch out what we want the table to look like.)
-
We can make a unit-test:
-
We'll need this radiotable for the homework.
Can we write a bunch of the code right now?
home—lects—hws
D2L—breeze (snow day)