A code sample of JavaScript from Lairu Wu
COMP2401a3
Author: Lairu Wu Student Number: 100999645 Operating System: Windows Purpose: A card filp game Source Files: a3Server.js and files in /public_html
(make sure you have a node environment) How to use the program:
-
Use cmd to get into the directory of COMP2406a3
-
Enter "node a3Server.js" to activate the server
-
The server is hosted on port 2406, so you can get to the homepage via the following request: http://localhost:2406/ (If an invalid url is entered, it will show a 404 not found page)
-
The page will prompt you to enter the name of player, or enter nothing to get a assigned default name
-
There will be a gameboard that consists of 16 face down cards, you have to match cards in pairs according to numbers on them,
-
You have to match all correct pairs to win, when the game is cleared, the page will show how many times you have attempted
-
The difficulty: side lengths of the board will keep increasing after you clear the game until you refresh the page and use another player name