lavaniaj – HW2

I started with creating the magnet struct. The sudo code was easy to follow. After this I focused on getting two rectangles to display and making them different colors. The biggest hurdle with the assignment was figuring out how to color 2 separate rectangles. Once I figured that out all the other things fell into place. The last part I had a bit of trouble with was getting the second magnet to interact correctly when clicked but a simple conditional solved this.


lavaniaj - Attracting

lavaniaj  - repel

lavaniaj - together


Leave a Reply

Your email address will not be published. Required fields are marked *