2014

None of the submissions for the March 2014 code challenge were fully correct.
The April 2014 code challenge is the same as the code challenge for March 2014. However more sample
cases are given below, and the award prize has increased.
Task: Write a program or script that takes as input four coordinates
from the xy plane, and determines if those four points lie on the perimeter of a triangle, are the four corners of
a square, or if the four points are random points (they neither lie on the perimeter of a triangle nor are they the four corners of a square).
For example, the following inputs generate the following outputs (the coordinate plots are shown
for illustration purposes only, and your program does NOT need to generate these)
Input 
Output 
Coordinate 
(0,1) (0,1) (0,4) (1,3) 
On the perimeter of a triangle 


(1,1) (3,1) (1,3) (3,3) 
Corners of square 


(0,0) (4,0) (0,1) (2,1) 
On the perimeter of a triangle 


(0,0) (0,2) (0,1) (0,3) 
On the perimeter of a triangle 


(2,0) (0,2) (0,2) (2,0) 
Corners of a square 

Your program should be able to receive as input the coordinates of the four points in any order. The program can
receive as input the coordinate of the four points either via from the command line, or from a file. Code using
any "standard" programming language will be accepted.
Prize: $30 $20 gift certificate to the CWU bookstore
