Skip to content

Instantly share code, notes, and snippets.

@sorah
Forked from VoQn/gist:573114
Created September 10, 2010 05:02
Show Gist options
  • Select an option

  • Save sorah/573131 to your computer and use it in GitHub Desktop.

Select an option

Save sorah/573131 to your computer and use it in GitHub Desktop.

Revisions

  1. sorah revised this gist Sep 10, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    puts (1..100).map{|i|s=(i%3==0?"Fizz":'')+(i%5==0?"Buzz":'');s==""?i:s}
    100.times{|i|s=(i%3==0?"Fizz":'')+(i%5==0?"Buzz":'');puts s==""?i:s}
  2. sorah revised this gist Sep 10, 2010. 2 changed files with 1 addition and 10 deletions.
    1 change: 1 addition & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    puts (1..100).map{|i|s=(i%3==0?"Fizz":'')+(i%5==0?"Buzz":'');s==""?i:s}
    10 changes: 0 additions & 10 deletions gistfile1.sls
    Original file line number Diff line number Diff line change
    @@ -1,10 +0,0 @@
    ;; Shortest? FizzBuzz
    (use srfi-1)
    (map (lambda (n)
    (let ((mul? (compose zero? (pa$ remainder n))))
    (cond ((zero? n) n)
    ((mul? 15) 'FizzBuzz)
    ((mul? 5) 'Buzz)
    ((mul? 3) 'Fizz)
    (else n)))
    (iota 101)))
  3. VoQn revised this gist Sep 10, 2010. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sls
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ;; Shortest? FizzBuzz
    (use srfi-1)
    (map (lambda (n)
    (let ((mul? (compose zero? (pa$ remainder n))))
    (cond ((zero? n) n)
  4. VoQn created this gist Sep 10, 2010.
    9 changes: 9 additions & 0 deletions gistfile1.sls
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    ;; Shortest? FizzBuzz
    (map (lambda (n)
    (let ((mul? (compose zero? (pa$ remainder n))))
    (cond ((zero? n) n)
    ((mul? 15) 'FizzBuzz)
    ((mul? 5) 'Buzz)
    ((mul? 3) 'Fizz)
    (else n)))
    (iota 101)))