Permalink
Browse files

Working towards new versions of the examples.

  • Loading branch information...
1 parent c2da8c2 commit 13f6b037e26852aab428a6ce30a3f328700e30b0 @jashkenas committed Oct 25, 2010
Showing with 568 additions and 573 deletions.
  1. +0 −4 examples/code.coffee
  2. +1 −1 examples/poignant.coffee
  3. +2 −2 examples/potion.coffee
  4. +565 −566 examples/underscore.coffee
View
@@ -128,10 +128,6 @@ activity = switch day
# Semicolons can optionally be used instead of newlines.
wednesday = -> eat_breakfast(); go_to_work(); eat_dinner()
-# Array slice literals.
-zero_to_nine = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
-three_to_six = zero_to_nine[3..6]
-
# Multiline strings with inner quotes.
story = "Lorem ipsum dolor \"sit\" amet, consectetuer adipiscing elit,
sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
View
@@ -177,5 +177,5 @@ wipe_mutterings_from = (sentence) ->
while sentence.indexOf('(') >= 0
open = sentence.indexOf('(') - 1
close = sentence.indexOf(')') + 1
- sentence = sentence[0..open] + sentence[close..sentence.length]
+ sentence = sentence.slice(0, open) + sentence.slice(close, sentence.length)
sentence
View
@@ -2,7 +2,7 @@
# 5 times: "Odelay!" print.
-print "Odelay!" for [1..5]
+print "Odelay!" for i from 1 to 5
# add = (x, y): x + y.
@@ -166,7 +166,7 @@ while count > 0
# 1 to 5 (a):
# a string print.
-print a for a in [1..5]
+print a for a from 1 to 5
# if (3 ?gender):
Oops, something went wrong.

0 comments on commit 13f6b03

Please sign in to comment.