]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/rosetta-code/knapsack/knapsack.factor
Harmonize spelling
[factor.git] / extra / rosetta-code / knapsack / knapsack.factor
index a33034459965aeb1e2cf2f05f67fc560c99e98b9..83417eae3f5280fe1d5818241c971c7639a99f21 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays fry io kernel locals make math
-math.order math.parser math.ranges sequences sorting ;
+USING: accessors arrays io kernel make math math.order
+math.parser ranges sequences sorting ;
 IN: rosetta-code.knapsack
 
 ! http://rosettacode.org/wiki/Knapsack_problem/0-1
@@ -24,7 +24,7 @@ IN: rosetta-code.knapsack
 
 ! Which items does the tourist carry in his knapsack so that
 ! their total weight does not exceed 400 dag [4 kg], and their
-! total value is maximised?
+! total value is maximized?
 
 TUPLE: item
     name weight value ;
@@ -63,7 +63,7 @@ CONSTANT: limit 400
     item-no table nth :> prev
     item-no 1 + table nth :> curr
     item-no items nth :> item
-    limit [1,b] [| weight |
+    limit [1..b] [| weight |
         weight prev nth
         weight item weight>> - dup 0 >=
         [ prev nth item value>> + max ]