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

#1 2012-03-05 20:14:26

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Hard List Stuff

Guys, could you look at my project here? I want it to be so that when the left arrow button is pushed, the cursor moves left one.

If you download it, type some stuff into FootNote, and push the left arrow key a couple of times, you'll see the glitch. These lists seem very advanced to me, so that is why I'm putting this here. Anyway, please DOWNLOAD and look at it, and see if you can find the glitch. I'm really at a loss as to what to do.


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#2 2012-03-05 21:26:16

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Hard List Stuff

Looks like this probably belongs in "Help with Scripts," rather than Advanced Topics.  smile  I'll move it there for you!

Offline

 

#3 2012-03-05 23:21:01

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

Re: Hard List Stuff

hm...well, the thing I would do is make two variables that store the string in front of the cursor and the string behind it.  Then you use the script:

(join(pre-cursor) (join[|] (post-cursor)))
I think that'd work pretty well...it might be a tad hard to modify the strings though...still, I don't see an easier way.

Last edited by AtomicBawm3 (2012-03-05 23:26:35)


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

Offline

 

#4 2012-03-06 06:16:48

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Hard List Stuff

AtomicBawm3 wrote:

hm...well, the thing I would do is make two variables that store the string in front of the cursor and the string behind it.  Then you use the script:

(join(pre-cursor) (join[|] (post-cursor)))
I think that'd work pretty well...it might be a tad hard to modify the strings though...still, I don't see an easier way.

I did that, but my problem is getting post-cursor to read the second list correctly.


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#5 2012-03-07 17:45:35

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Hard List Stuff

bump


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#6 2012-03-08 19:24:59

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Hard List Stuff

Anyone?


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#7 2012-03-09 20:21:52

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Hard List Stuff

C'mon guys!


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#8 2012-03-09 20:36:15

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Hard List Stuff

Seems like you need to inject a string inside another string at a specific point.

set[inject] to (answer)
set [front] to ()
set [i] to (0)
repeat(cursor location)
change [i] by (1)
set [front] to (join(front)(letter (i) of (line of text)))
end
set [back] to ()
repeat((length of (line of text))-(cursor location))
change [i] by (1)
set [back] to (join(front)(letter (i) of (line of text)))
end
set [new line of text] to (join (join (front)(inject))(back))
That should do it.  There may be some glitches to work out.  If it doesn't work just ask.

Last edited by MoreGamesNow (2012-03-09 20:36:25)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#9 2012-03-09 22:16:37

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: Hard List Stuff

Im on my iPod so I can't look

Offline

 

Board footer