Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code Challenge - Created by Ace
#1
I thought it would be fun to post a little small challenge for others Smile

The challenge here is to explain (as best as possible) how my snippet of code here works:

Code:
Func<string, bool> f_sb = x => x.All(c => char.IsNumber(c));
string[] input = {"abc", "ABC", "sdf", "23b", "3a4", "521", "aaa", "642", "lkj", "243"};
Console.WriteLine(input.Where(x => f_sb.Invoke(x)).ToArray().Aggregate((a, b) => a + b));

Maybe you'll learn something from it also? If so, then that is not a bad thing. It's not too hard to figure out if you don't look at it as one piece, break it up and follow the logic. The better you explain it, the more I can appreciate your reply to this challenge, as anybody can run this and tell me what the result is, but maybe only some people here can explain what it's doing Smile

Victoire
Reply


Messages In This Thread
Code Challenge - Created by Ace - by AceInfinity - 04-23-2012, 06:33 AM
RE: Code Challenge - Created by Ace - by BreShiE - 04-23-2012, 11:51 PM
RE: Code Challenge - Created by Ace - by BreShiE - 04-24-2012, 10:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Get Country Code In 1 Line Of Code. wchar_t 13 4,085 11-28-2012, 06:49 AM
Last Post: Cubs
  Disc Dash Bot - Created by AceInfinity AceInfinity 2 1,055 07-13-2012, 08:23 PM
Last Post: AceInfinity
  FBytes - Binary Merge Tool - Created by AceInfinity AceInfinity 2 1,035 01-07-2012, 04:47 PM
Last Post: AceInfinity
  File Profiler Demo - Preview - Developed by Ace AceInfinity 4 1,241 12-30-2011, 08:17 PM
Last Post: AceInfinity
  New System Diagnostic Tool - Created by Ace AceInfinity 28 7,652 11-21-2011, 09:55 AM
Last Post: UrbanByte

Forum Jump:


Users browsing this thread: 1 Guest(s)