Weekend Programming Challenge – Week #26 – Square



Write code which check if four points make square.

input data for squares:
(0,0),(0,1),(1,1),(1,0)   - normal square
(0,0),(2,1),(3,-1),(1,-2) - not aligned square
(0,0),(1,1),(0,1),(1,0)   - different order of the points
input date for non-squares:
(0,0),(0,2),(3,2),(3,0) - rectangle
(0,0),(3,4),(8,4),(5,0) - rhombus
(0,0),(0,0),(1,1),(0,0) - three points are same
(0,0),(0,0),(1,0),(0,1) - two points are same

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 29th.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

1 Comment (+add yours?)

  1. ping-panther
    Sep 28, 2013 @ 12:11:48

    The solution is 42!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: