Created
December 9, 2012 22:49
-
-
Save bazub/4247344 to your computer and use it in GitHub Desktop.
Pseudo-code for searching for end-point of ship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get Start_point(x,y) | |
if x-3 >=1 | |
mark endpoint (x-3,y) //north | |
if x+3 <=10 | |
mark endpoint (x+3,y) //south | |
if y-3 >=1 | |
mark endpoint (x,y-3) //west | |
if y+3 <=10 | |
mark endpoint (x,y+3) //east | |
update map | |
get End_point(x,y) | |
fill line (Start_point(x,y),End_point(x,y)) | |
delete other_endpoints | |
update map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment