Mateja
(Mateja)
May 19, 2020, 4:26pm
#1
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
Yoshi
(KidKoder)
May 19, 2020, 4:28pm
#2
Cool to see another DC from you, @Mateja ! Love your idea and will try to solve it!
1 Like
Yoshi
(KidKoder)
May 19, 2020, 5:16pm
#3
Hey, a question: What if the number exceeds text length? Any rules?
Mateja
(Mateja)
May 19, 2020, 5:16pm
#4
No, just ignore it and let Kodular return its own error
Mateja
(Mateja)
May 19, 2020, 5:18pm
#6
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
Mateja:
Have fun
I used 33 blocks (just the procedure block)
Btw,
My solution
Proof:
3 Likes
Yoshi
(KidKoder)
May 19, 2020, 6:09pm
#9
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
Mateja
(Mateja)
May 19, 2020, 6:09pm
#10
At this point, the variable names aren’t even funny anymore
Yoshi
(KidKoder)
May 19, 2020, 6:13pm
#12
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
Yoshi
(KidKoder)
May 19, 2020, 6:38pm
#15
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?
Mateja:
spoilerrrrr
Oh no I forgot
Hope not many people saw that
Yoshi
(KidKoder)
May 19, 2020, 6:43pm
#17
No worries, only 2 (@Mateja an me)! See your views
I edited the post. I have 33 blocks in total.
Yoshi
(KidKoder)
May 19, 2020, 6:44pm
#19
WatermelonIce:
33 blocks in total.
Cool! You use YailLists in the main code, right?
Yoshi:
YailLists
I’m sorry but I really duuno what YailLists are.
1 Like