Chapter 16 // Exercise 5
Write a program that draws a shape of your choice and moves it to a new point each time you click "Next". The new point should be determined by a co-ordinate pair read from an input stream.
Github: https://github.com/l-paz91/principles-practice/tree/master/Chapter%2016/Exercise%205
Another straightforward one. I added a next button & action function to the window created in the previous exercise and had it draw a randomly sized/shaped/coloured star. If no co-ordinates are given, it chooses a random one. In In_box::get_int(), it always returns -999999 if no number is given so I plugged that in as no number given.
No comments:
Post a Comment