Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Prog challange ngrams

Name: Anonymous 2011-03-26 8:19

In the language of your choice list in order of frequency bi-grams and tri-grams posted to /prog/.

Name: Anonymous 2011-03-26 10:56

Ruby:

case input
when Array: puts 'input is an Array!'
when Hash:  puts 'input is a Hash!'
end


Lisp (DSL)

say "input is $(input.{array? -> "an Array!"
                      ;hash?  -> "a Hash!"})"



Ruby:

catfood = case
          when cat.age <= 1: junior
          when cat.age > 10: senior
          else               normal
          end


Lisp (DSL)

catfood =: cat.age.{?<=1 -> junior
                   ;?>10 -> senior
                   ; _   -> normal}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List