[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/cc/ Coding Challenge
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 6
Thread images: 2
File: Crow-Knife-Main.jpg (128 KB, 1200x630) Image search: [Google]
Crow-Knife-Main.jpg
128 KB, 1200x630
 

//Program something in any language
// intepreted or compiled, whatever
//
// Program claim a string
// Program generate Random Number that
// split the string random number of time
// generate a array that pick every ASCII code
// of each char of the string
// at each 3 "ASCII value"
// Multiply first 2, divide by the third
// put it on a array,
// regenerate new string from that
// output on the screen
// (if its a double or single number just cut the
// overflow) if it goes over ascii table divide
// by two again.


>>
File: 1467871737890.jpg (29 KB, 412x430) Image search: [Google]
1467871737890.jpg
29 KB, 412x430
>>55631715
THAT'S NOT THE CORRECT FORMAT. YOU GON GET STABBED SON
>>
OR THIS BIRD IS GONNA STAB YOU!
>>
SLOW
>>
>>55631715
What a shit explanation, but I'll do it anyways.
>>
>>55631869


string claim(string value)
{
if (value.Length % 3 != 0) throw new ArgumentException("Invalid argument: " + nameof(value));

StringBuilder output = new StringBuilder();

for (int i = 0; i < value.Length; i += 3)
{
char firstCharacter = value[i];
char secondCharacter = value[i + 1];
char thirdCharacter = value[i + 2];

int multiplied = firstCharacter * secondCharacter;
int divided = multiplied / thirdCharacter;

while (divided > 128) divided /= 2;

output.Append((char)divided);
}

return output.ToString();
}
Thread replies: 6
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.