This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#226 2010-03-08 21:26:17

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Artificial Intelligence Contest

I just started, I have about 1 script.

Offline

 

#227 2010-03-09 14:24:41

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547 wrote:

nXIII wrote:

RHY3756547 wrote:

Woot - I made a pixel perfect position calculator (with the power of simultaneous equations and the Pythagoras Theorem)!

Now to make the robot...

How is that possible? You need at least SAS or SSS to do that, and none of them or the others are possible without the banned block. Pythagorean Theorem only works with TWO legs, but you only have one...

Distance to blocks from two sensors at the bottom corners of the screen are all that is needed.

I worked out how to calculate the X and Y position with the rules of simultaneous equations.

But..........................................those quadratics scare me. I don't like 240+-√(-4y^2-1440y-129600)/2 . It's imaginary, so I must be doing something wrong...

Last edited by nXIII (2010-03-09 14:24:55)


nXIII

Offline

 

#228 2010-03-09 14:26:29

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Artificial Intelligence Contest

That's close to what I got.  wink

Offline

 

#229 2010-03-09 14:46:57

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547 wrote:

That's close to what I got.  wink

WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2

d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....

QUICK! Before Lucario sees this!

Last edited by nXIII (2010-03-09 14:48:56)


nXIII

Offline

 

#230 2010-03-09 15:04:53

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Artificial Intelligence Contest

If I understand right, you keep ending up with x being not a number. Try an absolute value block before square roots?

I'm only in algebra, so I coulda gotten this wrong.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#231 2010-03-09 15:11:06

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

juststickman wrote:

If I understand right, you keep ending up with x being not a number. Try an absolute value block before square roots?

I'm only in algebra, so I coulda gotten this wrong.

no... that wouldn't return the right number

By the way, it is a number, just not a real one. That's where i comes into play.

RHY3756547 - Please tell me  sad . I know I'm close, I just don't know what's wrong with it. If I saw what you did, I could fix mine.

Last edited by nXIII (2010-03-09 15:13:18)


nXIII

Offline

 

#232 2010-03-09 15:13:17

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Artificial Intelligence Contest

nXIII wrote:

RHY3756547 wrote:

That's close to what I got.  wink

WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2

d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....

QUICK! Before Lucario sees this!

I don't understand the way you are writing the equarion with the 〖s etc...

The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.

Offline

 

#233 2010-03-09 15:14:24

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547 wrote:

nXIII wrote:

RHY3756547 wrote:

That's close to what I got.  wink

WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2

d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....

QUICK! Before Lucario sees this!

I don't understand the way you are writing the equarion with the 〖s etc...

The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.

Oh... OK. THANKS!
By the way... I apologize for the equation, it looks a lot nicer in MS Word (where I made it)


nXIII

Offline

 

#234 2010-03-09 18:32:39

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

Demosthenes-
I am really sorry, but I have a school trip to Washington DC for three days, so I basically have zero time to work on this. Will you extend the deadline a bit?


nXIII

Offline

 

#235 2010-03-09 18:36:23

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Artificial Intelligence Contest

can i use pretty much any of the banned blocks on my team? i have written a really well working script, but it requires the use of some of them on my team members.

Offline

 

#236 2010-03-09 18:44:17

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

urhungry wrote:

can i use pretty much any of the banned blocks on my team? i have written a really well working script, but it requires the use of some of them on my team members.

Yes, you can. You just can't use them for enemy robots/projectiles.


nXIII

Offline

 

#237 2010-03-09 18:46:23

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547-
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

Are these the right equations? (d_1 being the first distance and d_2 being the second)


nXIII

Offline

 

#238 2010-03-09 18:48:07

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Artificial Intelligence Contest

nXIII wrote:

RHY3756547-
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

Are these the right equations? (d_1 being the first distance and d_2 being the second)

I have no idea. It isn't near what I got...

Test it out in scratch and see if it reports the right values.

Offline

 

#239 2010-03-09 19:34:51

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547 wrote:

nXIII wrote:

RHY3756547-
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )

Are these the right equations? (d_1 being the first distance and d_2 being the second)

I have no idea. It isn't near what I got...

Test it out in scratch and see if it reports the right values.

Sorry, never mind. i meant base equations, and they were. I got--
[Message removed due to possible information leaks to other users]

Last edited by nXIII (2010-03-09 19:36:37)


nXIII

Offline

 

#240 2010-03-09 19:35:57

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

RHY3756547 wrote:

The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.

Which is quite amazing, because I found x and then used pythag on y.

Last edited by nXIII (2010-03-09 19:36:27)


nXIII

Offline

 

#241 2010-03-09 19:43:28

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

Demosthenes wrote:

Exception: you may use ([x/y position] of [EnemyProjectile]) only.

But WHY?!

Last edited by nXIII (2010-03-09 19:43:42)


nXIII

Offline

 

#242 2010-03-09 19:44:54

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Artificial Intelligence Contest

nXIII wrote:

Demosthenes wrote:

Exception: you may use ([x/y position] of [EnemyProjectile]) only.

But WHY?!

atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#243 2010-03-09 19:47:10

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Artificial Intelligence Contest

Kileymeister wrote:

nXIII wrote:

Demosthenes wrote:

Exception: you may use ([x/y position] of [EnemyProjectile]) only.

But WHY?!

atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.

Still - that ruins the fun it finding a way to use algorithms to find the position of the enemy!!!  yikes  lol.

Meh, either way, it can be inaccurate, considering that you can have guided missles.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#244 2010-03-09 20:02:38

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

Lucario621 wrote:

Kileymeister wrote:

nXIII wrote:


But WHY?!

atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.

Still - that ruins the fun it finding a way to use algorithms to find the position of the enemy!!!  yikes  lol.

Meh, either way, it can be inaccurate, considering that you can have guided missles.

My PERFECT PIXEL DETECTOR and TRIG USAGE tell me the positions of both the enemy and the projectile AND the direction of the projectile.


nXIII

Offline

 

#245 2010-03-09 20:03:52

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Artificial Intelligence Contest

I must clarify...
Projectiles must be HIDDEN when they expire, correct? (not 100%-ghosted, because that still triggers hits)


nXIII

Offline

 

#246 2010-03-09 20:15:49

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Artificial Intelligence Contest

nXIII wrote:

I must clarify...
Projectiles must be HIDDEN when they expire, correct? (not 100%-ghosted, because that still triggers hits)

Yeah.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#247 2010-03-09 20:21:44

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Artificial Intelligence Contest

You can;t even detect your own xy?


Hai.

Offline

 

#248 2010-03-09 20:42:04

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Artificial Intelligence Contest

nope, at least, i dont think so.

Offline

 

#249 2010-03-09 20:44:00

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Artificial Intelligence Contest

fg123 wrote:

You can;t even detect your own xy?

...yes you can. You can detect your x y for any of the sprites that are on your team, and not part of the enemies...


http://i.imgur.com/WBkM2QQ.png

Offline

 

#250 2010-03-09 23:16:14

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: Artificial Intelligence Contest

I know I probably shouldn't be uploading this,but if anyone is having trouble coming up with ideas,here's my engine(and current robot so far) at http://scratch.mit.edu/projects/Brass45/923666. Please tell me if you find any bugs or have any suggestions.Also,this means that i'm officially in the competition(i'll probably get killed in 10 seconds...oh well).

Last edited by Brass45 (2010-03-09 23:24:39)


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

Board footer