$24
Write a constructor Ghost, that takes a color argument, and the x and y coordinates.
The constructed object should store the ghost color, and the x and y coordinates.
The x and y coordinates are on a 16x16 plane, with wrap around.
Define four methods, up/down/left/right, using the prototype mecha-nism for Ghost.
Also define a toString method, using the prototype mechanism for Ghost.
Test your ghosts.
For this exercise, you are allowed to use any resource you wish as long as you give the source. (for example, stack overflow)
Hand in you listing, and at least 3 tests.
You can use chalk and chrome, just chrome, or node, or any other JavaScript system.
Use
http://ku-fpg.github.io/workbook/EECS_368/ To generate the cover sheet.
1