I said in the first Challenge.
without telling the challenge.
Well, since i started this i will do the opposite here.
Questions:
Why does this not work?
What has to change to make it work, and why is that?
Can you do this another way?
I said in the first Challenge.
without telling the challenge.
Well, since i started this i will do the opposite here.
Questions:
Why does this not work?
What has to change to make it work, and why is that?
Can you do this another way?
Ok, @Peter
Do I need to figure out a proper bug-free solution?
Edit: I got the challenge, can i tell it?
I feel it’s syntactically right, but semantically incoherent.
The output will be what’s desired, but the blocks are slightly misplaced so variables don’t contain what they say they do.
@Peter am I right?
Yes of course you can. One must be the first.
Not exactly. It works as it should but you have to replace one block.
Got it
is it about switching blocks of “then” and “else” part of if-else
Here’s how it works:
A loop is run 10 times (once for every numeric digit).
In each iteration, every occurrence of the current digit is removed from the text and replaced with an empty string. (Text “H3e00llo12” -> “H3ello12” in the first iteration)
A nested loop is executed “X” number of times, where “X” is the difference between the lengths of the text before and after replacement. (In the example above, 10 - 8 = 2)
In each iteration of the nester loop, the current digit is appended to the splitText
variable. (In the first iteration, splitText
becomes “00”)
Once execution moves out of the loop, the rest of the text (which is guaranteed to have no digits now) is appended to splitText
.
(The final value of splitText
should look like “00123-Hello”)
@Peter I’ve added the *daily-challenge tag to this topic so that we can, in the future, find all daily challenges easily.
Nope
These are the things you have to do…
And to answer…
I guess no new answers will follow.
You have to replace the “is string?” block with a “is number?” block.
Look at the blocks below how Kodular interprets strings and number with the different blocks. The number block accepts numbers in textboxes and numberboxes. The string block only accepts numbers in a textbox not a numberblock.
That’s why when i wanted to sort letters and numbers, for instance
a1b2c3 into abc - 123
i had to make sure that a number would be treated like a number.
Why you are not in teacher’s group? Apply today
And keep up the good work
Who wants a crazy teacher?
A crazy teacher has some crazy knowledge…!!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.