Create a procedure that takes a parameter, modifies it and returns using this algorithm:
- Replaces every letter in the string with the next letter in alphabet (e.g. c becomes d, z becomes a).
- Checks modified string and determine if it contains vowels (a, e, i, o, u) and if so, capitalizes the vowels.
nextLetters(hello3) -> Ifmmp3
nextLetters(fun times!) -> gvO Ujnft!
Somehow I am able to do it
Great job @vknow360 . Also, take a look at below. Does that give you (or others) idea for other possible solutions?
@Italo Block below is only for purpose of illustration and needs fine-tuning.
Basically, lookup the character in list1. If it exists, using FOUND-index, get its associated entry in list2 Notice that list2 is one-off from list1
Very clever solution!
Also I didn’t think of using look up in pairs. It allows you to change the coding to something totally random every time you want.
I also like how @vknow360 coded a whole procedure without using the look up in pairs block. It helps develop the coding skills.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.