Racket Web Programming with Continuation Passing Cont This
Total Page:16
File Type:pdf, Size:1020Kb
Racket Web Programming with Continuation Passing cont This assignment should be done with Team One. This assignment asks you to write a web program. You may be familiar with HTML web programming, or this may be your first exposure. This assignment introduces Racket’s web programming libraries and a way of programming the web that is intimately linked with one of the fundamental ideas of programming languages; namely continuation passing style (CPS). 1 “Hello, World!” Get your web programming setup sorted out early. You must demonstrate that you have by creating a “Hello, World!” Racket web application. The application should show a web page with the text “Hello, World!” and the current time and date from the server (your machine). There is no formal submission for this program. Instead, demonstrate it to the instructor on your laptop. 2 Program Requirements You will write a simple survey with a page per question, the details of which are specified below. Although this program is quite simple, it is representative of the core of much larger Web software. Your program must have the following features: 1. Responses: When users finish the survey, they should see a list containing all of the questions they were asked and their responses. This list should not include any questions which a particular user was not asked. 2. Browser Navigation: The back button should work properly. If a user answers a question, clicks the back button, then the question again, the later answer should take effect. 3. Cloning: Window cloning should work properly. Suppose a user fills out the survey to a certain point, then clones the survey in a new window or tab. It should be possible to fill out both surveys independently. Furthermore, clicking the back button in one window should not affect any others. 2.1 Survey Specification 1. What is the best controller for shooters? Answer is Arcade Stick, Gamepad, or Keyboard. If the answer is Arcade Stick, go to question 2; otherwise go to question 3. 2. What is the best gate? Answer is Circular, Octagonal, or Square. Go to question 3. 3. Do you prefer horizontal or vertical scrolling? Answer is Horizontal or Vertical. If the answer is Horizontal, go to question 4. If the answer is Vertical, go to question 5. 4. What is the best horizontal shooter? Answer is Gradius V, Sexy Parodius, Border Down, Deathsmiles, or a user-supplied answer. Go to the end. 5. Which is the better developer? Answer is Cave or Treasure. If the answer is Cave, go to question 6; otherwise go to question 7. 6. What is Cave’s best release? Answer is Dodonpachi, Ketsui kizuna jigoku tachi, Mushihimesama Futari 1.5, or a user-supplied answer. Go to the end. 7. What is Treasure’s best release? Answer is Radiant Silvergun, Sin and Punishment, Ikaruga, Sin and Punishment: Star Successor, or a user-supplied answer. Go to the end. 3. Grading For purposes of grading, the items in Program Requirements are considered three features. The Survey Specification is considered two features: navigation and presentation. 4. Helpful Hints Do this assignment using the Racket Web Server and using its automatic continuation tracking. Write your servlets in DrRacket. Use this template: #lang web-server/insta (define (start initial-request) ; initial page goes here ....) You can run your servlet by pressing Run. You will find it useful to read the following documentation: Quasiquoting: quasiquote and ‘ Instant Servlets Web Interaction Continue: Web Applications in Racket .