+ 7
Not-so daily coding challenge 2
Make a simple code that converts a text entered by the user into leetspeak. I you are unfamiliar with leetspeak, ask wikipedia. Each letter should have a replacement. When you did this, post the code here, also tell me if future challenges should be harder or easier.
14 Réponses
+ 20
@Valdemar but jff it's perfect.
+I just tested console input: 4-5 rows.
+ 19
@Supersebi3 gimme couple minutes to finish my art and I'll do that
@Tobi link plz
+ 19
it's not bad but easier than others
+ 18
@Supersebi3
Not that long to do. Finishing art took more time))
https://code.sololearn.com/cVxa8aaP17pZ/?ref=app
+ 18
here is a bit shorter version:
https://code.sololearn.com/cDhRF79987Ks/?ref=app
+ 12
@Supersebi What are ou trying to do? 😂😂😂😂😂😂
+ 6
@Squidy I said every letter should have a replacement... this is also pretty long, try to make it as compact as you can
+ 6
This is probably a bad challenge, im sorry for that. the thing is, the last challenge seemed to be a bit too hard so I tried to do something easier, but this is just bad. next will hopefully be better...
+ 5
@Tobi if ill make it tomorrow...
+ 4
@Tobi too hard for me sorry
+ 2
Normally I wouldn't do these, but I'm SUPPOSED to be studying for exams, so...
std::string toL337(std::string input) {
for (size_t i = 0; i < input.size(); ++i) {
switch (tolower(input[i])) {
case 'a':
input[i] = '4';
break;
case 'e':
input[i] = '3';
break;
case 'i':
input[i] = '1';
break;
case 'o':
input[i] = '0';
break;
case 's':
input[i] = '5';
break;
case 't':
input[i] = '7';
break;
}
}
return input;
}
And yes, they should be a lot harder.
Edit: I was going by "basic leet" as defined here: http://www.robertecker.com/hp/research/leet-converter.php
Every letter? That's not challenging; that's just tedious. I'll leave it to the next person with more patience than me. ;_;
+ 2
Make it more difficult please. I'm also not going to implement a solution, though.
But if you need a little productive procrastination, consider doing my Easter challenge. Should be simple enough, although future incarnations will become significantly harder. Given that I get at least some people here interested.
+ 1
@Supersebi: I'll look into your other challenge tomorrow, if I can find it.
@Illusive Man: Part 2 is here:
https://www.sololearn.com/Discuss/324478
+ 1
Replace scans through all symbols in the string and looks for characters to replace. You are scanning the whole string more than 20 times, so if you would want to 1337-ify some long text, like a book, this would not be a best solution ☺️