# how to write corectly this code?

## Recommended Posts

```;IF x<0 and y<0 send("{NumPad3}"); move Down-Right
;IF x>0 and y<0 send("{NumPad6}"); move Right
;IF x>0 and y<0 send("{NumPad9}"); move Up-Right
;IF x<0 and y>0 send("{NumPad1}"); move Down-Left
;IF x>0 and y>0 Send("{NumPad3}"); move Left
;IF x>0 and y>0 Send("{NumPad7}"); move Up-Left```

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

##### Share on other sites

closest can have different meaning:

1)the shortest hypotetical straight line that connect point A (a yellow pixel ) to point B ( the pig )

2)the shortest walkable path from Point A to point B

##### Share on other sites

search every yellow pixel and store the position (X, Y coordinates) in one array, then find Pig's coordinates, then calc for each pixel the shortest distance (between pixel and pig) with this formula: Sqrt((X1-X2)² + (Y1-Y2)²), and choose the clostest one, and so on.

##### Share on other sites

• Developers

Jos

Edited by Jos

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

• Developers

this is not, old topic is finished, it was a question of how to make a script and I respond to it very well now I have another question entirely and use only 5 points from the figure in order to show movement in action

Seems we differ in our opinions here. I let it go for now, but you haven't had a great start on these forums and don't see much improvement yet.

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

ThanksALL

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...