Skip to content

Instantly share code, notes, and snippets.

@nrkn
Created March 22, 2012 23:33
Show Gist options
  • Save nrkn/2165487 to your computer and use it in GitHub Desktop.
Save nrkn/2165487 to your computer and use it in GitHub Desktop.
My eyes the googles do nothing
Console.Write(
Enumerable
.Range( 0, 7 )
.Where( bit => bit % 2 == 0 )
.Aggregate(
String.Empty,
( result, bit ) => result + ( bit / 2 < 2 ? "apples" : "oranges" )
)
);
/* ----- */
var result = String.Empty;
for( var i = 0; i < 7; i++ ) {
if( i % 2 != 0 ) continue;
if( i / 2 < 2 ) {
result += "apples";
}
else {
result += "oranges";
}
}
Console.Write( result );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment