|
Due: Sep.21 (Fri) 15:00 (hardcopy and D2L)
Your submitted file should be named “hw03.rkt”.
We wish to write code about whether or not the Radford Highlanders won their soccer game, this last weekend. We want to capture: whether they won/lost, or tied, or there wasn't any game this weekend, or (if the game is still in-progress) what the name of the team currently being played is. (Oddly, we will not track the opposing team's name when the game isn't in progress1. Perhaps we don't care about such details once a game is over?)
Hint: To represent whether they won or lost, a boolean seems appropriate. What types seem appropriate for each of the other variants?
Hint: Of course, it is not “as appropriate” to return a string mentioning the Wytheville Wallabies when we're actually playing the Dublin Dingoes, or the Pulaski Pangolins! Recall from our data-definition in #1, agame-result should capable of representing, among other things, the name of a team (which therefore means that the game must be in-progress). (Moreover, this means your function does not need to be given any additional information, since thegame-result already represents the info you need.)
Standard instructions for all homeworks (unless instructed otherwise):
(And on further thought, we'll also note that while opposing-team-name could conceivably be information worth tracking for several cases, it wouldn't make sense for no-game-this-week. This complicates a correct data-representation; more on that in class.)
↩This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |