;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname gobbler-client) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) ;; This is a starter file for Assignment 13b (2017). It includes data definitions for the ;; message that the Gobbler Server sends to clients and that clients are allowed to send ;; back to the Server. It also includes a couple of constants ;; =================================================================================================== ;; The Gobble Server communicates with its clients according to the following protocol: (define WAITING 'waiting) (define COUNTDOWN 'countdown) (define PLAYING 'playing) (define GAME-OVER 'game-over) ;; A Server2ClientMessage is one of: #; (list WAITING N ;; the number of players waiting and N) ;; the number of players needed to play #; (list COUNTDOWN [Listof TurkeyMessage] ;; the other turkeys that are about to play the game [Listof FoodMessage] ;; the locations of the initial foods N ;; the amount of time left before the game begins [Maybe TurkeyMessage]) ;; the receiving player's turkey, or false if observing #; (list PLAYING [Listof TurkeyMessage] ;; other turkeys currently playing [Listof FoodMessage] ;; the locations of the foods on the board N ;; the amount of time left before the game ends [Maybe TurkeyMessage]) ;; the receiving player's turkey, or #false if observing #; (list GAME-OVER [Listof String]) ;; a description of how the game ended (winners) #; String ;; an error message that reports your client's state and msg ;; A TurkeyMessage is a #; (list String ;; name of the turkey N ;; x coordinate N ;; y coordinate N) ;; number of food items eaten ;; A FoodMessage is a #; (list N ;; x coordinate N) ;; y coordinate ;; =================================================================================================== ;; A gobble client communicates with the Gobble Server according to the following protocol: (define WAYPOINT 'waypoint) ;; A Client2ServerMessage is a #; (list WAYPOINT N ;; the x coordinate N) ;; the y coordinate ;; =================================================================================================== ;; some common constants (define SIZE 600) ;; the game is played on a 600 x 600 grid at the following server & port: (define GOBBLER-SERVER "dictionary.ccs.neu.edu") (define GOBBLER-PORT 20000) ;; --------------------------------------------------------------------------------------------------- ;; Image String -> [Listof String] ;; connect to the server and set up the player for a game of 'gobble' ;; return the list of strings that the 'game over' message includes (define (main avatar-image my-name) '())