For my course at school I need to make:
- An algorithm that will swap over two items in the array, the user supplies the two positions
- An algorithm that in a separate array will store the lengths of the items (e.g. how many characters in each array item string). The positions must match up, e.g.
Blab (4)
Blaba (5)
Bler (3)
- An algorithm that in a new array stores the same items but without any vowels in them
Can someone please help me with the scripting of these three algorithms?
Thanks in advance.
Offline
Please respond. I am anxious to get this task completed.
- Jed Morris
Offline
DeckSTAHP wrote:
Connor Pedersen, cease with the immaturity please.
- The actual Jed Morris.
Uhh, Mr Morris, that is very inappropriate. Keep on topic, gentlemen.
Offline
MasterAnonymous wrote:
DeckSTAHP wrote:
Connor Pedersen, cease with the immaturity please.
- The actual Jed Morris.Uhh, Mr Morris, that is very inappropriate. Keep on topic, gentlemen.
Mr. Morris, you nerd.
Pedersen, shut your mouth!
Offline
bojo4evah wrote:
MasterAnonymous wrote:
DeckSTAHP wrote:
Connor Pedersen, cease with the immaturity please.
- The actual Jed Morris.Uhh, Mr Morris, that is very inappropriate. Keep on topic, gentlemen.
Mr. Morris, you nerd.
Pedersen, shut your mouth!
Roight, that's the ten minutes of banter over. Time to get serious now.
Again, keep on topic gents and Mr Morris.
Offline
mozzbo wrote:
This is really easy!
I just done it in a few minutes
JD
Sharing is caring!
Offline
mozzbo wrote:
MasterAnonymous wrote:
mozzbo wrote:
This is really easy!
I just done it in a few minutes
JDSharing is caring!
I don't share...
and I don't care...
So there !
You are one creepy individual.
Offline
MasterAnonymous wrote:
For my course at school I need to make:
- An algorithm that will swap over two items in the array, the user supplies the two positions
If you're saying get 1 item, and replace it with a different item in the list and vice versa, then here:
when gf clicked set [first item v] to [1] //item 1 set [second item v] to [2] //item 2 wait until <ready?> //put your own scripts for when it should so this set [saver v] to <item (first item) of [list v]> replace item (first item) of [list v] with <item (second item) of [list v] > replace item (second item) of [list v] with (saver)
- An algorithm that in a separate array will store the lengths of the items (e.g. how many characters in each array item string). The positions must match up, e.g.
Blab (4)
Blaba (5)
Bler (3)
when gf clicked delete (all v) of [items v] delete (all v) of [item lengths v] set [i v] to [1] add item scripts repeat <length of [items v]> insert <length of (item (i) of [items v])> into (last v) of [item lengths v] change [i v] by [1] end
- An algorithm that in a new array stores the same items but without any vowels in them
Can someone please help me with the scripting of these three algorithms?
Thanks in advance.
when gf clicked delete (all v) of [vowels v] delete (all v) of [items v] delete (all v) of [edited items v] add [a] to [vowels v] add [e] to [vowels v] add [i] to [vowels v] add [o] to [vowels v] add [u] to [vowels v] add [whatever you want] to [items v] set [i v] to [1] //both i, c and b are counters set [b v] to [1] set [c v] to [1] repeat <length of [items v]> //putting the item into it's own array delete (all v) of [word editor v] repeat <length of (item (i) of [items v])> insert (letter (b) of (item (i) of [items v])) at (last v) of [word editor v] change [b v] by (1) end set [b v] to [1] repeat <length of [word editor v]> //checking for vowels repeat <length of [vowels v]> //if vowels, delete if <<item (b) of [word editor v]> = <item (c) of [vowels v]>> delete (b) of [items v] end change [c v] by (1) change [b v] by (1) end set [c v] to [1] //resetting for next iteration set [b v] to [1] repeat <length of [word editor v]> //putting it back into the word replace item (1 v) of [word editor v] with <join <item (1 v) of [word editor v]> <item (2 v) of [word editor v]>> end replace item (i) of [items v] with <item (1 v) of [word editor v]> delete (all v) of [word editor v] change [i v] by (1) endAll of them should work, but the only one you might have problems with is the last one because that was the hardest and I didn't check if it works. But they all should.
Offline
That'll do, thanks for your help TorbyFork.
- Jed
Offline
No problem.
- Jed
Offline