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

#1 2011-09-15 19:29:58

mrshanko
Scratcher
Registered: 2010-04-04
Posts: 25

Can someone tell me the error in this script?

I'm making a puzzle/strategy game with 100 squares in a 10x10 array. when you click on a square, that square and the 8 surrounding it change color. The goal is to get all the squares black. I'm having trouble with my "mix up" button. I put in this script and it's not doing what I thought it would do:

http://yourimg.in/m/j594hf4.gif

(I don't know how do display the actual image so I used YourIMG)

The script is supposed to select one square and change it's color and the surrounding squares' colors. I' not sure what I did wrong.


Forgetting to do something is not the same as remembering not to do it.

Offline

 

#2 2011-09-15 19:32:46

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Can someone tell me the error in this script?

mrshanko wrote:

I'm making a puzzle/strategy game with 100 squares in a 10x10 array. when you click on a square, that square and the 8 surrounding it change color. The goal is to get all the squares black. I'm having trouble with my "mix up" button. I put in this script and it's not doing what I thought it would do:

http://yourimg.in/m/j594hf4.gif

(I don't know how do display the actual image so I used YourIMG)

The script is supposed to select one square and change it's color and the surrounding squares' colors. I' not sure what I did wrong.

To make it an image surround it in [img] and [/img] tags.

Offline

 

#3 2011-09-15 19:33:27

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Can someone tell me the error in this script?

http://yourimg.in/m/j594hf4.gif

There you go.  Depends what you're wanting it to broadcast: a number or a string.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#4 2011-09-15 19:34:36

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Can someone tell me the error in this script?

AtomicBawm3 wrote:

http://yourimg.in/m/j594hf4.gif
There you go.  Depends what you're wanting it to broadcast: a number or a string.

Exactly what I was about to say...

Could you upload the project and post a link?

Last edited by Greenatic (2011-09-15 19:34:52)

Offline

 

#5 2011-09-15 19:37:27

mrshanko
Scratcher
Registered: 2010-04-04
Posts: 25

Re: Can someone tell me the error in this script?

Greenatic wrote:

AtomicBawm3 wrote:

http://yourimg.in/m/j594hf4.gif
There you go.  Depends what you're wanting it to broadcast: a number or a string.

Exactly what I was about to say...

Could you upload the project and post a link?

I'll do that later.


Forgetting to do something is not the same as remembering not to do it.

Offline

 

#6 2011-09-17 14:43:47

mrshanko
Scratcher
Registered: 2010-04-04
Posts: 25

Re: Can someone tell me the error in this script?

Alright, I uploaded the unfinished projected.


Forgetting to do something is not the same as remembering not to do it.

Offline

 

#7 2011-09-17 14:51:40

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Can someone tell me the error in this script?

Hmm, that seems overly complicated.

I'll take a look at the project, and see if there's an easier way.

Edit: The mix up button seems to be working, it just takes a really long time to finish. There's a much easier way; I'll make a script for you.

Last edited by hmnwilson (2011-09-17 15:06:06)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#8 2011-09-17 14:58:29

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Can someone tell me the error in this script?

It seems to be working offline.  Is the problem that it seems to be never-ending?  If so, try taking out the repeat 500 loop.   wink

Offline

 

#9 2011-09-17 15:18:19

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Can someone tell me the error in this script?

Here you go, now it should work.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#10 2011-09-17 15:56:15

mrshanko
Scratcher
Registered: 2010-04-04
Posts: 25

Re: Can someone tell me the error in this script?

hmnwilson wrote:

Here you go, now it should work.

I tried that before:

<when I receive[ Mixup! ]
<repeat( 100 )
<broadcast[ <join( <pick random( 1 )to( 10 ) ( <join( - ) ( <pick random( 1 )to( 10 )
___________________________________________________________________________________
This is exactly the same thing. When you broadcast the name of a square, it changes color. I want a script where one square changes color and so do the 8 around it repeatedly. If each square changes independently, he state of the puzzle could become unsolvable.


Forgetting to do something is not the same as remembering not to do it.

Offline

 

#11 2011-09-17 16:05:52

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Can someone tell me the error in this script?

mrshanko wrote:

hmnwilson wrote:

Here you go, now it should work.

I tried that before:

<when I receive[ Mixup! ]
<repeat( 100 )
<broadcast[ <join( <pick random( 1 )to( 10 ) ( <join( - ) ( <pick random( 1 )to( 10 )
___________________________________________________________________________________
This is exactly the same thing. When you broadcast the name of a square, it changes color. I want a script where one square changes color and so do the 8 around it repeatedly. If each square changes independently, he state of the puzzle could become unsolvable.[/blocks]

Whoops, I completely missed that...

Let me try that again. It might take a few minutes.

Edit: OK, I've spent a bit of time with this. Your way works, but as you've probably noticed, it's completely broken online. You can use it, you just need to tell the viewer they have to download it.

However, I've updated my version of the project (here) with a whole new script, and it works online. Don't feel obligated to use it, but if you want to, that's totally fine.

Last edited by hmnwilson (2011-09-17 16:50:39)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

Board footer