Help for assignment 4:
I have received some questions about question 2 in the assignment, so I will post some clarifications from the instructor here:
From the instructor:
The "model the peers" part for 4pt is about describing how they modelled the
network, and why. This can be done on the graph, or in a few sentences. The
second part for 2pt is for only drawing the graph itself.
In this question we are talking about a P2P network where peers talk DIRECTLY
to one another.
Hope it helps..
Update: I will not be here at 1 pm but I will be back at 2 so the office hour is delayed for 1 hr.
Help for assignment 3:
1. Truncating an floating point:
Try: var truncated_value = Math.round(my_initial_floating_point_val)
reference: http://www.javascriptkit.com/javatutors/round.shtml for help.
2. loop to infinitity?
Take a look at how to use break in loop.
Cheap shot: try, while(confirm("you wanna keep playing?"))
Update: skeleton code of question 2 is available! Check the TA page!
3. Hard Way to code Tic-tat-toe.
I tried to put up a sample code in the blog but it interprets the code as valid HTML and tries to parses it. So i could not display the code probably on the blog. Let me put it this way: if you use HTML table it will requires a lot more knowledge than what you have learned in class. Better to keep things simple by not touching the HTML layout at all.
Of course, if anyone is really interested in doing that, then reply here and I will try to create the sample code.
4. Multidimensional Array
Unlike Ruby or Python, there is no built-in support for array / list type in JS. Everything is treated like an object.
Therefore, to declare a 3x3 2-dimensional array you need to do this:
a = new Array[3];
a[0] = new Array[3];
a[1] = new Array[3];
a[2] = new Array[3];
Well you get the idea. Not the most elegant way to construct it and I will avoid it as much as possible.
Again, please post your questions HERE instead. I don't check my email too often so please use this wiki. It also benefits others who may have the same questions in mind.
Update: I have made the following list to Greg as the submission format requirement. But I have not received any news so I will post the following as the preferred guildline for this submission.
1. Each assignment should be submitted electronically through a ZIP file.
(Very important!!!) The name of the zip file should be: c102-a3-lastname-firstname.zip . Files not adhered to this format is not accepted.
2. The zip file MUST contain 3 html files with the following names:
bi-converter.html
tic-tat-toe.html
mandelbrot.html
I will run a script that tests for these three files. File names other than the ones I specified will not get tested.
3. Each file MUST COMPILE: a blank screen means automatically a zero for the specified question.
4. Each script MUST contain a comment that specifies the name of the author, and if they used the skeleton code provided. Submissions that use the skeleton code but did not specify the source is considered plagiarism.
5. All files MUST BE SUBMITTED to this email address: iyuen@cs.mcgill.ca or isaac.yuen@mail.mcgill.ca . Submissions to any other places will not be accepted.
6. Submission deadline March 27th 11:59 pm.