In functional programming, continuation-passing style is a style of programming in which control is passed explicitly in the form of a continuation.
History
Gerald Jay Sussman and Guy L. Steele, Jr. coined the phrase "continuation-passing style" in AI Memo 349 (1975), defining the first version of the Scheme programming language.
Introduction
Instead of "returning" values as in the more familiar direct style, a function written in continuation-passing style (CPS) takes an explicit "continuation" argument, i.e. a function which is meant to receive the result of the computation performed w...
So instead of returning a result, you call another function with the result.
But you can see how, if you combine that with something that doesn't require semicolons, like the condition of an if, than you can easily write any complicated code without requiring semicolons.
I currently have 35 consecutive. I had about 50-odd consecutive prior to Christmas, but I stayed away from the computer during Christmas to spend with family, so, sadly, I had to start all over again.
> Dr. Rajesh Ramayan[3][4]"Raj" Koothrappali (Kunal Nayyar) is Howard Wolowitz's best friend, and yet another genius of the group; his name is usually shortened to "Raj". He is originally from New Delhi, India, and he works in the Physics department at Caltech, where his area of expertise is particle astrophysics. Raj is extremely shy when it comes to dealing with women; he is unable to speak to them unless he drinks alcohol.
> When Penny is around, Raj usually whispers what he wants to say to Howard or Leonard, who then responds out loud. Despite his pathology, Raj has often ended up in bed with women, leaving the other guys perplexed
The following is a list of characters from the American situation comedy The Big Bang Theory created and executive produced by Chuck Lorre and Bill Prady, which premiered on CBS on September 24, 2007. It concerns two prodigies in their 20s, one a theoretical physicist and the other an experimental physicist, who work at Caltech and live across the hall from a waitress with show-biz aspirations. Their geekiness and intellect are contrasted by her social skills and common sense.
Main characters
* Dr. Leonard Leakey Hofstadter (Johnny Galecki) is an experimental physicist with an IQ of 173...
@RebeccaChernoff It's pretty good. One user decided that the community "disappointed" him, and is thus leaving, but I think things are mostly trucking along.
What general tips do you have for golfing in C#? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C# (e.g. "remove comments" is not an answer). Please post one tip per answer.
-- borrowed from marcog's idea ;)
C# 119 characters:
bool l(string n){return(String.Join("",n.Reverse().Select((x,i)=>(x-48)*(i%2<1?2:1)+"").ToArray()).Sum(x=>x-48))%10<1;}
Not too bad for a code golf n00b in a statically typed language, I hope.
@RebeccaChernoff I want to write a "tips for golfing Scheme" and "tips for golfing GolfScript" (though I'm probably not qualified to comment on the latter, at least once we have more "professional" golfers come to the site when the site goes into public beta).
@ChrisJesterYoung (The "nasal demon" reference was in response to someone testing out (letrec ((x (cons 1 x))) x) in Scheme. That's an error condition, but since R5RS doesn't say what is required to happen with error conditions, it effectively allows undefined behaviour.)
Write a program to play the popular English nursery rhyme.
Some Wikipedia articles that may be useful:
Twinkle Twinkle Little Star (has an audio clip of what your program's output should sound like)
Modern musical symbols (to learn about the music notation used above)
Note#Note frequency (he...
There must be a better/shorter way, but here's my Haskell solution in 96 characters:
l=(==0).(`mod`10).sum.zipWith($)(cycle[id,\x->x`mod`5*2+x`div`5]).reverse.map((+(-48)).fromEnum)
Sadly the digitToInt function can only be used if you import Data.Char first. Otherwise I could get down to 8...
That just took me a lot of more work than I expected it to...