Well the game is to find a point using arrow keys, And the point should be in x & y axis they should be randomly selected by rand(), They could be positive or negative and have limit of -10 to 10.
If the points is lets spouse X,Y (10,-9), At start our point should be zero and when we press right arrow keys the compiler will increment the value to 1 and will print "You are getting closer to point" same to y-axis. Now when we reach at x=10 and we again press right arrow keys it should print"You are going away from the point". When both x and y points are found the compiler should print"Congratulation You Found The Point". And also there should be limit moves of 20 i.e(You can only press arrow key 20 times).
Your program should run in an event loop which terminates if the proper key is pressed (like Esc or Q).
Next, you only need to keep track of three things: the (x,y) of the random target, the (x,y) of the “current location”, and the distance between the two. Every time you press an arrow key, update the current location’s (x,y) and compare the new distance to the old. Print out one of the strings depending on how the distance has changed. Update the current distance. Loop.