Daily Challenge #71

This one is simple.
Ask for a number, and a string, and a Boolean. If the Boolean is `true`, the program should convert all letters to lowercase, but should convert the nth letter in the string to uppercase, and the other way around.

Sample:

``````procedure(2,"kodular",True) => kOdular
procedure(8,"this is fun",False) => THIS IS FUN #the 8th letter is a space
procedure(7,"this is fun",False) => THIS Is FUN
``````

Have fun

1 Like

Cool to see another DC from you, @Mateja! Love your idea and will try to solve it!

1 Like

Hey, a question: What if the number exceeds text length? Any rules?

No, just ignore it and let Kodular return its own error

I donâ€™t get what you are saying.
7, â€śthis is funâ€ť and False are inputs.

what do you mean
you need to obtain a Boolean, how could you return the Boolean?

I started to use procedure block frequently because of these DC. Thatâ€™s great
Edit: It might not be the best and simplest solution but I

I used 33 blocks (just the procedure block)

Btw,

My solution

Proof:

3 Likes

Am late againâ€¦
anyway, hereâ€™s my

Solution

Proof of functionality:

with 53 blocks and without using YailLists . Someone has a better one? (only the procedure)

Waitâ€¦ have an errorâ€¦

1 Like

At this point, the variable names arenâ€™t even funny anymore

lol. okay.

Now itâ€™s fixedâ€¦

Really? I always use these variable names bc of not mixing them with my actual variable names bc I make these DC procedures always in my own projects without opening another

Why not just

2 Likes

1 Like

Yeah ok I actually didnâ€™t know if that works or not. But pls do what @Mateja said and also how many blocks did you use?

Oh no I forgot
Hope not many people saw that

No worries, only 2 (@Mateja an me)! See your views

I edited the post. I have 33 blocks in total.

Cool! You use YailLists in the main code, right?

Iâ€™m sorry but I really duuno what YailLists are.

1 Like

App Inventor lists

1 Like